|
|
@ -67,7 +67,6 @@ public static class JsonSchemaExtensions |
|
|
|
{ |
|
|
|
schema.Add("type", "array"); |
|
|
|
schema.TryAdd("multiple", true); |
|
|
|
schema.TryAdd("url", "url"); |
|
|
|
schema.Add("items", meta.ElementMetadata.GetSchema(serviceProvider, meta)); |
|
|
|
} |
|
|
|
} |
|
|
@ -132,6 +131,10 @@ public static class JsonSchemaExtensions |
|
|
|
schema.AddNotNull("description", meta.Description); |
|
|
|
schema.AddNotNull("format", meta.DataTypeName?.ToLowerCamelCase()); |
|
|
|
schema.AddNotNull("input", meta.TemplateHint?.ToLowerCamelCase()); |
|
|
|
if(meta.TemplateHint=="select"&&meta.IsEnumerableType&& modelType.IsGenericType) |
|
|
|
{ |
|
|
|
schema.TryAdd("url", modelType.GetGenericArguments().First().Name.ToSlugify()); |
|
|
|
} |
|
|
|
|
|
|
|
if (meta is DefaultModelMetadata defaultModelMetadata) |
|
|
|
{ |
|
|
@ -144,9 +147,11 @@ public static class JsonSchemaExtensions |
|
|
|
} |
|
|
|
if (defaultModelMetadata.Attributes.Attributes.FirstOrDefault(o => o.GetType() == typeof(NavigationAttribute)) is NavigationAttribute navigationAttribute) |
|
|
|
{ |
|
|
|
var path = navigationAttribute.Path ?? $"{propertyName[..^2]}.Name"; |
|
|
|
var path = navigationAttribute.Property ?? $"{propertyName[..^2]}.Name"; |
|
|
|
path = string.Join('.', path.Split('.').Select(o => o.ToLowerCamelCase())); |
|
|
|
schema.Add("navigation", path); |
|
|
|
schema.Add("input", "select"); |
|
|
|
schema.Add("url", propertyName[..^2].ToSlugify()); |
|
|
|
} |
|
|
|
if (defaultModelMetadata.Attributes.Attributes.FirstOrDefault(o => o.GetType() == typeof(ScaffoldColumnAttribute)) is ScaffoldColumnAttribute scaffoldColumnAttribute |
|
|
|
&& !scaffoldColumnAttribute.Scaffold) |
|
|
|