Code Monkey home page Code Monkey logo

webapis's People

Contributors

jll32 avatar lordnoteworthy avatar sickl8 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

savobit mwolf1989

webapis's Issues

fix: File not found - should return 404 instead of 500 in the /summary endpoint

Example :

  1. https://api.saferwall.com/v1/files/51caae41376b1b031ff6e35c9180eae57d702a44538942e01a33b86afdcd985d
{
  "status": 404,
  "message": "The requested resource was not found."
}
  1. https://api.saferwall.com/v1/files/51caae41376b1b031ff6e35c9180eae57d702a44538942e01a33b86afdcd985d/summary
{
  "status": 500,
  "message": "We encountered an error while processing your request."
}

Expected:

(2) response should be same as (1) response

{
  "status": 404,
  "message": "The requested resource was not found."
}

Improve Error Messages

  • Capitalize error messages.
  • Better error translation, not:
"There is some problem with the data you submitted."
"Key: 'CreateUserRequest.Username' Error:Field validation for 'Username' failed on the 'alphanum' tag"

Fix returned HTTP response for some specific cases

  • Get/files/sha256?fields=x always includes comments_count, we should omit that field.
  • Get /files/sha256?fields=not_exist return internal error, we should return bad request or something like that.
  • When there is no activity, the log shows some internal server error.
  • Following a non existing user returns ok

Delete a user account

  • find all user's document that follow that user and update them
  • find all user activities and delete them.

fix Endpoint : /files/sha256/strings returns schema

I got an array of one object in the element fields. (items[0])

{
  "items" : [{
    "asci" : ["abc","efg"],
    "xyz":[]
  }]
}

It should be one of those:

{
  "items" : {
    "asci" : ["abc","efg"],
    "xyz":[]
  }
}

or

{
  "items" : [
    { "encoding":"asci", "value":"abc"}, 
    { "encoding":"asci", "value":"efg"}
  ]
}

or

{
  "items" : [
    ["asci", "abc"], 
    [ "asci", "efg"]
  ]
}

for me I think it is better to choose the 1st one to avoid duplicating the strings, but just to make it object instead of array.

Display a list of random active users for people to follow

When a user register an account and log in for the first time, no activity is being displayed which is a bit confusing for the user, as with an anonymous account, we display all activities.

We should display a message to the user to start following some users.

Maybe we should always have a view to recommend some active users to registered accounts.

hard code max file size

image

I tried to increase the max upload file size but it didn't work. Looks like it was hardcoded in the api.go . file

Comments endpoint invalid http response code and other issues

Issue 1

POST with a valid body and Authorization header on /v1/comments/ responds with 500 Internal Server Error with a the body:

{
    "status": 500,
    "message": "We encountered an error while processing your request."
}

instead of 201 Created, a subsequent get request to the comments resource shows that the comment did go through.

Issue 2

Go comments endpoint doesn't have the // @Security Bearer guard, although it's required and would fail with 401 Unauthorized without it, I generate the typescript API file from the swagger OpenAPI output in docs/swagger.json using openapi-generator-cli from npm.
This issue might affect the other comment endpoints with the other methods (DELETE, UPDATE, etc)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.