Skip to content

Custom Schema Properties

Rico Suter edited this page Sep 27, 2016 · 7 revisions
  • Package: NJsonSchema.Annotations

You can add custom properties to the JSON Schema with the JsonSchemaExtensionDataAttribute attribute. Keep in mind that JSON Schema only allows x--prefixed property names.

The attribute can be used on properties and classes:

[JsonSchemaExtensionData("x-ui-color", "blue")]
public class Person
{
    [JsonSchemaExtensionData("x-ui-multiline", "true")]
    public string Description { get; set;}
}
Clone this wiki locally