Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom extension x-enumMetaData to expose title and description for an enum value. #1383

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

q42jaap
Copy link

@q42jaap q42jaap commented Jun 29, 2021

Display or Description attributes from System.ComponentModel(.DataAnnotations) on enum values currently do not result in readable output on the JSON schema.

This change adds the x-enumMetaData array with objects that have title and description properties.

The two properties behave exactly like they do for normal types that are converted to schema, so this should feel very familiar to developers.

My use case for this is auto generating a basic editor UI using json schema. Currently there is no good way to create a title and description for individual enum members.

Display or Description attributes from System.ComponentModel(.DataAnnotations) on enum values currently do not result in readable output on the JSON schema.

This change adds the x-enumMetaData array with objects that have `title` and `description` properties.

The two properties behave exactly like they do for normal types that are converted to schema, so this should feel very familiar to developers.
@q42jaap q42jaap changed the title Adds custom extension x-enumMetaData Custom extension x-enumMetaData to expose title and description for an enum value. Jun 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants