hasura / hasura/ndc-open-api-lambda

Support for responses with no body (like 204)

Open
#92 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4
Forks
2
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.