Skip to content

ApiRepsonse data incorrectly typed for empty responses #2

@RobinClowers

Description

@RobinClowers

One of my APIs has a 204 response defined, but the ApiResponse itself seems to always type data as an object, even though in this case it can be undefined.

This is what my operation responses look like:

    responses: {
      200: {
        content: {
          "application/json": components["schemas"]["Region"];
        };
      };
      202: {
        content: {
          "application/json": components["schemas"]["Region"];
        };
      };
      204: never;
    };

But the data property is typed as Region, rather than Region | undefined.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions