Support for 200 and 201 responses that have different models
- Dominant language
- C#
- Stars
- 3.8k
- Forks
- 333
- Avg merge
- 16h 29m
- Merged PRs (30d)
- 116
Description
Example: https://github.com/apidescriptions/nightscout/blob/main/spec/cadl-output/%40cadl-lang/openapi3/openapi.yaml#L76
This is going to be challenging because we don't know what signature to return. We could pretend this is a special kind of oneOf and create a wrapper that has the 200 response and the 201 response as properties.
We need to be careful though because it would mean that adding a new 201 response with a different shape would be a breaking change to the client.
Contributor guide
Research direction
Start with the linked OpenAPI example at spec/cadl-output/@cadl-lang/openapi3/openapi.yaml around line 76 and inspect how its 200 and 201 response models are represented. Trace the generator entry point that consumes these responses and determine the expected client signature, including how an additional differently shaped 201 response would affect compatibility. Done means the behavior is defined and covered for distinct 200 and 201 models.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi
- Domain
- backend-api-design, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100