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

DefaultSchemaNameGenerator

The default schema name generator implementation.
using NJsonSchema.Annotations; using NJsonSchema.Infrastructure; using System; using System.Reflection; namespace NJsonSchema { public class DefaultSchemaNameGenerator : ISchemaNameGenerator { public virtual string Generate(Type type) { JsonSchemaAttribute customAttribute = type.GetTypeInfo().GetCustomAttribute<JsonSchemaAttribute>(); if (!string.IsNullOrEmpty(customAttribute?.Name)) return customAttribute.Name; return ReflectionExtensions.GetSafeTypeName(type); } } }