Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistence in /wallet-api/auth/create #71

Closed
alegomes opened this issue Jan 19, 2024 · 4 comments
Closed

Inconsistence in /wallet-api/auth/create #71

alegomes opened this issue Jan 19, 2024 · 4 comments

Comments

@alegomes
Copy link
Contributor

alegomes commented Jan 19, 2024

Version tested: v1.0.2401181053-SNAPSHOT

I think /wallet-api/auth/create endpoint could be more specific and consistent in the failed response messages.

Take a look at these four scenarios. They all demonstrate the API call with some missing field. However, the answers vary from one call to another.

Scenario 1. type field omitted.

Request

curl -X 'POST' \
  'http://localhost:4545/wallet-api/auth/create' \
  -H 'accept: */*' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "Max Mustermann",
  "email": "user@email.com",
  "password": "password"}'

Response

{"exception":"true","status":"Bad Request","code":"400","message":"Polymorphic serializer was not found for missing class discriminator ('null')\nJSON input: {\"name\":\"Max Mustermann\",\"email\":\"user@email.com\",\"password\":\"password\"}"}

Scenario 2. password field omitted

Request

curl -X 'POST' \
  'http://localhost:4545/wallet-api/auth/create' \
  -H 'accept: */*' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "Max Mustermann",
  "email": "user@email.com",
  "_password": "password",
  "type": "email"
}'

Response

{"exception":"true","status":"Bad Request","code":"400","message":"Field 'password' is required for type with serial name 'email', but it was missing at path: $"}

Scenario 3. email field omitted

Request

curl -X 'POST' \
  'http://localhost:4545/wallet-api/auth/create' \
  -H 'accept: */*' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "Max Mustermann",
  "_email": "user@email.com",
  "password": "password",
  "type": "email"
}'

Response

{"exception":"true","status":"Bad Request","code":"400","message":"Field 'email' is required for type with serial name 'email', but it was missing at path: $"}

Scenario 4. name field omitted

Request

curl -X 'POST' \
  'http://localhost:4545/wallet-api/auth/create' \
  -H 'accept: */*' \
  -H 'Content-Type: application/json' \
  -d '{
  "_name": "Max Mustermann",
  "email": "user@email.com",
  "password": "password",
  "type": "email"
}'

Response

{"exception":"true","status":"Internal Server Error","code":"500","message":"Could not register user"}
Copy link

This issue has been marked as stale.

@alegomes
Copy link
Contributor Author

Not stale, as explained in #72

@alegomes alegomes reopened this Mar 29, 2024
@github-actions github-actions bot removed the Stale label Mar 29, 2024
Copy link

This issue has been marked as stale.

@github-actions github-actions bot added the Stale label May 28, 2024
@waltkb waltkb removed the Stale label Jun 4, 2024
@SuperBatata
Copy link
Contributor

should be fixed with this pr : #597

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants