aws-pdk icon indicating copy to clipboard operation
aws-pdk copied to clipboard

[FEATURE] (type-safe-api) Better code generation for "default" responses in OpenAPI

Open cogwirrel opened this issue 1 year ago • 1 comments

Describe the feature

OpenAPI lets you define a default response.

Currently code generation treats this as a 0 response code, however we should generate code which conforms better to the specification.

Use Case

More intuitive behaviour for a given OpenAPI spec.

Proposed Solution

  • Handler wrappers should allow returning any response code (ideally other than other defined responses) with alongside the modelled response.
  • Clients/hooks should deserialise responses to the appropriate modelled response for any default responses with 2XX codes. Possibly combine with #821 to deserialise error responses too.

Other Information

No response

Acknowledgements

  • [X] I may be able to implement this feature request
  • [X] This feature might incur a breaking change

PDK version used

0.23.60

What languages will this feature affect?

Typescript, Java, Python

Environment details (OS name and version, etc.)

OSX

cogwirrel avatar Oct 08 '24 21:10 cogwirrel

This issue is now marked as stale because it hasn't seen activity for a while. Add a comment or it will be closed soon. If you wish to exclude this issue from being marked as stale, add the "backlog" label.

github-actions[bot] avatar Dec 09 '24 00:12 github-actions[bot]