stoplightio / elements

Build beautiful, interactive API Docs with embeddable React or Web Components, powered by OpenAPI and Markdown.
https://stoplight.io/open-source/elements/
Apache License 2.0
1.62k stars 190 forks source link

Add support for custom badges #2457

Open manvydasu opened 8 months ago

manvydasu commented 8 months ago

Currently, stoplight supports "Deprecated" and "Internal" badges near the title of endpoint. It would be nice to add support of custom badges, i.e. "Preview", or "Beta", or something similar.

Context

Trying to render a custom badge near endpoint name.

Current Behavior

Only hardcoded set amount of badges is supported.

Expected Behavior

I'd expect to be able to provide "x-preview" extension on the Open API spec and see "Preview" badge near the endpoint. Bonus points, if text can be controlled.

ryotrellim commented 7 months ago

Hello @manvydasu! I appreciate the feature request.

Quick follow-up question: Is your use case primarily communicating lifecycles or "stages" in the UI, or are there other ideas you're trying to inject into the UI?

manvydasu commented 7 months ago

@ryotrellim Hello,

Yes, in a way I would like to communicate extra information in the UI. Lets say I'd like to indicate, that a particular endpoint is in beta version and breaking changes might be introduced unexpectedly for it.