NJsonSchema icon indicating copy to clipboard operation
NJsonSchema copied to clipboard

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

Open q42jaap opened this issue 3 years ago • 0 comments

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.

q42jaap avatar Jun 29 '21 15:06 q42jaap