<PackageReference Include="NJsonSchema" Version="5.19.6171.28316" />

JsonSchemaGenerator

public class JsonSchemaGenerator
Generates a JsonSchema4 object for a given type.

Gets the settings.

Initializes a new instance of the JsonSchemaGenerator class.

public void ApplyPropertyAnnotations(JsonSchema4 jsonProperty, Type parentType, IList<Attribute> attributes, JsonObjectTypeDescription propertyTypeDescription)

Applies the property annotations to the JSON property.

public JsonSchema4 Generate(Type type)

Generates a JsonSchema4 object for the given type and adds the mapping to the given resolver.

public JsonSchema4 Generate(Type type, ISchemaResolver schemaResolver, ISchemaDefinitionAppender schemaDefinitionAppender)

Generates a JsonSchema4 object for the given type and adds the mapping to the given resolver.

public virtual TSchemaType Generate<TSchemaType>(Type type, IEnumerable<Attribute> parentAttributes, ISchemaResolver schemaResolver, ISchemaDefinitionAppender schemaDefinitionAppender) where TSchemaType : JsonSchema4

Generates a JsonSchema4 object for the given type and adds the mapping to the given resolver.

protected virtual void GenerateObject<TSchemaType>(Type type, TSchemaType schema, ISchemaResolver schemaResolver, ISchemaDefinitionAppender schemaDefinitionAppender) where TSchemaType : JsonSchema4

Generates the properties for the given type and schema.

protected virtual string[] GetTypeProperties(Type type)

Gets the properties of the given type or null to take all properties.