/
qwiklly
/
arc-server
Обзор
Документация
Войти
/
qwiklly
/
arc-server
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
src/AppRemoteConfig/Helpers/RequireNonNullablePropertiesSchemaFilter.cs
23 строки
838 B
CLTanuki
feat(#3, #7): scope, based on current user
10 янв 2024, 18:20
10 янв 2024, 18:20
0019562
Код
Авторство
О чём код?
// namespace AppRemoteConfig.Helpers // { // using Microsoft.OpenApi.Models; // using Swashbuckle.AspNetCore.SwaggerGen; // // public class RequireNonNullablePropertiesSchemaFilter : ISchemaFilter // { // /// <summary> // /// Add to model.Required all properties where Nullable is false. // /// </summary> // // TODO: Mark all as required // public void Apply(OpenApiSchema model, SchemaFilterContext context) // { // var additionalRequiredProps = model.Properties // .Where(x => !x.Value.Nullable && !model.Required.Contains(x.Key)) // .Select(x => x.Key); // foreach (var propKey in additionalRequiredProps) // { // model.Required.Add(propKey); // } // } // } // }