x-traitTag undepreceated, but not functional
Hi, x-traitTag was depreceated around 1.4 version and undepreceated much later - however the code displaying tag disappeared from project - only the "continue" in MenuBuilder left.
Do you plan to bring back this functionality? I have to display badges with tag name (and possibly anchor to external doc)
Thanks for the report. Yes, functionality disappeared during the rewrite. I will bring it back once I have some time.
PRs are welcome too!
Have been looked into the x-traitTag property and as far as I can see it currently has little or no effect. While tags with x-traitTag=true are displayed in the left-hand side menu, adding a tag with x-TraitTag true to an operation does nothing related the display of the operation.
This is also documented in closed issue https://github.com/Redocly/redoc/issues/884
The comment https://github.com/Redocly/redoc/issues/141#issuecomment-262399440 from @RomanHotsiy in 2016 seems to indicate it was previously shown as a greyed out text line under the operation name, but this is no longer the case as far as I can see (with my limited knowledge of redoc)
Started analysing what needs to be changed to support x-traitTag
- src/components/Operation/Operation.tsx must be updated to display the trait tags below the summary of the operation
Suggest to use
<Badge type="warning">or<OperationBadge>for display the name of the tag - src/services/models/Operation.ts
OperationModelmust be updated to add a property of all traitTags - src/services/MenuBuilder.ts Update function
getOperationsItemsto push the tag to the constructor of OperationModel ? - Also update other places where constructor of OperationModel called? src/services/models/Callback.ts and src/services/models/Webhook.ts
Does the analysis make sense, or is something missing ?
Would it make sense to introduce x-traitTagType which is passed to the Badge or OperationBadge to be able to affect how the traitTag is displayed (as information, warning etc) ?
PS Are there any ongoing OpenAPI standardization efforts which should be taken into consideration?
https://github.com/Redocly/redoc/issues/1909