Skip to content

Support for responses with no body (like 204) #92

@andytson-inviqa

Description

@andytson-inviqa

Currently the generated api.ts HttpClient class doesn't support responses that return 204.

It would be good for it to support that when a openapi spec response has no body defined.

path:
  /customers/:customerId
    delete:
      parameters:
        - name: customerId
          in: path
          required: true
          schema:
            type: integer
          description: Customer ID
      responses:
        '204':
          description: Customer removed

This means also if there's no body,

  • the current data or error HttpResponse needs to handle success cases where data is not returned, such as by returning the Response.ok field, for use for the functions.ts method
  • to not call response[responseFormat]()
  • to handle typescript generics in a way that allows nullable response types

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