Exemple #1
0
        public void Apply(Operation operation, OperationFilterContext context)
        {
            foreach (var response in operation.Responses)
            {
                var description = response.Value.Description;
                var crefTypes   = SwaggerHelper.GetCrefTypes(description);
                if (!crefTypes.Any())
                {
                    continue;
                }
                var types = TypeFinder.GetByNames(crefTypes);
                foreach (var type in types)
                {
                    context.SchemaRegistry.GetOrRegister(type);
                }
            }

            operation.Produces.Add("application/json");
        }