Skip to content

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

@Monkatraz

Description

@Monkatraz

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions