public static Serializer Create(SwaggerYamlOptions swaggerYamlOptions)
        {
            var builder = new SerializerBuilder();

            switch (swaggerYamlOptions.NamingConvention)
            {
            case NamingConvention.CamelCase:
                builder.WithNamingConvention(new CamelCaseNamingConvention());
                break;

            case NamingConvention.Hyphenated:
                builder.WithNamingConvention(new HyphenatedNamingConvention());
                break;

            case NamingConvention.PascalCase:
                builder.WithNamingConvention(new PascalCaseNamingConvention());
                break;

            case NamingConvention.Underscored:
                builder.WithNamingConvention(new UnderscoredNamingConvention());
                break;
            }

            builder.WithTypeInspector(innerInspector => new PropertiesIgnoreTypeInspector(innerInspector, swaggerYamlOptions.IgnoredProperties));
            builder.WithTypeInspector(innerInspector => new JsonPropertyNameApplyingTypeInspector(innerInspector));
            builder.WithTypeInspector(innerInspector => new StringQuotingTypeInspector(innerInspector));

            return(builder.Build());
        }
        public static ISerializer Create(SwaggerYamlOptions swaggerYamlOptions)
        {
            var builder = new SerializerBuilder();

            builder.WithNamingConvention(new HyphenatedNamingConvention());
            builder.WithTypeInspector(innerInspector => new PropertiesIgnoreTypeInspector(innerInspector, swaggerYamlOptions.IgnoredProperties));
            builder.WithTypeInspector(innerInspector => new JsonPropertyNameApplyingTypeInspector(innerInspector));
            builder.WithTypeInspector(innerInspector => new StringQuotingTypeInspector(innerInspector));
            return(builder.Build());
        }
 public SwaggerYamlMiddleware(
     RequestDelegate next,
     ISwaggerProvider swaggerProvider,
     SwaggerYamlOptions options)
 {
     _next              = next;
     _swaggerProvider   = swaggerProvider;
     _swaggerSerializer = SwaggerYamlSerializerFactory.Create(options);
     _options           = options;
     _requestMatcher    = new TemplateMatcher(TemplateParser.Parse(_options.SwaggerOptions.RouteTemplate), new RouteValueDictionary());
 }