microsoft / microsoft/typespec
Make openapi3 output consistent in ordering
- Dominant language
- Java
- Stars
- 5.9k
- Forks
- 394
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 104
Description
Currently object properties are emitted in the order of the JS properties which depends in which order they are added to the object.
This means an implementation change can change the order of emitted properties, which is undesirable.
See the corresponding [issue](https://github.com/Azure/typespec-azure/issues/3086) and [fix](https://github.com/Azure/typespec-azure/pull/3121) for the autorest emitter.
The ordering for autorest (OpenAPI v2) should largely work for OpenAPI v3, but there is one thing to call out. The `requestBody` property currently appears _after_ `responses` (because of the order they are added to the JS object), but in the order output `requestBody` should come before `responses`. This is based on input from an external adopter of TypeSpec/openapi3.
Contributor guide
Assessment
This issue has not been assessed yet.