public static ILocatedOpenApiElement <OpenApiUnknownResponse> GetUnknownResponse(
            this ILocatedOpenApiElement <OpenApiResponses> responses)
        {
            if (responses == null)
            {
                throw new ArgumentNullException(nameof(responses));
            }

            return(responses.CreateChild(_unknownResponses.GetOrCreateValue(responses.Element),
                                         OpenApiUnknownResponse.Key));
        }
 public static IEnumerable <ILocatedOpenApiElement <OpenApiOperation> > GetOperations(
     this ILocatedOpenApiElement <OpenApiPathItem> path) =>
 path.Element.Operations
 .Select(operation => path.CreateChild(operation.Value, operation.Key.ToString()));
 GetSecuritySchemes(this ILocatedOpenApiElement <OpenApiSecurityRequirement> requirement) =>
 requirement.Element
 .Select((p, index) =>
         new KeyValuePair <ILocatedOpenApiElement <OpenApiSecurityScheme>, IList <string> >(
             requirement.CreateChild(p.Key, index.ToString()), p.Value));
 public static IEnumerable <ILocatedOpenApiElement <OpenApiSecurityRequirement> > GetSecurityRequirements(
     this ILocatedOpenApiElement <OpenApiOperation> operation) =>
 operation.Element.Security
 .Select((requirement, index) => operation.CreateChild(requirement, index.ToString()));
 public static ILocatedOpenApiElement <OpenApiSchema> GetSchemaOrDefault(
     this ILocatedOpenApiElement <OpenApiParameter> parameter) =>
 parameter.GetSchema() ?? parameter.CreateChild(_defaultSchema, "schema");
 public static ILocatedOpenApiElement <OpenApiSchema>?GetSchema(
     this ILocatedOpenApiElement <OpenApiParameter> parameter) =>
 parameter.Element.Schema != null
         ? parameter.CreateChild(parameter.Element.Schema, "schema")
         : null;
 public static ILocatedOpenApiElement <OpenApiSchema>?GetSchema(
     this ILocatedOpenApiElement <OpenApiMediaType> mediaType) =>
 mediaType.Element.Schema != null
         ? mediaType.CreateChild(mediaType.Element.Schema, "schema")
         : null;
 public static IEnumerable <ILocatedOpenApiElement <OpenApiResponse> > GetResponses(
     this ILocatedOpenApiElement <OpenApiResponses> responseSet) =>
 responseSet.Element
 .Select(p => responseSet.CreateChild(p.Value, p.Key));
 public static ILocatedOpenApiElement <OpenApiSchema>?GetSchema(
     this ILocatedOpenApiElement <OpenApiHeader> header) =>
 header.Element.Schema != null
         ? header.CreateChild(header.Element.Schema, "schema")
         : null;
 public static IEnumerable <ILocatedOpenApiElement <OpenApiSchema> > GetProperties(
     this ILocatedOpenApiElement <OpenApiSchema> schema) =>
 schema.Element.Properties?
 .Select(p => schema.CreateChild(p.Value, p.Key))
 ?? Enumerable.Empty <ILocatedOpenApiElement <OpenApiSchema> >();
 public static IEnumerable <ILocatedOpenApiElement <OpenApiMediaType> > GetMediaTypes(
     this ILocatedOpenApiElement <OpenApiResponse> response) =>
 response.Element.Content?
 .Select(p => response.CreateChild(p.Value, p.Key))
 ?? Enumerable.Empty <ILocatedOpenApiElement <OpenApiMediaType> >();
 public static IEnumerable <ILocatedOpenApiElement <OpenApiHeader> > GetHeaders(
     this ILocatedOpenApiElement <OpenApiResponse> response) =>
 response.Element.Headers
 .Select(p => response.CreateChild(p.Value, p.Key));
 public static IEnumerable <ILocatedOpenApiElement <OpenApiTag> > GetTags(
     this ILocatedOpenApiElement <OpenApiOperation> operation) =>
 operation.Element.Tags
 .Select((tag, index) => operation.CreateChild(tag, index.ToString()));
 public static IEnumerable <ILocatedOpenApiElement <OpenApiParameter> > GetParameters(
     this ILocatedOpenApiElement <OpenApiOperation> operation) =>
 operation.Element.Parameters
 .Select(p => operation.CreateChild(p, p.Name));
 public static ILocatedOpenApiElement <OpenApiSchema> GetSchemaOrDefault(
     this ILocatedOpenApiElement <OpenApiHeader> header) =>
 header.GetSchema() ?? header.CreateChild(_defaultSchema, "schema");
 public static ILocatedOpenApiElement <OpenApiRequestBody>?GetRequestBody(
     this ILocatedOpenApiElement <OpenApiOperation> operation) =>
 operation.Element.RequestBody != null
         ? operation.CreateChild(operation.Element.RequestBody, "requestBody")
         : null;
 public static ILocatedOpenApiElement <OpenApiResponses> GetResponseSet(
     this ILocatedOpenApiElement <OpenApiOperation> operation) =>
 operation.CreateChild(operation.Element.Responses, "responses");