You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the openapi3 emitter version 0.66.0.
When the @tagMetadata is not applied on the namespace the Operations are grouped by their tag in the order defined.
When the @tagMetadata decorator is used the tags are reordered alphabetically and the order of tags is no longer preserved.
tags:
- name: Child Widgetsdescription: My description
- name: Widgetsdescription: My description
without @tagMetadata
tags:
- name: Widgets
- name: Child Widgets
First I do agree this is not good consitencyhowever I think the operation order as in the 2nd one is not a good order to prevent changes(#2293) Any reason you want it that way instead of having it alphabetized?
Correct using the @tagMetadata decorator is impacting the order that tags are emitted in the openapi spec which impacts the order in SwaggerUI.
As far as controlling the order of operations this is mostly for a "logical" order. Having parent resources appear before child (we could probably group these in the same tag as well but currently we are not).
We also typically have the more commonly used operations towards the top.
We have some utility type operations that are on every api that we typically put at the end.
I know the order can be controlled via SwaggerUI or other interfaces as well so ordering is not guaranteed. I was just surprised to see it change one I started using the tagMetadata as it had always been ordered based on the order of operations in my typespec file previously.
Describe the bug
Using the openapi3 emitter version 0.66.0.
When the @tagMetadata is not applied on the namespace the Operations are grouped by their tag in the order defined.
When the @tagMetadata decorator is used the tags are reordered alphabetically and the order of tags is no longer preserved.
Reproduction
Without @tagMetadata
Using @tagMetadata
Checklist
The text was updated successfully, but these errors were encountered: