Beispiel #1
0
        public void Apply(Swashbuckle.AspNetCore.Swagger.Schema schema, SchemaFilterContext context)
        {
            var excludedProperties = context.SystemType.GetProperties().Where(t => t.GetCustomAttribute <SwaggerExcludeAttribute>() != null);

            foreach (var excludedProperty in excludedProperties)
            {
                if (schema.Properties.ContainsKey(excludedProperty.Name))
                {
                    schema.Properties.Remove(excludedProperty.Name);
                }
            }
        }
Beispiel #2
0
 public void Apply(Swashbuckle.AspNetCore.Swagger.Schema model, SchemaFilterContext context)
 {
     model.Enum = model.Enum?.Select(p => p.ToString().ToSnakeCase()).ToArray();
 }