Skip to content

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

Open
q42jaap wants to merge 1 commit intoRicoSuter:masterfrom
q42jaap:master
Open

Custom extension x-enumMetaData to expose title and description for an enum value.#1383
q42jaap wants to merge 1 commit intoRicoSuter:masterfrom
q42jaap:master

Conversation

@q42jaap
Copy link
Copy Markdown

@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.

2 participants