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 and fix 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.
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 and fix 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
requestBodyproperty currently appears afterresponses(because of the order they are added to the JS object), but in the order outputrequestBodyshould come beforeresponses. This is based on input from an external adopter of TypeSpec/openapi3.