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

4XX status codes aren't understood like 400, 401, etc. #26

Open
Monkatraz opened this issue Mar 5, 2022 · 0 comments
Open

4XX status codes aren't understood like 400, 401, etc. #26

Monkatraz opened this issue Mar 5, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@Monkatraz
Copy link

Monkatraz commented Mar 5, 2022

This is fairly simple:

# this gets understood correctly
responses:
  200: { description: "OK" }
  400: { description: "Bad Syntax" }

# this doesn't
responses:
  200: { description: "OK" }
  4XX: { description: "Error" }
  
# (imagine that the 400/4XX codes returned a schema named `ApiError`)

The return types of functions will, example, should be like this:

ApiResponse<void>

But instead, 4XX will be understood as a "success", so it'll actually generate a type like this:

ApiResponse<ApiError>
// or, if the function should return something:
ApiResponse<SomeReturnData | ApiError>
@Monkatraz Monkatraz added the bug Something isn't working label Mar 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant