diff --git a/src/Microsoft.OpenApi/Reader/ParseNodes/ListNode.cs b/src/Microsoft.OpenApi/Reader/ParseNodes/ListNode.cs index f07d93745..96235271e 100644 --- a/src/Microsoft.OpenApi/Reader/ParseNodes/ListNode.cs +++ b/src/Microsoft.OpenApi/Reader/ParseNodes/ListNode.cs @@ -21,7 +21,7 @@ public ListNode(ParsingContext context, JsonArray jsonArray) : base( _nodeList = jsonArray; } - public override List CreateList(Func map, OpenApiDocument hostDocument = null) + public override List CreateList(Func map, OpenApiDocument hostDocument) { if (_nodeList == null) { diff --git a/src/Microsoft.OpenApi/Reader/ParseNodes/MapNode.cs b/src/Microsoft.OpenApi/Reader/ParseNodes/MapNode.cs index 919f1d85c..ddaef6b6a 100644 --- a/src/Microsoft.OpenApi/Reader/ParseNodes/MapNode.cs +++ b/src/Microsoft.OpenApi/Reader/ParseNodes/MapNode.cs @@ -48,7 +48,7 @@ public PropertyNode this[string key] } } - public override Dictionary CreateMap(Func map, OpenApiDocument hostDocument = null) + public override Dictionary CreateMap(Func map, OpenApiDocument hostDocument) { var jsonMap = _node ?? throw new OpenApiReaderException($"Expected map while parsing {typeof(T).Name}", Context); var nodes = jsonMap.Select( diff --git a/src/Microsoft.OpenApi/Reader/ParseNodes/ParseNode.cs b/src/Microsoft.OpenApi/Reader/ParseNodes/ParseNode.cs index 4b2523901..9fbf3f47a 100644 --- a/src/Microsoft.OpenApi/Reader/ParseNodes/ParseNode.cs +++ b/src/Microsoft.OpenApi/Reader/ParseNodes/ParseNode.cs @@ -46,12 +46,12 @@ public static ParseNode Create(ParsingContext context, JsonNode node) return new ValueNode(context, node as JsonValue); } - public virtual List CreateList(Func map, OpenApiDocument hostDocument = null) + public virtual List CreateList(Func map, OpenApiDocument hostDocument) { throw new OpenApiReaderException("Cannot create list from this type of node.", Context); } - public virtual Dictionary CreateMap(Func map, OpenApiDocument hostDocument = null) + public virtual Dictionary CreateMap(Func map, OpenApiDocument hostDocument) { throw new OpenApiReaderException("Cannot create map from this type of node.", Context); } diff --git a/src/Microsoft.OpenApi/Reader/ParseNodes/PropertyNode.cs b/src/Microsoft.OpenApi/Reader/ParseNodes/PropertyNode.cs index 5f8031e87..b285df130 100644 --- a/src/Microsoft.OpenApi/Reader/ParseNodes/PropertyNode.cs +++ b/src/Microsoft.OpenApi/Reader/ParseNodes/PropertyNode.cs @@ -28,7 +28,7 @@ public void ParseField( T parentInstance, IDictionary> fixedFields, IDictionary, Action> patternFields, - OpenApiDocument hostDocument = null) + OpenApiDocument hostDocument) { if (fixedFields.TryGetValue(Name, out var fixedFieldMap)) { diff --git a/src/Microsoft.OpenApi/Reader/V2/OpenApiContactDeserializer.cs b/src/Microsoft.OpenApi/Reader/V2/OpenApiContactDeserializer.cs index 2cb8dea9c..d225899cc 100644 --- a/src/Microsoft.OpenApi/Reader/V2/OpenApiContactDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V2/OpenApiContactDeserializer.cs @@ -35,7 +35,7 @@ internal static partial class OpenApiV2Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p, n))} }; - public static OpenApiContact LoadContact(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiContact LoadContact(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node as MapNode; var contact = new OpenApiContact(); diff --git a/src/Microsoft.OpenApi/Reader/V2/OpenApiDocumentDeserializer.cs b/src/Microsoft.OpenApi/Reader/V2/OpenApiDocumentDeserializer.cs index 95d26845d..37e146793 100644 --- a/src/Microsoft.OpenApi/Reader/V2/OpenApiDocumentDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V2/OpenApiDocumentDeserializer.cs @@ -64,12 +64,9 @@ internal static partial class OpenApiV2Deserializer }, { "parameters", - (o, n, _) => + (o, n, doc) => { - if (o.Components == null) - { - o.Components = new(); - } + o.Components ??= new(); o.Components.Parameters = n.CreateMap(LoadParameter, o); @@ -77,7 +74,8 @@ internal static partial class OpenApiV2Deserializer { var parameter = LoadParameter(node: p, loadRequestBody: true, hostDocument: d); return parameter != null ? CreateRequestBody(p.Context, parameter) : null; - } + }, + doc ); } }, diff --git a/src/Microsoft.OpenApi/Reader/V2/OpenApiExternalDocsDeserializer.cs b/src/Microsoft.OpenApi/Reader/V2/OpenApiExternalDocsDeserializer.cs index 8e90fb4e7..6fc438542 100644 --- a/src/Microsoft.OpenApi/Reader/V2/OpenApiExternalDocsDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V2/OpenApiExternalDocsDeserializer.cs @@ -33,7 +33,7 @@ internal static partial class OpenApiV2Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p, n))} }; - public static OpenApiExternalDocs LoadExternalDocs(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiExternalDocs LoadExternalDocs(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("externalDocs"); diff --git a/src/Microsoft.OpenApi/Reader/V2/OpenApiHeaderDeserializer.cs b/src/Microsoft.OpenApi/Reader/V2/OpenApiHeaderDeserializer.cs index b4ddf7300..4a994bdc5 100644 --- a/src/Microsoft.OpenApi/Reader/V2/OpenApiHeaderDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V2/OpenApiHeaderDeserializer.cs @@ -32,7 +32,7 @@ internal static partial class OpenApiV2Deserializer }, { "items", - (o, n, _) => GetOrCreateSchema(o).Items = LoadSchema(n) + (o, n, doc) => GetOrCreateSchema(o).Items = LoadSchema(n, doc) }, { "collectionFormat", @@ -102,14 +102,14 @@ private static OpenApiSchema GetOrCreateSchema(OpenApiHeader p) return p.Schema ??= new(); } - public static OpenApiHeader LoadHeader(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiHeader LoadHeader(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("header"); var header = new OpenApiHeader(); foreach (var property in mapNode) { - property.ParseField(header, _headerFixedFields, _headerPatternFields); + property.ParseField(header, _headerFixedFields, _headerPatternFields, hostDocument); } var schema = node.Context.GetFromTempStorage("schema"); diff --git a/src/Microsoft.OpenApi/Reader/V2/OpenApiInfoDeserializer.cs b/src/Microsoft.OpenApi/Reader/V2/OpenApiInfoDeserializer.cs index 90a8535b1..74c3ac917 100644 --- a/src/Microsoft.OpenApi/Reader/V2/OpenApiInfoDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V2/OpenApiInfoDeserializer.cs @@ -47,7 +47,7 @@ internal static partial class OpenApiV2Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p, n))} }; - public static OpenApiInfo LoadInfo(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiInfo LoadInfo(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("Info"); diff --git a/src/Microsoft.OpenApi/Reader/V2/OpenApiLicenseDeserializer.cs b/src/Microsoft.OpenApi/Reader/V2/OpenApiLicenseDeserializer.cs index f1f7a7b93..8eae690ed 100644 --- a/src/Microsoft.OpenApi/Reader/V2/OpenApiLicenseDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V2/OpenApiLicenseDeserializer.cs @@ -31,7 +31,7 @@ internal static partial class OpenApiV2Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p, n))} }; - public static OpenApiLicense LoadLicense(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiLicense LoadLicense(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("OpenApiLicense"); diff --git a/src/Microsoft.OpenApi/Reader/V2/OpenApiOperationDeserializer.cs b/src/Microsoft.OpenApi/Reader/V2/OpenApiOperationDeserializer.cs index d1f894407..35d20ca4a 100644 --- a/src/Microsoft.OpenApi/Reader/V2/OpenApiOperationDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V2/OpenApiOperationDeserializer.cs @@ -91,7 +91,7 @@ internal static partial class OpenApiV2Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p, n))} }; - internal static OpenApiOperation LoadOperation(ParseNode node, OpenApiDocument hostDocument = null) + internal static OpenApiOperation LoadOperation(ParseNode node, OpenApiDocument hostDocument) { // Reset these temp storage parameters for each operation. node.Context.SetTempStorage(TempStorageKeys.BodyParameter, null); @@ -131,7 +131,7 @@ internal static OpenApiOperation LoadOperation(ParseNode node, OpenApiDocument h return operation; } - public static OpenApiResponses LoadResponses(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiResponses LoadResponses(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("Responses"); @@ -205,7 +205,7 @@ internal static OpenApiRequestBody CreateRequestBody( } private static OpenApiTagReference LoadTagByReference( - string tagName, OpenApiDocument hostDocument = null) + string tagName, OpenApiDocument hostDocument) { return new OpenApiTagReference(tagName, hostDocument); } diff --git a/src/Microsoft.OpenApi/Reader/V2/OpenApiParameterDeserializer.cs b/src/Microsoft.OpenApi/Reader/V2/OpenApiParameterDeserializer.cs index 99f65fdb2..6a5411070 100644 --- a/src/Microsoft.OpenApi/Reader/V2/OpenApiParameterDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V2/OpenApiParameterDeserializer.cs @@ -50,7 +50,7 @@ internal static partial class OpenApiV2Deserializer }, { "items", - (o, n, t) => GetOrCreateSchema(o).Items = LoadSchema(n) + (o, n, t) => GetOrCreateSchema(o).Items = LoadSchema(n, t) }, { "collectionFormat", @@ -138,7 +138,7 @@ private static void LoadStyle(OpenApiParameter p, string v) } } - private static void LoadParameterExamplesExtension(OpenApiParameter parameter, ParseNode node, OpenApiDocument hostDocument = null) + private static void LoadParameterExamplesExtension(OpenApiParameter parameter, ParseNode node, OpenApiDocument hostDocument) { var examples = LoadExamplesExtension(node); node.Context.SetTempStorage(TempStorageKeys.Examples, examples, parameter); @@ -149,7 +149,7 @@ private static OpenApiSchema GetOrCreateSchema(OpenApiParameter p) return p.Schema ??= new(); } - private static void ProcessIn(OpenApiParameter o, ParseNode n, OpenApiDocument hostDocument = null) + private static void ProcessIn(OpenApiParameter o, ParseNode n, OpenApiDocument hostDocument) { var value = n.GetScalarValue(); switch (value) @@ -183,12 +183,12 @@ private static void ProcessIn(OpenApiParameter o, ParseNode n, OpenApiDocument h } } - public static OpenApiParameter LoadParameter(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiParameter LoadParameter(ParseNode node, OpenApiDocument hostDocument) { return LoadParameter(node, false, hostDocument); } - public static OpenApiParameter LoadParameter(ParseNode node, bool loadRequestBody, OpenApiDocument hostDocument = null) + public static OpenApiParameter LoadParameter(ParseNode node, bool loadRequestBody, OpenApiDocument hostDocument) { // Reset the local variables every time this method is called. node.Context.SetTempStorage(TempStorageKeys.ParameterIsBodyOrFormData, false); diff --git a/src/Microsoft.OpenApi/Reader/V2/OpenApiPathItemDeserializer.cs b/src/Microsoft.OpenApi/Reader/V2/OpenApiPathItemDeserializer.cs index 71fd2e736..bc1eb8da6 100644 --- a/src/Microsoft.OpenApi/Reader/V2/OpenApiPathItemDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V2/OpenApiPathItemDeserializer.cs @@ -43,7 +43,7 @@ internal static partial class OpenApiV2Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p, n))}, }; - public static OpenApiPathItem LoadPathItem(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiPathItem LoadPathItem(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("PathItem"); @@ -54,12 +54,12 @@ public static OpenApiPathItem LoadPathItem(ParseNode node, OpenApiDocument hostD return pathItem; } - private static void LoadPathParameters(OpenApiPathItem pathItem, ParseNode node, OpenApiDocument hostDocument = null) + private static void LoadPathParameters(OpenApiPathItem pathItem, ParseNode node, OpenApiDocument hostDocument) { node.Context.SetTempStorage(TempStorageKeys.BodyParameter, null); node.Context.SetTempStorage(TempStorageKeys.FormParameters, null); - pathItem.Parameters = node.CreateList(LoadParameter); + pathItem.Parameters = node.CreateList(LoadParameter, hostDocument); // Build request body based on information determined while parsing OpenApiOperation var bodyParameter = node.Context.GetFromTempStorage(TempStorageKeys.BodyParameter); diff --git a/src/Microsoft.OpenApi/Reader/V2/OpenApiPathsDeserializer.cs b/src/Microsoft.OpenApi/Reader/V2/OpenApiPathsDeserializer.cs index 9e0c0f08b..a048316d5 100644 --- a/src/Microsoft.OpenApi/Reader/V2/OpenApiPathsDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V2/OpenApiPathsDeserializer.cs @@ -21,7 +21,7 @@ internal static partial class OpenApiV2Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p, n))} }; - public static OpenApiPaths LoadPaths(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiPaths LoadPaths(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("Paths"); diff --git a/src/Microsoft.OpenApi/Reader/V2/OpenApiResponseDeserializer.cs b/src/Microsoft.OpenApi/Reader/V2/OpenApiResponseDeserializer.cs index 8436a09cd..11b12e8f8 100644 --- a/src/Microsoft.OpenApi/Reader/V2/OpenApiResponseDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V2/OpenApiResponseDeserializer.cs @@ -104,7 +104,7 @@ private static void ProcessProduces(MapNode mapNode, OpenApiResponse response, P context.SetTempStorage(TempStorageKeys.ResponseProducesSet, true, response); } - private static void LoadResponseExamplesExtension(OpenApiResponse response, ParseNode node, OpenApiDocument hostDocument = null) + private static void LoadResponseExamplesExtension(OpenApiResponse response, ParseNode node, OpenApiDocument hostDocument) { var examples = LoadExamplesExtension(node); node.Context.SetTempStorage(TempStorageKeys.Examples, examples, response); @@ -145,7 +145,7 @@ private static Dictionary LoadExamplesExtension(ParseNod return examples; } - private static void LoadExamples(OpenApiResponse response, ParseNode node, OpenApiDocument hostDocument = null) + private static void LoadExamples(OpenApiResponse response, ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("examples"); @@ -178,7 +178,7 @@ private static void LoadExample(OpenApiResponse response, string mediaType, Pars mediaTypeObject.Example = exampleNode; } - public static OpenApiResponse LoadResponse(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiResponse LoadResponse(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("response"); @@ -193,7 +193,7 @@ public static OpenApiResponse LoadResponse(ParseNode node, OpenApiDocument hostD foreach (var property in mapNode) { - property.ParseField(response, _responseFixedFields, _responsePatternFields); + property.ParseField(response, _responseFixedFields, _responsePatternFields, hostDocument); } foreach (var mediaType in response.Content.Values) diff --git a/src/Microsoft.OpenApi/Reader/V2/OpenApiSchemaDeserializer.cs b/src/Microsoft.OpenApi/Reader/V2/OpenApiSchemaDeserializer.cs index 7c5ab3d2d..78453f9d2 100644 --- a/src/Microsoft.OpenApi/Reader/V2/OpenApiSchemaDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V2/OpenApiSchemaDeserializer.cs @@ -93,14 +93,14 @@ internal static partial class OpenApiV2Deserializer }, { "items", - (o, n, _) => o.Items = LoadSchema(n) + (o, n, doc) => o.Items = LoadSchema(n, doc) }, { "properties", (o, n, t) => o.Properties = n.CreateMap(LoadSchema, t) }, { - "additionalProperties", (o, n, _) => + "additionalProperties", (o, n, doc) => { if (n is ValueNode) { @@ -108,7 +108,7 @@ internal static partial class OpenApiV2Deserializer } else { - o.AdditionalProperties = LoadSchema(n); + o.AdditionalProperties = LoadSchema(n, doc); } } }, @@ -139,11 +139,11 @@ internal static partial class OpenApiV2Deserializer }, { "xml", - (o, n, _) => o.Xml = LoadXml(n) + (o, n, doc) => o.Xml = LoadXml(n, doc) }, { "externalDocs", - (o, n, _) => o.ExternalDocs = LoadExternalDocs(n) + (o, n, doc) => o.ExternalDocs = LoadExternalDocs(n, doc) }, { "example", @@ -156,7 +156,7 @@ internal static partial class OpenApiV2Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p, n))} }; - public static OpenApiSchema LoadSchema(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiSchema LoadSchema(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("schema"); @@ -171,7 +171,7 @@ public static OpenApiSchema LoadSchema(ParseNode node, OpenApiDocument hostDocum foreach (var propertyNode in mapNode) { - propertyNode.ParseField(schema, _openApiSchemaFixedFields, _openApiSchemaPatternFields); + propertyNode.ParseField(schema, _openApiSchemaFixedFields, _openApiSchemaPatternFields, hostDocument); } return schema; diff --git a/src/Microsoft.OpenApi/Reader/V2/OpenApiSecuritySchemeDeserializer.cs b/src/Microsoft.OpenApi/Reader/V2/OpenApiSecuritySchemeDeserializer.cs index 91d783bce..43151c15a 100644 --- a/src/Microsoft.OpenApi/Reader/V2/OpenApiSecuritySchemeDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V2/OpenApiSecuritySchemeDeserializer.cs @@ -80,7 +80,7 @@ internal static partial class OpenApiV2Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p, n))} }; - public static OpenApiSecurityScheme LoadSecurityScheme(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiSecurityScheme LoadSecurityScheme(ParseNode node, OpenApiDocument hostDocument) { // Reset the local variables every time this method is called. // TODO: Change _flow to a tempStorage variable to make the deserializer thread-safe. @@ -92,7 +92,7 @@ public static OpenApiSecurityScheme LoadSecurityScheme(ParseNode node, OpenApiDo var securityScheme = new OpenApiSecurityScheme(); foreach (var property in mapNode) { - property.ParseField(securityScheme, _securitySchemeFixedFields, _securitySchemePatternFields); + property.ParseField(securityScheme, _securitySchemeFixedFields, _securitySchemePatternFields, hostDocument); } // Put the Flow object in the right Flows property based on the string in "flow" diff --git a/src/Microsoft.OpenApi/Reader/V2/OpenApiTagDeserializer.cs b/src/Microsoft.OpenApi/Reader/V2/OpenApiTagDeserializer.cs index 47c3c6a40..23614029a 100644 --- a/src/Microsoft.OpenApi/Reader/V2/OpenApiTagDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V2/OpenApiTagDeserializer.cs @@ -34,7 +34,7 @@ internal static partial class OpenApiV2Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p, n))} }; - public static OpenApiTag LoadTag(ParseNode n, OpenApiDocument hostDocument = null) + public static OpenApiTag LoadTag(ParseNode n, OpenApiDocument hostDocument) { var mapNode = n.CheckMapNode("tag"); @@ -42,7 +42,7 @@ public static OpenApiTag LoadTag(ParseNode n, OpenApiDocument hostDocument = nul foreach (var propertyNode in mapNode) { - propertyNode.ParseField(domainObject, _tagFixedFields, _tagPatternFields); + propertyNode.ParseField(domainObject, _tagFixedFields, _tagPatternFields, hostDocument); } return domainObject; diff --git a/src/Microsoft.OpenApi/Reader/V2/OpenApiV2Deserializer.cs b/src/Microsoft.OpenApi/Reader/V2/OpenApiV2Deserializer.cs index 0bafab857..0e90a4633 100644 --- a/src/Microsoft.OpenApi/Reader/V2/OpenApiV2Deserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V2/OpenApiV2Deserializer.cs @@ -72,7 +72,7 @@ private static void ProcessAnyFields( } } - public static JsonNode LoadAny(ParseNode node, OpenApiDocument hostDocument = null) + public static JsonNode LoadAny(ParseNode node, OpenApiDocument hostDocument) { return node.CreateAny(); } diff --git a/src/Microsoft.OpenApi/Reader/V2/OpenApiXmlDeserializer.cs b/src/Microsoft.OpenApi/Reader/V2/OpenApiXmlDeserializer.cs index c630bd941..21c9be0fe 100644 --- a/src/Microsoft.OpenApi/Reader/V2/OpenApiXmlDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V2/OpenApiXmlDeserializer.cs @@ -54,14 +54,14 @@ internal static partial class OpenApiV2Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - public static OpenApiXml LoadXml(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiXml LoadXml(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("xml"); var xml = new OpenApiXml(); foreach (var property in mapNode) { - property.ParseField(xml, _xmlFixedFields, _xmlPatternFields); + property.ParseField(xml, _xmlFixedFields, _xmlPatternFields, hostDocument); } return xml; diff --git a/src/Microsoft.OpenApi/Reader/V3/OpenApiCallbackDeserializer.cs b/src/Microsoft.OpenApi/Reader/V3/OpenApiCallbackDeserializer.cs index faf50ebb1..ca4a353a5 100644 --- a/src/Microsoft.OpenApi/Reader/V3/OpenApiCallbackDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V3/OpenApiCallbackDeserializer.cs @@ -25,7 +25,7 @@ internal static partial class OpenApiV3Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))}, }; - public static OpenApiCallback LoadCallback(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiCallback LoadCallback(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("callback"); diff --git a/src/Microsoft.OpenApi/Reader/V3/OpenApiComponentsDeserializer.cs b/src/Microsoft.OpenApi/Reader/V3/OpenApiComponentsDeserializer.cs index cc51187d2..a5e3d082b 100644 --- a/src/Microsoft.OpenApi/Reader/V3/OpenApiComponentsDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V3/OpenApiComponentsDeserializer.cs @@ -32,7 +32,7 @@ internal static partial class OpenApiV3Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p, n))} }; - public static OpenApiComponents LoadComponents(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiComponents LoadComponents(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("components"); var components = new OpenApiComponents(); diff --git a/src/Microsoft.OpenApi/Reader/V3/OpenApiContactDeserializer.cs b/src/Microsoft.OpenApi/Reader/V3/OpenApiContactDeserializer.cs index e4d98de64..cc5058b52 100644 --- a/src/Microsoft.OpenApi/Reader/V3/OpenApiContactDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V3/OpenApiContactDeserializer.cs @@ -35,7 +35,7 @@ internal static partial class OpenApiV3Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - public static OpenApiContact LoadContact(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiContact LoadContact(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node as MapNode; var contact = new OpenApiContact(); diff --git a/src/Microsoft.OpenApi/Reader/V3/OpenApiDiscriminatorDeserializer.cs b/src/Microsoft.OpenApi/Reader/V3/OpenApiDiscriminatorDeserializer.cs index c10532c2c..5f9db648e 100644 --- a/src/Microsoft.OpenApi/Reader/V3/OpenApiDiscriminatorDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V3/OpenApiDiscriminatorDeserializer.cs @@ -27,14 +27,14 @@ internal static partial class OpenApiV3Deserializer private static readonly PatternFieldMap _discriminatorPatternFields = new(); - public static OpenApiDiscriminator LoadDiscriminator(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiDiscriminator LoadDiscriminator(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("discriminator"); var discriminator = new OpenApiDiscriminator(); foreach (var property in mapNode) { - property.ParseField(discriminator, _discriminatorFixedFields, _discriminatorPatternFields); + property.ParseField(discriminator, _discriminatorFixedFields, _discriminatorPatternFields, hostDocument); } return discriminator; diff --git a/src/Microsoft.OpenApi/Reader/V3/OpenApiEncodingDeserializer.cs b/src/Microsoft.OpenApi/Reader/V3/OpenApiEncodingDeserializer.cs index 6bd486e7a..2345436dd 100644 --- a/src/Microsoft.OpenApi/Reader/V3/OpenApiEncodingDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V3/OpenApiEncodingDeserializer.cs @@ -50,14 +50,14 @@ internal static partial class OpenApiV3Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - public static OpenApiEncoding LoadEncoding(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiEncoding LoadEncoding(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("encoding"); var encoding = new OpenApiEncoding(); foreach (var property in mapNode) { - property.ParseField(encoding, _encodingFixedFields, _encodingPatternFields); + property.ParseField(encoding, _encodingFixedFields, _encodingPatternFields, hostDocument); } return encoding; diff --git a/src/Microsoft.OpenApi/Reader/V3/OpenApiExampleDeserializer.cs b/src/Microsoft.OpenApi/Reader/V3/OpenApiExampleDeserializer.cs index a73ee02b1..f6f6b6a6c 100644 --- a/src/Microsoft.OpenApi/Reader/V3/OpenApiExampleDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V3/OpenApiExampleDeserializer.cs @@ -41,7 +41,7 @@ internal static partial class OpenApiV3Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - public static OpenApiExample LoadExample(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiExample LoadExample(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("example"); @@ -55,7 +55,7 @@ public static OpenApiExample LoadExample(ParseNode node, OpenApiDocument hostDoc var example = new OpenApiExample(); foreach (var property in mapNode) { - property.ParseField(example, _exampleFixedFields, _examplePatternFields); + property.ParseField(example, _exampleFixedFields, _examplePatternFields, hostDocument); } return example; diff --git a/src/Microsoft.OpenApi/Reader/V3/OpenApiExternalDocsDeserializer.cs b/src/Microsoft.OpenApi/Reader/V3/OpenApiExternalDocsDeserializer.cs index 39712494c..a3f20bad0 100644 --- a/src/Microsoft.OpenApi/Reader/V3/OpenApiExternalDocsDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V3/OpenApiExternalDocsDeserializer.cs @@ -34,7 +34,7 @@ internal static partial class OpenApiV3Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p, n))} }; - public static OpenApiExternalDocs LoadExternalDocs(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiExternalDocs LoadExternalDocs(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("externalDocs"); diff --git a/src/Microsoft.OpenApi/Reader/V3/OpenApiHeaderDeserializer.cs b/src/Microsoft.OpenApi/Reader/V3/OpenApiHeaderDeserializer.cs index 8f6edb55b..377ffaa34 100644 --- a/src/Microsoft.OpenApi/Reader/V3/OpenApiHeaderDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V3/OpenApiHeaderDeserializer.cs @@ -71,7 +71,7 @@ internal static partial class OpenApiV3Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - public static OpenApiHeader LoadHeader(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiHeader LoadHeader(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("header"); @@ -85,7 +85,7 @@ public static OpenApiHeader LoadHeader(ParseNode node, OpenApiDocument hostDocum var header = new OpenApiHeader(); foreach (var property in mapNode) { - property.ParseField(header, _headerFixedFields, _headerPatternFields); + property.ParseField(header, _headerFixedFields, _headerPatternFields, hostDocument); } return header; diff --git a/src/Microsoft.OpenApi/Reader/V3/OpenApiInfoDeserializer.cs b/src/Microsoft.OpenApi/Reader/V3/OpenApiInfoDeserializer.cs index dcbf5ba4b..dbe3a554c 100644 --- a/src/Microsoft.OpenApi/Reader/V3/OpenApiInfoDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V3/OpenApiInfoDeserializer.cs @@ -47,7 +47,7 @@ internal static partial class OpenApiV3Deserializer {s => s.StartsWith("x-"), (o, k, n, _) => o.AddExtension(k,LoadExtension(k, n))} }; - public static OpenApiInfo LoadInfo(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiInfo LoadInfo(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("Info"); var info = new OpenApiInfo(); diff --git a/src/Microsoft.OpenApi/Reader/V3/OpenApiLicenseDeserializer.cs b/src/Microsoft.OpenApi/Reader/V3/OpenApiLicenseDeserializer.cs index e9054a0dd..d836c6e0f 100644 --- a/src/Microsoft.OpenApi/Reader/V3/OpenApiLicenseDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V3/OpenApiLicenseDeserializer.cs @@ -31,7 +31,7 @@ internal static partial class OpenApiV3Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - internal static OpenApiLicense LoadLicense(ParseNode node, OpenApiDocument hostDocument = null) + internal static OpenApiLicense LoadLicense(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("License"); diff --git a/src/Microsoft.OpenApi/Reader/V3/OpenApiLinkDeserializer.cs b/src/Microsoft.OpenApi/Reader/V3/OpenApiLinkDeserializer.cs index a95b6ebf8..f0b62c361 100644 --- a/src/Microsoft.OpenApi/Reader/V3/OpenApiLinkDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V3/OpenApiLinkDeserializer.cs @@ -45,7 +45,7 @@ internal static partial class OpenApiV3Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))}, }; - public static OpenApiLink LoadLink(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiLink LoadLink(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("link"); var link = new OpenApiLink(); diff --git a/src/Microsoft.OpenApi/Reader/V3/OpenApiMediaTypeDeserializer.cs b/src/Microsoft.OpenApi/Reader/V3/OpenApiMediaTypeDeserializer.cs index 1c055293a..69fc53179 100644 --- a/src/Microsoft.OpenApi/Reader/V3/OpenApiMediaTypeDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V3/OpenApiMediaTypeDeserializer.cs @@ -64,7 +64,7 @@ internal static partial class OpenApiV3Deserializer } }; - public static OpenApiMediaType LoadMediaType(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiMediaType LoadMediaType(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode(OpenApiConstants.Content); diff --git a/src/Microsoft.OpenApi/Reader/V3/OpenApiOAuthFlowDeserializer.cs b/src/Microsoft.OpenApi/Reader/V3/OpenApiOAuthFlowDeserializer.cs index 8e8783efa..1a7f40c15 100644 --- a/src/Microsoft.OpenApi/Reader/V3/OpenApiOAuthFlowDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V3/OpenApiOAuthFlowDeserializer.cs @@ -38,14 +38,14 @@ internal static partial class OpenApiV3Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - public static OpenApiOAuthFlow LoadOAuthFlow(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiOAuthFlow LoadOAuthFlow(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("OAuthFlow"); var oauthFlow = new OpenApiOAuthFlow(); foreach (var property in mapNode) { - property.ParseField(oauthFlow, _oAuthFlowFixedFields, _oAuthFlowPatternFields); + property.ParseField(oauthFlow, _oAuthFlowFixedFields, _oAuthFlowPatternFields, hostDocument); } return oauthFlow; diff --git a/src/Microsoft.OpenApi/Reader/V3/OpenApiOAuthFlowsDeserializer.cs b/src/Microsoft.OpenApi/Reader/V3/OpenApiOAuthFlowsDeserializer.cs index 2856be979..e4e003f9c 100644 --- a/src/Microsoft.OpenApi/Reader/V3/OpenApiOAuthFlowsDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V3/OpenApiOAuthFlowsDeserializer.cs @@ -28,14 +28,14 @@ internal static partial class OpenApiV3Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - public static OpenApiOAuthFlows LoadOAuthFlows(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiOAuthFlows LoadOAuthFlows(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("OAuthFlows"); var oAuthFlows = new OpenApiOAuthFlows(); foreach (var property in mapNode) { - property.ParseField(oAuthFlows, _oAuthFlowsFixedFields, _oAuthFlowsPatternFields); + property.ParseField(oAuthFlows, _oAuthFlowsFixedFields, _oAuthFlowsPatternFields, hostDocument); } return oAuthFlows; diff --git a/src/Microsoft.OpenApi/Reader/V3/OpenApiOperationDeserializer.cs b/src/Microsoft.OpenApi/Reader/V3/OpenApiOperationDeserializer.cs index 72ce13d58..1ebb57880 100644 --- a/src/Microsoft.OpenApi/Reader/V3/OpenApiOperationDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V3/OpenApiOperationDeserializer.cs @@ -33,7 +33,7 @@ internal static partial class OpenApiV3Deserializer }, { "externalDocs", - (o, n, _) => o.ExternalDocs = LoadExternalDocs(n) + (o, n, doc) => o.ExternalDocs = LoadExternalDocs(n, doc) }, { "operationId", @@ -75,7 +75,7 @@ internal static partial class OpenApiV3Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))}, }; - internal static OpenApiOperation LoadOperation(ParseNode node, OpenApiDocument hostDocument = null) + internal static OpenApiOperation LoadOperation(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("Operation"); diff --git a/src/Microsoft.OpenApi/Reader/V3/OpenApiParameterDeserializer.cs b/src/Microsoft.OpenApi/Reader/V3/OpenApiParameterDeserializer.cs index 74edfd462..81d5ea2d6 100644 --- a/src/Microsoft.OpenApi/Reader/V3/OpenApiParameterDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V3/OpenApiParameterDeserializer.cs @@ -116,7 +116,7 @@ internal static partial class OpenApiV3Deserializer } }; - public static OpenApiParameter LoadParameter(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiParameter LoadParameter(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("parameter"); diff --git a/src/Microsoft.OpenApi/Reader/V3/OpenApiPathItemDeserializer.cs b/src/Microsoft.OpenApi/Reader/V3/OpenApiPathItemDeserializer.cs index afcee89b5..f0c4051c3 100644 --- a/src/Microsoft.OpenApi/Reader/V3/OpenApiPathItemDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V3/OpenApiPathItemDeserializer.cs @@ -49,7 +49,7 @@ internal static partial class OpenApiV3Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - public static OpenApiPathItem LoadPathItem(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiPathItem LoadPathItem(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("PathItem"); diff --git a/src/Microsoft.OpenApi/Reader/V3/OpenApiPathsDeserializer.cs b/src/Microsoft.OpenApi/Reader/V3/OpenApiPathsDeserializer.cs index d4343973c..e28a9d569 100644 --- a/src/Microsoft.OpenApi/Reader/V3/OpenApiPathsDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V3/OpenApiPathsDeserializer.cs @@ -21,7 +21,7 @@ internal static partial class OpenApiV3Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - public static OpenApiPaths LoadPaths(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiPaths LoadPaths(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("Paths"); diff --git a/src/Microsoft.OpenApi/Reader/V3/OpenApiRequestBodyDeserializer.cs b/src/Microsoft.OpenApi/Reader/V3/OpenApiRequestBodyDeserializer.cs index 435b576e1..f982a18ce 100644 --- a/src/Microsoft.OpenApi/Reader/V3/OpenApiRequestBodyDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V3/OpenApiRequestBodyDeserializer.cs @@ -38,7 +38,7 @@ internal static partial class OpenApiV3Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - public static OpenApiRequestBody LoadRequestBody(ParseNode node, OpenApiDocument hostDocument= null) + public static OpenApiRequestBody LoadRequestBody(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("requestBody"); @@ -52,7 +52,7 @@ public static OpenApiRequestBody LoadRequestBody(ParseNode node, OpenApiDocument var requestBody = new OpenApiRequestBody(); foreach (var property in mapNode) { - property.ParseField(requestBody, _requestBodyFixedFields, _requestBodyPatternFields); + property.ParseField(requestBody, _requestBodyFixedFields, _requestBodyPatternFields, hostDocument); } return requestBody; diff --git a/src/Microsoft.OpenApi/Reader/V3/OpenApiResponseDeserializer.cs b/src/Microsoft.OpenApi/Reader/V3/OpenApiResponseDeserializer.cs index e65a1aafe..4aaee1187 100644 --- a/src/Microsoft.OpenApi/Reader/V3/OpenApiResponseDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V3/OpenApiResponseDeserializer.cs @@ -41,7 +41,7 @@ internal static partial class OpenApiV3Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - public static OpenApiResponse LoadResponse(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiResponse LoadResponse(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("response"); diff --git a/src/Microsoft.OpenApi/Reader/V3/OpenApiResponsesDeserializer.cs b/src/Microsoft.OpenApi/Reader/V3/OpenApiResponsesDeserializer.cs index 817cdcbf6..7288c04b1 100644 --- a/src/Microsoft.OpenApi/Reader/V3/OpenApiResponsesDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V3/OpenApiResponsesDeserializer.cs @@ -21,7 +21,7 @@ internal static partial class OpenApiV3Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - public static OpenApiResponses LoadResponses(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiResponses LoadResponses(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("Responses"); diff --git a/src/Microsoft.OpenApi/Reader/V3/OpenApiSchemaDeserializer.cs b/src/Microsoft.OpenApi/Reader/V3/OpenApiSchemaDeserializer.cs index 9faafca12..bad6d04b8 100644 --- a/src/Microsoft.OpenApi/Reader/V3/OpenApiSchemaDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V3/OpenApiSchemaDeserializer.cs @@ -92,7 +92,7 @@ internal static partial class OpenApiV3Deserializer }, { "oneOf", - (o, n, _) => o.OneOf = n.CreateList(LoadSchema) + (o, n, doc) => o.OneOf = n.CreateList(LoadSchema, doc) }, { "anyOf", @@ -100,18 +100,18 @@ internal static partial class OpenApiV3Deserializer }, { "not", - (o, n, _) => o.Not = LoadSchema(n) + (o, n, doc) => o.Not = LoadSchema(n, doc) }, { "items", - (o, n, _) => o.Items = LoadSchema(n) + (o, n, doc) => o.Items = LoadSchema(n, doc) }, { "properties", (o, n, t) => o.Properties = n.CreateMap(LoadSchema, t) }, { - "additionalProperties", (o, n, _) => + "additionalProperties", (o, n, doc) => { if (n is ValueNode) { @@ -119,7 +119,7 @@ internal static partial class OpenApiV3Deserializer } else { - o.AdditionalProperties = LoadSchema(n); + o.AdditionalProperties = LoadSchema(n, doc); } } }, @@ -141,7 +141,7 @@ internal static partial class OpenApiV3Deserializer }, { "discriminator", - (o, n, _) => o.Discriminator = LoadDiscriminator(n) + (o, n, doc) => o.Discriminator = LoadDiscriminator(n, doc) }, { "readOnly", @@ -153,11 +153,11 @@ internal static partial class OpenApiV3Deserializer }, { "xml", - (o, n, _) => o.Xml = LoadXml(n) + (o, n, doc) => o.Xml = LoadXml(n, doc) }, { "externalDocs", - (o, n, _) => o.ExternalDocs = LoadExternalDocs(n) + (o, n, doc) => o.ExternalDocs = LoadExternalDocs(n, doc) }, { "example", @@ -174,7 +174,7 @@ internal static partial class OpenApiV3Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - public static OpenApiSchema LoadSchema(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiSchema LoadSchema(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode(OpenApiConstants.Schema); @@ -190,7 +190,7 @@ public static OpenApiSchema LoadSchema(ParseNode node, OpenApiDocument hostDocum foreach (var propertyNode in mapNode) { - propertyNode.ParseField(schema, _openApiSchemaFixedFields, _openApiSchemaPatternFields); + propertyNode.ParseField(schema, _openApiSchemaFixedFields, _openApiSchemaPatternFields, hostDocument); } return schema; diff --git a/src/Microsoft.OpenApi/Reader/V3/OpenApiSecuritySchemeDeserializer.cs b/src/Microsoft.OpenApi/Reader/V3/OpenApiSecuritySchemeDeserializer.cs index 0659b4c22..18c4eae28 100644 --- a/src/Microsoft.OpenApi/Reader/V3/OpenApiSecuritySchemeDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V3/OpenApiSecuritySchemeDeserializer.cs @@ -72,7 +72,7 @@ internal static partial class OpenApiV3Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - public static OpenApiSecurityScheme LoadSecurityScheme(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiSecurityScheme LoadSecurityScheme(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("securityScheme"); var pointer = mapNode.GetReferencePointer(); @@ -85,7 +85,7 @@ public static OpenApiSecurityScheme LoadSecurityScheme(ParseNode node, OpenApiDo var securityScheme = new OpenApiSecurityScheme(); foreach (var property in mapNode) { - property.ParseField(securityScheme, _securitySchemeFixedFields, _securitySchemePatternFields); + property.ParseField(securityScheme, _securitySchemeFixedFields, _securitySchemePatternFields, hostDocument); } return securityScheme; diff --git a/src/Microsoft.OpenApi/Reader/V3/OpenApiServerDeserializer.cs b/src/Microsoft.OpenApi/Reader/V3/OpenApiServerDeserializer.cs index 9f56f764c..52ee335c0 100644 --- a/src/Microsoft.OpenApi/Reader/V3/OpenApiServerDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V3/OpenApiServerDeserializer.cs @@ -34,7 +34,7 @@ internal static partial class OpenApiV3Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - public static OpenApiServer LoadServer(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiServer LoadServer(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("server"); diff --git a/src/Microsoft.OpenApi/Reader/V3/OpenApiServerVariableDeserializer.cs b/src/Microsoft.OpenApi/Reader/V3/OpenApiServerVariableDeserializer.cs index dc04b9e4a..9436e62fe 100644 --- a/src/Microsoft.OpenApi/Reader/V3/OpenApiServerVariableDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V3/OpenApiServerVariableDeserializer.cs @@ -36,7 +36,7 @@ internal static partial class OpenApiV3Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - public static OpenApiServerVariable LoadServerVariable(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiServerVariable LoadServerVariable(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("serverVariable"); diff --git a/src/Microsoft.OpenApi/Reader/V3/OpenApiTagDeserializer.cs b/src/Microsoft.OpenApi/Reader/V3/OpenApiTagDeserializer.cs index 218399cbb..e6efafae7 100644 --- a/src/Microsoft.OpenApi/Reader/V3/OpenApiTagDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V3/OpenApiTagDeserializer.cs @@ -34,7 +34,7 @@ internal static partial class OpenApiV3Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - public static OpenApiTag LoadTag(ParseNode n, OpenApiDocument hostDocument = null) + public static OpenApiTag LoadTag(ParseNode n, OpenApiDocument hostDocument) { var mapNode = n.CheckMapNode("tag"); @@ -42,7 +42,7 @@ public static OpenApiTag LoadTag(ParseNode n, OpenApiDocument hostDocument = nul foreach (var propertyNode in mapNode) { - propertyNode.ParseField(domainObject, _tagFixedFields, _tagPatternFields); + propertyNode.ParseField(domainObject, _tagFixedFields, _tagPatternFields, hostDocument); } return domainObject; diff --git a/src/Microsoft.OpenApi/Reader/V3/OpenApiV3Deserializer.cs b/src/Microsoft.OpenApi/Reader/V3/OpenApiV3Deserializer.cs index 6fa8406bf..cad424c50 100644 --- a/src/Microsoft.OpenApi/Reader/V3/OpenApiV3Deserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V3/OpenApiV3Deserializer.cs @@ -24,7 +24,7 @@ private static void ParseMap( T domainObject, FixedFieldMap fixedFieldMap, PatternFieldMap patternFieldMap, - OpenApiDocument hostDocument = null) + OpenApiDocument hostDocument) { if (mapNode == null) { @@ -163,7 +163,7 @@ private static RuntimeExpressionAnyWrapper LoadRuntimeExpressionAnyWrapper(Parse }; } - public static OpenApiAny LoadAny(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiAny LoadAny(ParseNode node, OpenApiDocument hostDocument) { return new OpenApiAny(node.CreateAny()); } diff --git a/src/Microsoft.OpenApi/Reader/V3/OpenApiXmlDeserializer.cs b/src/Microsoft.OpenApi/Reader/V3/OpenApiXmlDeserializer.cs index b57b641c4..51b66d348 100644 --- a/src/Microsoft.OpenApi/Reader/V3/OpenApiXmlDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V3/OpenApiXmlDeserializer.cs @@ -44,14 +44,14 @@ internal static partial class OpenApiV3Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - public static OpenApiXml LoadXml(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiXml LoadXml(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("xml"); var xml = new OpenApiXml(); foreach (var property in mapNode) { - property.ParseField(xml, _xmlFixedFields, _xmlPatternFields); + property.ParseField(xml, _xmlFixedFields, _xmlPatternFields, hostDocument); } return xml; diff --git a/src/Microsoft.OpenApi/Reader/V31/OpenApiCallbackDeserializer.cs b/src/Microsoft.OpenApi/Reader/V31/OpenApiCallbackDeserializer.cs index 580ce1356..2f7a3e5c6 100644 --- a/src/Microsoft.OpenApi/Reader/V31/OpenApiCallbackDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V31/OpenApiCallbackDeserializer.cs @@ -24,7 +24,7 @@ internal static partial class OpenApiV31Deserializer {s => s.StartsWith("x-", StringComparison.OrdinalIgnoreCase), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))}, }; - public static OpenApiCallback LoadCallback(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiCallback LoadCallback(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("callback"); diff --git a/src/Microsoft.OpenApi/Reader/V31/OpenApiComponentsDeserializer.cs b/src/Microsoft.OpenApi/Reader/V31/OpenApiComponentsDeserializer.cs index e70087d4b..c9dccde5d 100644 --- a/src/Microsoft.OpenApi/Reader/V31/OpenApiComponentsDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V31/OpenApiComponentsDeserializer.cs @@ -34,7 +34,7 @@ internal static partial class OpenApiV31Deserializer {s => s.StartsWith("x-", StringComparison.OrdinalIgnoreCase), (o, p, n, _) => o.AddExtension(p, LoadExtension(p, n))} }; - public static OpenApiComponents LoadComponents(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiComponents LoadComponents(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("components"); var components = new OpenApiComponents(); diff --git a/src/Microsoft.OpenApi/Reader/V31/OpenApiContactDeserializer.cs b/src/Microsoft.OpenApi/Reader/V31/OpenApiContactDeserializer.cs index 7434deeec..801eb2de9 100644 --- a/src/Microsoft.OpenApi/Reader/V31/OpenApiContactDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V31/OpenApiContactDeserializer.cs @@ -38,7 +38,7 @@ internal static partial class OpenApiV31Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - public static OpenApiContact LoadContact(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiContact LoadContact(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node as MapNode; var contact = new OpenApiContact(); diff --git a/src/Microsoft.OpenApi/Reader/V31/OpenApiDiscriminatorDeserializer.cs b/src/Microsoft.OpenApi/Reader/V31/OpenApiDiscriminatorDeserializer.cs index 51122a9c8..90e904f60 100644 --- a/src/Microsoft.OpenApi/Reader/V31/OpenApiDiscriminatorDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V31/OpenApiDiscriminatorDeserializer.cs @@ -33,14 +33,14 @@ internal static partial class OpenApiV31Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - public static OpenApiDiscriminator LoadDiscriminator(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiDiscriminator LoadDiscriminator(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("discriminator"); var discriminator = new OpenApiDiscriminator(); foreach (var property in mapNode) { - property.ParseField(discriminator, _discriminatorFixedFields, _discriminatorPatternFields); + property.ParseField(discriminator, _discriminatorFixedFields, _discriminatorPatternFields, hostDocument); } return discriminator; diff --git a/src/Microsoft.OpenApi/Reader/V31/OpenApiEncodingDeserializer.cs b/src/Microsoft.OpenApi/Reader/V31/OpenApiEncodingDeserializer.cs index d676b1a59..51a5b4ef6 100644 --- a/src/Microsoft.OpenApi/Reader/V31/OpenApiEncodingDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V31/OpenApiEncodingDeserializer.cs @@ -54,14 +54,14 @@ internal static partial class OpenApiV31Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - public static OpenApiEncoding LoadEncoding(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiEncoding LoadEncoding(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("encoding"); var encoding = new OpenApiEncoding(); foreach (var property in mapNode) { - property.ParseField(encoding, _encodingFixedFields, _encodingPatternFields); + property.ParseField(encoding, _encodingFixedFields, _encodingPatternFields, hostDocument); } return encoding; diff --git a/src/Microsoft.OpenApi/Reader/V31/OpenApiExampleDeserializer.cs b/src/Microsoft.OpenApi/Reader/V31/OpenApiExampleDeserializer.cs index 0035360d5..f7038e595 100644 --- a/src/Microsoft.OpenApi/Reader/V31/OpenApiExampleDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V31/OpenApiExampleDeserializer.cs @@ -47,7 +47,7 @@ internal static partial class OpenApiV31Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - public static OpenApiExample LoadExample(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiExample LoadExample(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("example"); @@ -61,7 +61,7 @@ public static OpenApiExample LoadExample(ParseNode node, OpenApiDocument hostDoc var example = new OpenApiExample(); foreach (var property in mapNode) { - property.ParseField(example, _exampleFixedFields, _examplePatternFields); + property.ParseField(example, _exampleFixedFields, _examplePatternFields, hostDocument); } return example; diff --git a/src/Microsoft.OpenApi/Reader/V31/OpenApiExternalDocsDeserializer.cs b/src/Microsoft.OpenApi/Reader/V31/OpenApiExternalDocsDeserializer.cs index f42288fcf..56dd2bc77 100644 --- a/src/Microsoft.OpenApi/Reader/V31/OpenApiExternalDocsDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V31/OpenApiExternalDocsDeserializer.cs @@ -36,7 +36,7 @@ internal static partial class OpenApiV31Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p, n))} }; - public static OpenApiExternalDocs LoadExternalDocs(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiExternalDocs LoadExternalDocs(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("externalDocs"); diff --git a/src/Microsoft.OpenApi/Reader/V31/OpenApiHeaderDeserializer.cs b/src/Microsoft.OpenApi/Reader/V31/OpenApiHeaderDeserializer.cs index 7349774f6..86b5da46c 100644 --- a/src/Microsoft.OpenApi/Reader/V31/OpenApiHeaderDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V31/OpenApiHeaderDeserializer.cs @@ -85,7 +85,7 @@ internal static partial class OpenApiV31Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - public static OpenApiHeader LoadHeader(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiHeader LoadHeader(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("header"); @@ -99,7 +99,7 @@ public static OpenApiHeader LoadHeader(ParseNode node, OpenApiDocument hostDocum var header = new OpenApiHeader(); foreach (var property in mapNode) { - property.ParseField(header, _headerFixedFields, _headerPatternFields); + property.ParseField(header, _headerFixedFields, _headerPatternFields, hostDocument); } return header; diff --git a/src/Microsoft.OpenApi/Reader/V31/OpenApiInfoDeserializer.cs b/src/Microsoft.OpenApi/Reader/V31/OpenApiInfoDeserializer.cs index 6476e1acc..d3aed5511 100644 --- a/src/Microsoft.OpenApi/Reader/V31/OpenApiInfoDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V31/OpenApiInfoDeserializer.cs @@ -62,7 +62,7 @@ internal static partial class OpenApiV31Deserializer {s => s.StartsWith("x-"), (o, k, n, _) => o.AddExtension(k,LoadExtension(k, n))} }; - public static OpenApiInfo LoadInfo(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiInfo LoadInfo(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("Info"); var info = new OpenApiInfo(); diff --git a/src/Microsoft.OpenApi/Reader/V31/OpenApiLicenseDeserializer.cs b/src/Microsoft.OpenApi/Reader/V31/OpenApiLicenseDeserializer.cs index efddbc2b1..303f2f65a 100644 --- a/src/Microsoft.OpenApi/Reader/V31/OpenApiLicenseDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V31/OpenApiLicenseDeserializer.cs @@ -38,7 +38,7 @@ internal static partial class OpenApiV31Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - internal static OpenApiLicense LoadLicense(ParseNode node, OpenApiDocument hostDocument = null) + internal static OpenApiLicense LoadLicense(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("License"); diff --git a/src/Microsoft.OpenApi/Reader/V31/OpenApiLinkDeserializer.cs b/src/Microsoft.OpenApi/Reader/V31/OpenApiLinkDeserializer.cs index aa1e26ea1..8ec6387fc 100644 --- a/src/Microsoft.OpenApi/Reader/V31/OpenApiLinkDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V31/OpenApiLinkDeserializer.cs @@ -52,7 +52,7 @@ internal static partial class OpenApiV31Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))}, }; - public static OpenApiLink LoadLink(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiLink LoadLink(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("link"); var link = new OpenApiLink(); diff --git a/src/Microsoft.OpenApi/Reader/V31/OpenApiMediaTypeDeserializer.cs b/src/Microsoft.OpenApi/Reader/V31/OpenApiMediaTypeDeserializer.cs index c0ce9b843..36f90383c 100644 --- a/src/Microsoft.OpenApi/Reader/V31/OpenApiMediaTypeDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V31/OpenApiMediaTypeDeserializer.cs @@ -70,7 +70,7 @@ internal static partial class OpenApiV31Deserializer } }; - public static OpenApiMediaType LoadMediaType(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiMediaType LoadMediaType(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode(OpenApiConstants.Content); diff --git a/src/Microsoft.OpenApi/Reader/V31/OpenApiOAuthFlowDeserializer.cs b/src/Microsoft.OpenApi/Reader/V31/OpenApiOAuthFlowDeserializer.cs index 199cf14e7..5b18caecf 100644 --- a/src/Microsoft.OpenApi/Reader/V31/OpenApiOAuthFlowDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V31/OpenApiOAuthFlowDeserializer.cs @@ -41,14 +41,14 @@ internal static partial class OpenApiV31Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - public static OpenApiOAuthFlow LoadOAuthFlow(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiOAuthFlow LoadOAuthFlow(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("OAuthFlow"); var oauthFlow = new OpenApiOAuthFlow(); foreach (var property in mapNode) { - property.ParseField(oauthFlow, _oAuthFlowFixedFileds, _oAuthFlowPatternFields); + property.ParseField(oauthFlow, _oAuthFlowFixedFileds, _oAuthFlowPatternFields, hostDocument); } return oauthFlow; diff --git a/src/Microsoft.OpenApi/Reader/V31/OpenApiOAuthFlowsDeserializer.cs b/src/Microsoft.OpenApi/Reader/V31/OpenApiOAuthFlowsDeserializer.cs index 28316ec9b..b20b96775 100644 --- a/src/Microsoft.OpenApi/Reader/V31/OpenApiOAuthFlowsDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V31/OpenApiOAuthFlowsDeserializer.cs @@ -10,7 +10,7 @@ namespace Microsoft.OpenApi.Reader.V31 /// internal static partial class OpenApiV31Deserializer { - private static readonly FixedFieldMap _oAuthFlowsFixedFileds = + private static readonly FixedFieldMap _oAuthFlowsFixedFields = new() { {"implicit", (o, n, t) => o.Implicit = LoadOAuthFlow(n, t)}, @@ -25,14 +25,14 @@ internal static partial class OpenApiV31Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - public static OpenApiOAuthFlows LoadOAuthFlows(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiOAuthFlows LoadOAuthFlows(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("OAuthFlows"); var oAuthFlows = new OpenApiOAuthFlows(); foreach (var property in mapNode) { - property.ParseField(oAuthFlows, _oAuthFlowsFixedFileds, _oAuthFlowsPatternFields); + property.ParseField(oAuthFlows, _oAuthFlowsFixedFields, _oAuthFlowsPatternFields, hostDocument); } return oAuthFlows; diff --git a/src/Microsoft.OpenApi/Reader/V31/OpenApiOperationDeserializer.cs b/src/Microsoft.OpenApi/Reader/V31/OpenApiOperationDeserializer.cs index b2946fab5..2d6c831e3 100644 --- a/src/Microsoft.OpenApi/Reader/V31/OpenApiOperationDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V31/OpenApiOperationDeserializer.cs @@ -93,7 +93,7 @@ internal static partial class OpenApiV31Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))}, }; - internal static OpenApiOperation LoadOperation(ParseNode node, OpenApiDocument hostDocument = null) + internal static OpenApiOperation LoadOperation(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("Operation"); @@ -104,7 +104,7 @@ internal static OpenApiOperation LoadOperation(ParseNode node, OpenApiDocument h return operation; } - private static OpenApiTagReference LoadTagByReference(string tagName, OpenApiDocument hostDocument = null) + private static OpenApiTagReference LoadTagByReference(string tagName, OpenApiDocument hostDocument) { var tagObject = new OpenApiTagReference(tagName, hostDocument); return tagObject; diff --git a/src/Microsoft.OpenApi/Reader/V31/OpenApiParameterDeserializer.cs b/src/Microsoft.OpenApi/Reader/V31/OpenApiParameterDeserializer.cs index 824e6e577..8c4145ca1 100644 --- a/src/Microsoft.OpenApi/Reader/V31/OpenApiParameterDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V31/OpenApiParameterDeserializer.cs @@ -134,7 +134,7 @@ internal static partial class OpenApiV31Deserializer } }; - public static OpenApiParameter LoadParameter(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiParameter LoadParameter(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("parameter"); diff --git a/src/Microsoft.OpenApi/Reader/V31/OpenApiPathItemDeserializer.cs b/src/Microsoft.OpenApi/Reader/V31/OpenApiPathItemDeserializer.cs index 8797b03e6..22a0030b0 100644 --- a/src/Microsoft.OpenApi/Reader/V31/OpenApiPathItemDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V31/OpenApiPathItemDeserializer.cs @@ -51,7 +51,7 @@ internal static partial class OpenApiV31Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - public static OpenApiPathItem LoadPathItem(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiPathItem LoadPathItem(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("PathItem"); diff --git a/src/Microsoft.OpenApi/Reader/V31/OpenApiPathsDeserializer.cs b/src/Microsoft.OpenApi/Reader/V31/OpenApiPathsDeserializer.cs index e9fef44a8..c72394bf2 100644 --- a/src/Microsoft.OpenApi/Reader/V31/OpenApiPathsDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V31/OpenApiPathsDeserializer.cs @@ -18,7 +18,7 @@ internal static partial class OpenApiV31Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - public static OpenApiPaths LoadPaths(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiPaths LoadPaths(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("Paths"); diff --git a/src/Microsoft.OpenApi/Reader/V31/OpenApiRequestBodyDeserializer.cs b/src/Microsoft.OpenApi/Reader/V31/OpenApiRequestBodyDeserializer.cs index 7acea65c0..faa61eed2 100644 --- a/src/Microsoft.OpenApi/Reader/V31/OpenApiRequestBodyDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V31/OpenApiRequestBodyDeserializer.cs @@ -41,7 +41,7 @@ internal static partial class OpenApiV31Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - public static OpenApiRequestBody LoadRequestBody(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiRequestBody LoadRequestBody(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("requestBody"); @@ -55,7 +55,7 @@ public static OpenApiRequestBody LoadRequestBody(ParseNode node, OpenApiDocument var requestBody = new OpenApiRequestBody(); foreach (var property in mapNode) { - property.ParseField(requestBody, _requestBodyFixedFields, _requestBodyPatternFields); + property.ParseField(requestBody, _requestBodyFixedFields, _requestBodyPatternFields, hostDocument); } return requestBody; diff --git a/src/Microsoft.OpenApi/Reader/V31/OpenApiResponseDeserializer.cs b/src/Microsoft.OpenApi/Reader/V31/OpenApiResponseDeserializer.cs index 611574bf2..4edb5e14d 100644 --- a/src/Microsoft.OpenApi/Reader/V31/OpenApiResponseDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V31/OpenApiResponseDeserializer.cs @@ -46,7 +46,7 @@ internal static partial class OpenApiV31Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - public static OpenApiResponse LoadResponse(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiResponse LoadResponse(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("response"); diff --git a/src/Microsoft.OpenApi/Reader/V31/OpenApiResponsesDeserializer.cs b/src/Microsoft.OpenApi/Reader/V31/OpenApiResponsesDeserializer.cs index 42cb3b826..228a0045e 100644 --- a/src/Microsoft.OpenApi/Reader/V31/OpenApiResponsesDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V31/OpenApiResponsesDeserializer.cs @@ -21,7 +21,7 @@ internal static partial class OpenApiV31Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - public static OpenApiResponses LoadResponses(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiResponses LoadResponses(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("Responses"); diff --git a/src/Microsoft.OpenApi/Reader/V31/OpenApiSchemaDeserializer.cs b/src/Microsoft.OpenApi/Reader/V31/OpenApiSchemaDeserializer.cs index 83be6f773..36db155c1 100644 --- a/src/Microsoft.OpenApi/Reader/V31/OpenApiSchemaDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V31/OpenApiSchemaDeserializer.cs @@ -151,11 +151,11 @@ internal static partial class OpenApiV31Deserializer }, { "not", - (o, n, _) => o.Not = LoadSchema(n) + (o, n, doc) => o.Not = LoadSchema(n, doc) }, { "items", - (o, n, _) => o.Items = LoadSchema(n) + (o, n, doc) => o.Items = LoadSchema(n, doc) }, { "properties", @@ -166,7 +166,7 @@ internal static partial class OpenApiV31Deserializer (o, n, t) => o.PatternProperties = n.CreateMap(LoadSchema, t) }, { - "additionalProperties", (o, n, _) => + "additionalProperties", (o, n, doc) => { if (n is ValueNode) { @@ -174,7 +174,7 @@ internal static partial class OpenApiV31Deserializer } else { - o.AdditionalProperties = LoadSchema(n); + o.AdditionalProperties = LoadSchema(n, doc); } } }, @@ -203,7 +203,7 @@ internal static partial class OpenApiV31Deserializer }, { "discriminator", - (o, n, _) => o.Discriminator = LoadDiscriminator(n) + (o, n, doc) => o.Discriminator = LoadDiscriminator(n, doc) }, { "readOnly", @@ -215,11 +215,11 @@ internal static partial class OpenApiV31Deserializer }, { "xml", - (o, n, _) => o.Xml = LoadXml(n) + (o, n, doc) => o.Xml = LoadXml(n, doc) }, { "externalDocs", - (o, n, _) => o.ExternalDocs = LoadExternalDocs(n) + (o, n, doc) => o.ExternalDocs = LoadExternalDocs(n, doc) }, { "example", @@ -240,7 +240,7 @@ internal static partial class OpenApiV31Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - public static OpenApiSchema LoadSchema(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiSchema LoadSchema(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode(OpenApiConstants.Schema); @@ -261,7 +261,7 @@ public static OpenApiSchema LoadSchema(ParseNode node, OpenApiDocument hostDocum if (isRecognized) { - propertyNode.ParseField(schema, _openApiSchemaFixedFields, _openApiSchemaPatternFields); + propertyNode.ParseField(schema, _openApiSchemaFixedFields, _openApiSchemaPatternFields, hostDocument); } else { diff --git a/src/Microsoft.OpenApi/Reader/V31/OpenApiSecuritySchemeDeserializer.cs b/src/Microsoft.OpenApi/Reader/V31/OpenApiSecuritySchemeDeserializer.cs index 8fb5c0cd1..1bf948d3c 100644 --- a/src/Microsoft.OpenApi/Reader/V31/OpenApiSecuritySchemeDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V31/OpenApiSecuritySchemeDeserializer.cs @@ -83,7 +83,7 @@ internal static partial class OpenApiV31Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - public static OpenApiSecurityScheme LoadSecurityScheme(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiSecurityScheme LoadSecurityScheme(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("securityScheme"); @@ -97,7 +97,7 @@ public static OpenApiSecurityScheme LoadSecurityScheme(ParseNode node, OpenApiDo var securityScheme = new OpenApiSecurityScheme(); foreach (var property in mapNode) { - property.ParseField(securityScheme, _securitySchemeFixedFields, _securitySchemePatternFields); + property.ParseField(securityScheme, _securitySchemeFixedFields, _securitySchemePatternFields, hostDocument); } return securityScheme; diff --git a/src/Microsoft.OpenApi/Reader/V31/OpenApiServerDeserializer.cs b/src/Microsoft.OpenApi/Reader/V31/OpenApiServerDeserializer.cs index efe25fedb..2ae8ac340 100644 --- a/src/Microsoft.OpenApi/Reader/V31/OpenApiServerDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V31/OpenApiServerDeserializer.cs @@ -40,7 +40,7 @@ internal static partial class OpenApiV31Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - public static OpenApiServer LoadServer(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiServer LoadServer(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("server"); diff --git a/src/Microsoft.OpenApi/Reader/V31/OpenApiServerVariableDeserializer.cs b/src/Microsoft.OpenApi/Reader/V31/OpenApiServerVariableDeserializer.cs index 74dc1c504..0c6e8b756 100644 --- a/src/Microsoft.OpenApi/Reader/V31/OpenApiServerVariableDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V31/OpenApiServerVariableDeserializer.cs @@ -42,7 +42,7 @@ internal static partial class OpenApiV31Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - public static OpenApiServerVariable LoadServerVariable(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiServerVariable LoadServerVariable(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("serverVariable"); diff --git a/src/Microsoft.OpenApi/Reader/V31/OpenApiTagDeserializer.cs b/src/Microsoft.OpenApi/Reader/V31/OpenApiTagDeserializer.cs index a6dfe5f1f..f1b0065cc 100644 --- a/src/Microsoft.OpenApi/Reader/V31/OpenApiTagDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V31/OpenApiTagDeserializer.cs @@ -40,7 +40,7 @@ internal static partial class OpenApiV31Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - public static OpenApiTag LoadTag(ParseNode n, OpenApiDocument hostDocument = null) + public static OpenApiTag LoadTag(ParseNode n, OpenApiDocument hostDocument) { var mapNode = n.CheckMapNode("tag"); @@ -48,7 +48,7 @@ public static OpenApiTag LoadTag(ParseNode n, OpenApiDocument hostDocument = nul foreach (var propertyNode in mapNode) { - propertyNode.ParseField(domainObject, _tagFixedFields, _tagPatternFields); + propertyNode.ParseField(domainObject, _tagFixedFields, _tagPatternFields, hostDocument); } return domainObject; diff --git a/src/Microsoft.OpenApi/Reader/V31/OpenApiV31Deserializer.cs b/src/Microsoft.OpenApi/Reader/V31/OpenApiV31Deserializer.cs index a037dc3c1..2a2fdbfe9 100644 --- a/src/Microsoft.OpenApi/Reader/V31/OpenApiV31Deserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V31/OpenApiV31Deserializer.cs @@ -128,7 +128,7 @@ private static RuntimeExpressionAnyWrapper LoadRuntimeExpressionAnyWrapper(Parse }; } - public static JsonNode LoadAny(ParseNode node, OpenApiDocument hostDocument = null) + public static JsonNode LoadAny(ParseNode node, OpenApiDocument hostDocument) { return node.CreateAny(); } diff --git a/src/Microsoft.OpenApi/Reader/V31/OpenApiXmlDeserializer.cs b/src/Microsoft.OpenApi/Reader/V31/OpenApiXmlDeserializer.cs index 4c7a17b85..13870f341 100644 --- a/src/Microsoft.OpenApi/Reader/V31/OpenApiXmlDeserializer.cs +++ b/src/Microsoft.OpenApi/Reader/V31/OpenApiXmlDeserializer.cs @@ -54,14 +54,14 @@ internal static partial class OpenApiV31Deserializer {s => s.StartsWith("x-"), (o, p, n, _) => o.AddExtension(p, LoadExtension(p,n))} }; - public static OpenApiXml LoadXml(ParseNode node, OpenApiDocument hostDocument = null) + public static OpenApiXml LoadXml(ParseNode node, OpenApiDocument hostDocument) { var mapNode = node.CheckMapNode("xml"); var xml = new OpenApiXml(); foreach (var property in mapNode) { - property.ParseField(xml, _xmlFixedFields, _xmlPatternFields); + property.ParseField(xml, _xmlFixedFields, _xmlPatternFields, hostDocument); } return xml; diff --git a/test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiHeaderTests.cs b/test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiHeaderTests.cs index 80948f93b..cc15d8427 100644 --- a/test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiHeaderTests.cs +++ b/test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiHeaderTests.cs @@ -28,7 +28,7 @@ public void ParseHeaderWithDefaultShouldSucceed() } // Act - var header = OpenApiV2Deserializer.LoadHeader(node); + var header = OpenApiV2Deserializer.LoadHeader(node, new()); // Assert header.Should().BeEquivalentTo( @@ -57,7 +57,7 @@ public void ParseHeaderWithEnumShouldSucceed() } // Act - var header = OpenApiV2Deserializer.LoadHeader(node); + var header = OpenApiV2Deserializer.LoadHeader(node, new()); // Assert header.Should().BeEquivalentTo( diff --git a/test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiOperationTests.cs b/test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiOperationTests.cs index 948c6544c..854568e53 100644 --- a/test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiOperationTests.cs +++ b/test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiOperationTests.cs @@ -228,7 +228,7 @@ public void ParseBasicOperationShouldSucceed() } // Act - var operation = OpenApiV2Deserializer.LoadOperation(node); + var operation = OpenApiV2Deserializer.LoadOperation(node, new()); // Assert operation.Should().BeEquivalentTo(_basicOperation); @@ -246,7 +246,7 @@ public async Task ParseBasicOperationTwiceShouldYieldSameObject() } // Act - var operation = OpenApiV2Deserializer.LoadOperation(node); + var operation = OpenApiV2Deserializer.LoadOperation(node, new()); // Assert operation.Should().BeEquivalentTo(_basicOperation); @@ -263,7 +263,7 @@ public void ParseOperationWithBodyShouldSucceed() } // Act - var operation = OpenApiV2Deserializer.LoadOperation(node); + var operation = OpenApiV2Deserializer.LoadOperation(node, new()); // Assert operation.Should().BeEquivalentTo(_operationWithBody, options => options.IgnoringCyclicReferences()); @@ -281,7 +281,7 @@ public async Task ParseOperationWithBodyTwiceShouldYieldSameObject() } // Act - var operation = OpenApiV2Deserializer.LoadOperation(node); + var operation = OpenApiV2Deserializer.LoadOperation(node, new()); // Assert operation.Should().BeEquivalentTo(_operationWithBody, options => options.IgnoringCyclicReferences()); @@ -298,7 +298,7 @@ public void ParseOperationWithResponseExamplesShouldSucceed() } // Act - var operation = OpenApiV2Deserializer.LoadOperation(node); + var operation = OpenApiV2Deserializer.LoadOperation(node, new()); // Assert operation.Should().BeEquivalentTo( @@ -362,7 +362,7 @@ public void ParseOperationWithEmptyProducesArraySetsResponseSchemaIfExists() node = TestHelper.CreateYamlMapNode(stream); // Act - var operation = OpenApiV2Deserializer.LoadOperation(node); + var operation = OpenApiV2Deserializer.LoadOperation(node, new()); var expected = @"{ ""produces"": [ ""application/octet-stream"" @@ -398,7 +398,7 @@ public void ParseOperationWithBodyAndEmptyConsumesSetsRequestBodySchemaIfExists( node = TestHelper.CreateYamlMapNode(stream); // Act - var operation = OpenApiV2Deserializer.LoadOperation(node); + var operation = OpenApiV2Deserializer.LoadOperation(node, new()); // Assert operation.Should().BeEquivalentTo(_operationWithBody, options => options.IgnoringCyclicReferences()); @@ -415,7 +415,7 @@ public async Task ParseV2ResponseWithExamplesExtensionWorks() } // Act - var operation = OpenApiV2Deserializer.LoadOperation(node); + var operation = OpenApiV2Deserializer.LoadOperation(node, new()); var actual = await operation.SerializeAsYamlAsync(OpenApiSpecVersion.OpenApi3_0); // Assert @@ -465,7 +465,7 @@ public async Task LoadV3ExamplesInResponseAsExtensionsWorks() } // Act - var operation = OpenApiV3Deserializer.LoadOperation(node); + var operation = OpenApiV3Deserializer.LoadOperation(node, new()); var actual = await operation.SerializeAsYamlAsync(OpenApiSpecVersion.OpenApi2_0); // Assert @@ -515,7 +515,7 @@ public async Task LoadV2OperationWithBodyParameterExamplesWorks() } // Act - var operation = OpenApiV2Deserializer.LoadOperation(node); + var operation = OpenApiV2Deserializer.LoadOperation(node, new()); var actual = await operation.SerializeAsYamlAsync(OpenApiSpecVersion.OpenApi3_0); // Assert @@ -566,7 +566,7 @@ public async Task LoadV3ExamplesInRequestBodyParameterAsExtensionsWorks() } // Act - var operation = OpenApiV3Deserializer.LoadOperation(node); + var operation = OpenApiV3Deserializer.LoadOperation(node, new()); var actual = await operation.SerializeAsYamlAsync(OpenApiSpecVersion.OpenApi2_0); // Assert diff --git a/test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiParameterTests.cs b/test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiParameterTests.cs index 0b4b1a77e..e631dc31d 100644 --- a/test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiParameterTests.cs +++ b/test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiParameterTests.cs @@ -28,7 +28,7 @@ public void ParseBodyParameterShouldSucceed() } // Act - var parameter = OpenApiV2Deserializer.LoadParameter(node); + var parameter = OpenApiV2Deserializer.LoadParameter(node, new()); // Assert // Body parameter is currently not translated via LoadParameter. @@ -47,7 +47,7 @@ public void ParsePathParameterShouldSucceed() } // Act - var parameter = OpenApiV2Deserializer.LoadParameter(node); + var parameter = OpenApiV2Deserializer.LoadParameter(node, new()); // Assert parameter.Should().BeEquivalentTo( @@ -75,7 +75,7 @@ public void ParseQueryParameterShouldSucceed() } // Act - var parameter = OpenApiV2Deserializer.LoadParameter(node); + var parameter = OpenApiV2Deserializer.LoadParameter(node, new()); // Assert parameter.Should().BeEquivalentTo( @@ -109,7 +109,7 @@ public void ParseParameterWithNullLocationShouldSucceed() } // Act - var parameter = OpenApiV2Deserializer.LoadParameter(node); + var parameter = OpenApiV2Deserializer.LoadParameter(node, new()); // Assert parameter.Should().BeEquivalentTo( @@ -137,7 +137,7 @@ public void ParseParameterWithNoLocationShouldSucceed() } // Act - var parameter = OpenApiV2Deserializer.LoadParameter(node); + var parameter = OpenApiV2Deserializer.LoadParameter(node, new()); // Assert parameter.Should().BeEquivalentTo( @@ -165,7 +165,7 @@ public void ParseParameterWithNoSchemaShouldSucceed() } // Act - var parameter = OpenApiV2Deserializer.LoadParameter(node); + var parameter = OpenApiV2Deserializer.LoadParameter(node, new()); // Assert parameter.Should().BeEquivalentTo( @@ -189,7 +189,7 @@ public void ParseParameterWithUnknownLocationShouldSucceed() } // Act - var parameter = OpenApiV2Deserializer.LoadParameter(node); + var parameter = OpenApiV2Deserializer.LoadParameter(node, new()); // Assert parameter.Should().BeEquivalentTo( @@ -217,7 +217,7 @@ public void ParseParameterWithDefaultShouldSucceed() } // Act - var parameter = OpenApiV2Deserializer.LoadParameter(node); + var parameter = OpenApiV2Deserializer.LoadParameter(node, new()); // Assert parameter.Should().BeEquivalentTo( @@ -247,7 +247,7 @@ public void ParseParameterWithEnumShouldSucceed() } // Act - var parameter = OpenApiV2Deserializer.LoadParameter(node); + var parameter = OpenApiV2Deserializer.LoadParameter(node, new()); var expected = new OpenApiParameter { In = ParameterLocation.Path, diff --git a/test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiPathItemTests.cs b/test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiPathItemTests.cs index 47f3903fa..6c4af9e2a 100644 --- a/test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiPathItemTests.cs +++ b/test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiPathItemTests.cs @@ -257,7 +257,7 @@ public void ParseBasicPathItemWithFormDataShouldSucceed() } // Act - var pathItem = OpenApiV2Deserializer.LoadPathItem(node); + var pathItem = OpenApiV2Deserializer.LoadPathItem(node, new()); // Assert pathItem.Should().BeEquivalentTo(_basicPathItemWithFormData); @@ -274,7 +274,7 @@ public void ParsePathItemWithFormDataPathParameterShouldSucceed() } // Act - var pathItem = OpenApiV2Deserializer.LoadPathItem(node); + var pathItem = OpenApiV2Deserializer.LoadPathItem(node, new()); // Assert // FormData parameters at in the path level are pushed into Operation request bodies. @@ -293,7 +293,7 @@ public void ParsePathItemBodyDataPathParameterShouldSucceed() } // Act - var pathItem = OpenApiV2Deserializer.LoadPathItem(node); + var pathItem = OpenApiV2Deserializer.LoadPathItem(node, new()); // Assert // FormData parameters at in the path level are pushed into Operation request bodies. diff --git a/test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiSchemaTests.cs b/test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiSchemaTests.cs index 384e23298..1b36921d7 100644 --- a/test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiSchemaTests.cs +++ b/test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiSchemaTests.cs @@ -32,7 +32,7 @@ public void ParseSchemaWithDefaultShouldSucceed() } // Act - var schema = OpenApiV2Deserializer.LoadSchema(node); + var schema = OpenApiV2Deserializer.LoadSchema(node, new()); // Assert schema.Should().BeEquivalentTo(new OpenApiSchema @@ -54,7 +54,7 @@ public void ParseSchemaWithExampleShouldSucceed() } // Act - var schema = OpenApiV2Deserializer.LoadSchema(node); + var schema = OpenApiV2Deserializer.LoadSchema(node, new()); // Assert schema.Should().BeEquivalentTo( @@ -77,7 +77,7 @@ public void ParseSchemaWithEnumShouldSucceed() } // Act - var schema = OpenApiV2Deserializer.LoadSchema(node); + var schema = OpenApiV2Deserializer.LoadSchema(node, new()); // Assert var expected = new OpenApiSchema diff --git a/test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiSecuritySchemeTests.cs b/test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiSecuritySchemeTests.cs index 82565facd..95a4cf68c 100644 --- a/test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiSecuritySchemeTests.cs +++ b/test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiSecuritySchemeTests.cs @@ -33,7 +33,7 @@ public void ParseHttpSecuritySchemeShouldSucceed() var node = new MapNode(context, asJsonNode); // Act - var securityScheme = OpenApiV2Deserializer.LoadSecurityScheme(node); + var securityScheme = OpenApiV2Deserializer.LoadSecurityScheme(node, new()); // Assert securityScheme.Should().BeEquivalentTo( @@ -58,7 +58,7 @@ public void ParseApiKeySecuritySchemeShouldSucceed() var node = new MapNode(context, asJsonNode); // Act - var securityScheme = OpenApiV2Deserializer.LoadSecurityScheme(node); + var securityScheme = OpenApiV2Deserializer.LoadSecurityScheme(node, new()); // Assert securityScheme.Should().BeEquivalentTo( @@ -83,7 +83,7 @@ public void ParseOAuth2ImplicitSecuritySchemeShouldSucceed() var node = new MapNode(context, asJsonNode); // Act - var securityScheme = OpenApiV2Deserializer.LoadSecurityScheme(node); + var securityScheme = OpenApiV2Deserializer.LoadSecurityScheme(node, new()); // Assert securityScheme.Should().BeEquivalentTo( @@ -118,7 +118,7 @@ public void ParseOAuth2PasswordSecuritySchemeShouldSucceed() var node = new MapNode(context, asJsonNode); // Act - var securityScheme = OpenApiV2Deserializer.LoadSecurityScheme(node); + var securityScheme = OpenApiV2Deserializer.LoadSecurityScheme(node, new()); // Assert securityScheme.Should().BeEquivalentTo( @@ -153,7 +153,7 @@ public void ParseOAuth2ApplicationSecuritySchemeShouldSucceed() var node = new MapNode(context, asJsonNode); // Act - var securityScheme = OpenApiV2Deserializer.LoadSecurityScheme(node); + var securityScheme = OpenApiV2Deserializer.LoadSecurityScheme(node, new()); // Assert securityScheme.Should().BeEquivalentTo( @@ -189,7 +189,7 @@ public void ParseOAuth2AccessCodeSecuritySchemeShouldSucceed() var node = new MapNode(context, asJsonNode); // Act - var securityScheme = OpenApiV2Deserializer.LoadSecurityScheme(node); + var securityScheme = OpenApiV2Deserializer.LoadSecurityScheme(node, new()); // Assert securityScheme.Should().BeEquivalentTo( diff --git a/test/Microsoft.OpenApi.Readers.Tests/V31Tests/OpenApiInfoTests.cs b/test/Microsoft.OpenApi.Readers.Tests/V31Tests/OpenApiInfoTests.cs index 8ecfcf7d5..36982637c 100644 --- a/test/Microsoft.OpenApi.Readers.Tests/V31Tests/OpenApiInfoTests.cs +++ b/test/Microsoft.OpenApi.Readers.Tests/V31Tests/OpenApiInfoTests.cs @@ -30,7 +30,7 @@ public void ParseBasicInfoShouldSucceed() var node = new MapNode(context, asJsonNode); // Act - var openApiInfo = OpenApiV31Deserializer.LoadInfo(node); + var openApiInfo = OpenApiV31Deserializer.LoadInfo(node, new()); // Assert openApiInfo.Should().BeEquivalentTo( diff --git a/test/Microsoft.OpenApi.Readers.Tests/V31Tests/OpenApiLicenseTests.cs b/test/Microsoft.OpenApi.Readers.Tests/V31Tests/OpenApiLicenseTests.cs index cb617064e..14fcd7eae 100644 --- a/test/Microsoft.OpenApi.Readers.Tests/V31Tests/OpenApiLicenseTests.cs +++ b/test/Microsoft.OpenApi.Readers.Tests/V31Tests/OpenApiLicenseTests.cs @@ -33,7 +33,7 @@ public void ParseLicenseWithSpdxIdentifierShouldSucceed() var node = new MapNode(context, asJsonNode); // Act - var license = OpenApiV31Deserializer.LoadLicense(node); + var license = OpenApiV31Deserializer.LoadLicense(node, new()); // Assert license.Should().BeEquivalentTo( diff --git a/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiMediaTypeTests.cs b/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiMediaTypeTests.cs index 74eec310a..a2abb0e6f 100644 --- a/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiMediaTypeTests.cs +++ b/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiMediaTypeTests.cs @@ -106,7 +106,7 @@ public async Task ParseMediaTypeWithEmptyArrayInExamplesWorks() } // Act - var mediaType = OpenApiV3Deserializer.LoadMediaType(node); + var mediaType = OpenApiV3Deserializer.LoadMediaType(node, new()); var serialized = await mediaType.SerializeAsJsonAsync(OpenApiSpecVersion.OpenApi3_0); // Assert diff --git a/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiSchemaTests.cs b/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiSchemaTests.cs index ac41ebd9c..6311f9a8a 100644 --- a/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiSchemaTests.cs +++ b/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiSchemaTests.cs @@ -45,7 +45,7 @@ public void ParsePrimitiveSchemaShouldSucceed() var node = new MapNode(context, asJsonNode); // Act - var schema = OpenApiV3Deserializer.LoadSchema(node); + var schema = OpenApiV3Deserializer.LoadSchema(node, new()); // Assert diagnostic.Should().BeEquivalentTo(new OpenApiDiagnostic()); @@ -157,7 +157,7 @@ public void ParseDictionarySchemaShouldSucceed() var node = new MapNode(context, asJsonNode); // Act - var schema = OpenApiV3Deserializer.LoadSchema(node); + var schema = OpenApiV3Deserializer.LoadSchema(node, new()); // Assert diagnostic.Should().BeEquivalentTo(new OpenApiDiagnostic()); @@ -189,7 +189,7 @@ public void ParseBasicSchemaWithExampleShouldSucceed() var node = new MapNode(context, asJsonNode); // Act - var schema = OpenApiV3Deserializer.LoadSchema(node); + var schema = OpenApiV3Deserializer.LoadSchema(node, new()); // Assert diagnostic.Should().BeEquivalentTo(new OpenApiDiagnostic());