JsonSchemaAttribute
Annotation to specify the JSON Schema type for the given class.
using System;
namespace NJsonSchema.Annotations
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Property)]
public class JsonSchemaAttribute : Attribute
{
public string Name { get; set; }
public JsonObjectType Type { get; set; }
public string Format { get; set; }
public Type ArrayItem { get; set; }
public JsonSchemaAttribute()
{
Type = JsonObjectType.None;
}
public JsonSchemaAttribute(string name)
: this()
{
Name = name;
}
public JsonSchemaAttribute(JsonObjectType type)
{
Type = type;
}
}
}