private static bool IsOpenApiSpecJson(OpenApiSpecFormat openApiSpecFormat) { switch (openApiSpecFormat) { case OpenApiSpecFormat.Swagger_Json: case OpenApiSpecFormat.OpenApi20_Json: case OpenApiSpecFormat.OpenApi30_Json: return(true); case OpenApiSpecFormat.OpenApi20_Yaml: case OpenApiSpecFormat.OpenApi30_Yaml: return(false); default: throw new NotSupportedException(); } }
private static string GetOpenApiSpecFormat(bool isUrl, OpenApiSpecFormat openApiSpecFormat) { switch (openApiSpecFormat) { case OpenApiSpecFormat.Swagger_Json: return(isUrl ? "swagger-link-json" : "swagger-json"); case OpenApiSpecFormat.OpenApi20_Yaml: return(isUrl ? "openapi-link" : "openapi"); case OpenApiSpecFormat.OpenApi20_Json: return(isUrl ? "openapi-link" : "swagger-json"); case OpenApiSpecFormat.OpenApi30_Yaml: return(isUrl ? "openapi-link" : "openapi"); case OpenApiSpecFormat.OpenApi30_Json: return(isUrl ? "openapi-link" : "openapi+json"); default: throw new NotSupportedException(); } }