From 28e1a3ba7019cf89624bc678309853b26fbbf282 Mon Sep 17 00:00:00 2001 From: "Gavin Barron (from Dev Box)" Date: Wed, 14 Jan 2026 16:18:33 -0800 Subject: [PATCH] feat: allow optional body parameter makes body parameter optional if all fields in the body are optional --- .../Common/RequestBodyRequirementAnalyzer.cs | 177 ++++++ .../Generator/OpenApiRequestBodyGenerator.cs | 20 +- .../ComplexPropertyPostOperationHandler.cs | 9 +- .../ComplexPropertyUpdateOperationHandler.cs | 7 +- .../EntitySetPostOperationHandler.cs | 9 +- .../Operation/EntityUpdateOperationHandler.cs | 7 +- .../NavigationPropertyPostOperationHandler.cs | 7 +- ...avigationPropertyUpdateOperationHandler.cs | 9 +- .../SingletonPatchOperationHandler.cs | 9 +- .../RequestBodyRequirementAnalyzerTests.cs | 503 ++++++++++++++++++ .../OpenApiRequestBodyGeneratorTests.cs | 3 +- .../Resources/Basic.OpenApi.V2.json | 2 - .../Resources/Basic.OpenApi.V2.yaml | 2 - .../Resources/Basic.OpenApi.V3.1.json | 8 +- .../Resources/Basic.OpenApi.V3.1.yaml | 4 +- .../Resources/Basic.OpenApi.json | 226 ++++---- .../Resources/Basic.OpenApi.yaml | 2 - .../Resources/Empty.OpenApi.V3.1.json | 2 +- .../Resources/Empty.OpenApi.V3.1.yaml | 2 +- .../Resources/Empty.OpenApi.json | 2 +- .../Resources/Multiple.Schema.OpenApi.V2.json | 6 - .../Resources/Multiple.Schema.OpenApi.V2.yaml | 6 - .../Multiple.Schema.OpenApi.V3.1.json | 18 +- .../Multiple.Schema.OpenApi.V3.1.yaml | 6 - .../Resources/Multiple.Schema.OpenApi.json | 18 +- .../Resources/Multiple.Schema.OpenApi.yaml | 6 - .../Resources/TripService.OpenApi.V2.json | 84 --- .../Resources/TripService.OpenApi.V2.yaml | 84 --- .../Resources/TripService.OpenApi.V3.1.json | 252 +++------ .../Resources/TripService.OpenApi.V3.1.yaml | 84 --- .../Resources/TripService.OpenApi.json | 252 +++------ .../Resources/TripService.OpenApi.yaml | 84 --- 32 files changed, 1045 insertions(+), 865 deletions(-) create mode 100644 src/Microsoft.OpenApi.OData.Reader/Common/RequestBodyRequirementAnalyzer.cs create mode 100644 test/Microsoft.OpenAPI.OData.Reader.Tests/Common/RequestBodyRequirementAnalyzerTests.cs diff --git a/src/Microsoft.OpenApi.OData.Reader/Common/RequestBodyRequirementAnalyzer.cs b/src/Microsoft.OpenApi.OData.Reader/Common/RequestBodyRequirementAnalyzer.cs new file mode 100644 index 00000000..e4924da8 --- /dev/null +++ b/src/Microsoft.OpenApi.OData.Reader/Common/RequestBodyRequirementAnalyzer.cs @@ -0,0 +1,177 @@ +// ------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. +// ------------------------------------------------------------ + +using System.Collections.Generic; +using System.Linq; +using Microsoft.OData.Edm; +using Microsoft.OpenApi.OData.Edm; +using Microsoft.OpenApi.OData.Vocabulary.Core; + +namespace Microsoft.OpenApi.OData.Common +{ + /// + /// Utility class for analyzing EDM types to determine if request bodies should be required. + /// + internal static class RequestBodyRequirementAnalyzer + { + /// + /// Determines if a request body should be required for an OData action. + /// + /// The EDM action. + /// True if the request body should be required, false otherwise. + public static bool ShouldRequestBodyBeRequired(IEdmAction action) + { + if (action == null) + { + return true; // Safe default + } + + // Get non-binding parameters + var parameters = action.IsBound + ? action.Parameters.Skip(1) + : action.Parameters; + + // If no parameters, body is already null (existing behavior handles this) + if (!parameters.Any()) + { + return true; // Won't matter since body will be null + } + + // Check if all parameters are nullable or optional + return !parameters.All(p => p.Type.IsNullable || p is IEdmOptionalParameter); + } + + /// + /// Determines if a request body should be required for an entity or complex type. + /// + /// The EDM structured type. + /// Whether this is an update operation (excludes key properties). + /// The EDM model for additional context. + /// True if the request body should be required, false otherwise. + public static bool ShouldRequestBodyBeRequired( + IEdmStructuredType structuredType, + bool isUpdateOperation, + IEdmModel? model = null) + { + if (structuredType == null) + { + return true; // Safe default + } + + return !AreAllPropertiesOptional(structuredType, isUpdateOperation, model); + } + + /// + /// Checks if all properties in a structured type are optional. + /// + /// The EDM structured type. + /// Whether to exclude key properties from analysis (for update operations). + /// The EDM model for additional context. + /// True if all properties are optional, false if any are required. + private static bool AreAllPropertiesOptional( + IEdmStructuredType structuredType, + bool excludeKeyProperties, + IEdmModel? model = null) + { + if (structuredType == null) + { + return false; + } + + // Collect all properties including inherited ones + var allProperties = new List(); + + // Get properties from current type and all base types + IEdmStructuredType currentType = structuredType; + while (currentType != null) + { + allProperties.AddRange(currentType.DeclaredStructuralProperties()); + allProperties.AddRange(currentType.DeclaredNavigationProperties()); + currentType = currentType.BaseType; + } + + // If no properties, consider optional (empty body) + if (!allProperties.Any()) + { + return true; + } + + // Get key property names if we need to exclude them + HashSet? keyNames = null; + if (excludeKeyProperties && structuredType is IEdmEntityType entityType) + { + keyNames = new HashSet(entityType.Key().Select(k => k.Name)); + } + + // Check if ALL remaining properties are optional + foreach (var property in allProperties) + { + // Skip key properties if requested + if (keyNames != null && keyNames.Contains(property.Name)) + { + continue; + } + + // Skip computed properties (read-only) + if (model != null && property is IEdmStructuralProperty && + (model.GetBoolean(property, CoreConstants.Computed) ?? false)) + { + continue; + } + + // If this property is required, the body must be required + if (!IsPropertyOptional(property, model)) + { + return false; + } + } + + return true; + } + + /// + /// Checks if an individual property is optional. + /// + /// The EDM property. + /// The EDM model for additional context. + /// True if the property is optional, false if required. + private static bool IsPropertyOptional(IEdmProperty property, IEdmModel? model) + { + if (property == null) + { + return false; + } + + // Structural properties (primitive, enum, complex) + if (property is IEdmStructuralProperty structuralProp) + { + // Has default value = optional + if (!string.IsNullOrEmpty(structuralProp.DefaultValueString)) + { + return true; + } + + // Type is nullable = optional + if (structuralProp.Type.IsNullable) + { + return true; + } + + // Otherwise required + return false; + } + + // Navigation properties + if (property is IEdmNavigationProperty navProp) + { + // Navigation properties are optional if nullable + return navProp.Type.IsNullable; + } + + // Unknown property type, treat as required (safe default) + return false; + } + } +} diff --git a/src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiRequestBodyGenerator.cs b/src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiRequestBodyGenerator.cs index e49a150b..32cac81c 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiRequestBodyGenerator.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiRequestBodyGenerator.cs @@ -77,7 +77,7 @@ internal static class OpenApiRequestBodyGenerator OpenApiRequestBody requestBody = new OpenApiRequestBody { Description = "Action parameters", - Required = true, + Required = RequestBodyRequirementAnalyzer.ShouldRequestBodyBeRequired(action), Content = new Dictionary() }; @@ -159,5 +159,23 @@ private static OpenApiRequestBody CreateRefPutRequestBody(OpenApiDocument docume } }; } + + /// + /// Determines if a request body should be required based on the schema properties. + /// + /// The EDM structured type. + /// Whether this is an update operation (excludes key properties). + /// The EDM model for additional context. + /// True if the request body should be required, false otherwise. + internal static bool DetermineIfRequestBodyRequired( + IEdmStructuredType structuredType, + bool isUpdateOperation, + IEdmModel? model = null) + { + return RequestBodyRequirementAnalyzer.ShouldRequestBodyBeRequired( + structuredType, + isUpdateOperation, + model); + } } } diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/ComplexPropertyPostOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/ComplexPropertyPostOperationHandler.cs index 6cc3ac45..b4998530 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/ComplexPropertyPostOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/ComplexPropertyPostOperationHandler.cs @@ -84,10 +84,15 @@ protected override void SetParameters(OpenApiOperation operation) } /// protected override void SetRequestBody(OpenApiOperation operation) - { + { operation.RequestBody = new OpenApiRequestBody { - Required = true, + Required = ComplexPropertySegment?.ComplexType != null + ? OpenApiRequestBodyGenerator.DetermineIfRequestBodyRequired( + ComplexPropertySegment.ComplexType, + isUpdateOperation: false, + Context?.Model) + : true, Description = "New property values", Content = new Dictionary { diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/ComplexPropertyUpdateOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/ComplexPropertyUpdateOperationHandler.cs index 0b775538..6d7a25d8 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/ComplexPropertyUpdateOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/ComplexPropertyUpdateOperationHandler.cs @@ -63,7 +63,12 @@ protected override void SetRequestBody(OpenApiOperation operation) { operation.RequestBody = new OpenApiRequestBody { - Required = true, + Required = ComplexPropertySegment?.ComplexType != null + ? OpenApiRequestBodyGenerator.DetermineIfRequestBodyRequired( + ComplexPropertySegment.ComplexType, + isUpdateOperation: true, + Context?.Model) + : true, Description = "New property values", Content = new Dictionary { diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/EntitySetPostOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/EntitySetPostOperationHandler.cs index e93fc6c0..1a12aa09 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/EntitySetPostOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/EntitySetPostOperationHandler.cs @@ -69,10 +69,15 @@ protected override void SetBasicInfo(OpenApiOperation operation) protected override void SetRequestBody(OpenApiOperation operation) { // The requestBody field contains a Request Body Object for the request body - // that references the schema of the entity set’s entity type in the global schemas. + // that references the schema of the entity set's entity type in the global schemas. operation.RequestBody = new OpenApiRequestBody { - Required = true, + Required = EntitySet?.EntityType != null + ? OpenApiRequestBodyGenerator.DetermineIfRequestBodyRequired( + EntitySet.EntityType, + isUpdateOperation: false, + Context?.Model) + : true, Description = "New entity", Content = GetContentDescription() }; diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/EntityUpdateOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/EntityUpdateOperationHandler.cs index 7d38684c..a3e830b5 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/EntityUpdateOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/EntityUpdateOperationHandler.cs @@ -77,7 +77,12 @@ protected override void SetRequestBody(OpenApiOperation operation) { operation.RequestBody = new OpenApiRequestBody { - Required = true, + Required = EntitySet?.EntityType != null + ? OpenApiRequestBodyGenerator.DetermineIfRequestBodyRequired( + EntitySet.EntityType, + isUpdateOperation: true, + Context?.Model) + : true, Description = "New property values", Content = GetContent() }; diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/NavigationPropertyPostOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/NavigationPropertyPostOperationHandler.cs index 9b596d45..b667861d 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/NavigationPropertyPostOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/NavigationPropertyPostOperationHandler.cs @@ -67,7 +67,12 @@ protected override void SetRequestBody(OpenApiOperation operation) operation.RequestBody = new OpenApiRequestBody { - Required = true, + Required = NavigationProperty?.ToEntityType() != null + ? OpenApiRequestBodyGenerator.DetermineIfRequestBodyRequired( + NavigationProperty.ToEntityType(), + isUpdateOperation: false, + Context?.Model) + : true, Description = "New navigation property", Content = GetContent(schema, _insertRestriction?.RequestContentTypes) }; diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/NavigationPropertyUpdateOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/NavigationPropertyUpdateOperationHandler.cs index 4c1a5e72..653883f6 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/NavigationPropertyUpdateOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/NavigationPropertyUpdateOperationHandler.cs @@ -58,13 +58,18 @@ protected override void SetBasicInfo(OpenApiOperation operation) /// protected override void SetRequestBody(OpenApiOperation operation) { - var schema = Context is { Settings.EnableDerivedTypesReferencesForRequestBody: true } ? + var schema = Context is { Settings.EnableDerivedTypesReferencesForRequestBody: true } ? EdmModelHelper.GetDerivedTypesReferenceSchema(NavigationProperty.ToEntityType(), Context.Model, _document) : null; operation.RequestBody = new OpenApiRequestBody { - Required = true, + Required = NavigationProperty?.ToEntityType() != null + ? OpenApiRequestBodyGenerator.DetermineIfRequestBodyRequired( + NavigationProperty.ToEntityType(), + isUpdateOperation: true, + Context?.Model) + : true, Description = "New navigation property values", Content = GetContent(schema, _updateRestriction?.RequestContentTypes) }; diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/SingletonPatchOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/SingletonPatchOperationHandler.cs index 2f337861..a13bc741 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/SingletonPatchOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/SingletonPatchOperationHandler.cs @@ -67,10 +67,15 @@ protected override void SetBasicInfo(OpenApiOperation operation) /// protected override void SetRequestBody(OpenApiOperation operation) - { + { operation.RequestBody = new OpenApiRequestBody { - Required = true, + Required = Singleton?.EntityType != null + ? OpenApiRequestBodyGenerator.DetermineIfRequestBodyRequired( + Singleton.EntityType, + isUpdateOperation: true, + Context?.Model) + : true, Description = "New property values", Content = new Dictionary { diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Common/RequestBodyRequirementAnalyzerTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Common/RequestBodyRequirementAnalyzerTests.cs new file mode 100644 index 00000000..8003ad7a --- /dev/null +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Common/RequestBodyRequirementAnalyzerTests.cs @@ -0,0 +1,503 @@ +// ------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. +// ------------------------------------------------------------ + +using System.Linq; +using Microsoft.OData.Edm; +using Microsoft.OData.Edm.Vocabularies; +using Microsoft.OData.Edm.Vocabularies.V1; +using Microsoft.OpenApi.OData.Common; +using Xunit; + +namespace Microsoft.OpenApi.OData.Tests +{ + public class RequestBodyRequirementAnalyzerTests + { + #region Action Tests + + [Fact] + public void ActionWithAllNullableParameters_ReturnsOptional() + { + // Arrange + var action = CreateAction("TestAction", isNullable: true); + + // Act + var result = RequestBodyRequirementAnalyzer.ShouldRequestBodyBeRequired(action); + + // Assert + Assert.False(result); + } + + [Fact] + public void ActionWithAllRequiredParameters_ReturnsRequired() + { + // Arrange + var action = CreateAction("TestAction", isNullable: false); + + // Act + var result = RequestBodyRequirementAnalyzer.ShouldRequestBodyBeRequired(action); + + // Assert + Assert.True(result); + } + + [Fact] + public void ActionWithMixedNullableAndRequiredParameters_ReturnsRequired() + { + // Arrange + var model = new EdmModel(); + var action = new EdmAction("NS", "TestAction", null); + action.AddParameter("nullableParam", EdmCoreModel.Instance.GetString(true)); + action.AddParameter("requiredParam", EdmCoreModel.Instance.GetString(false)); + model.AddElement(action); + + // Act + var result = RequestBodyRequirementAnalyzer.ShouldRequestBodyBeRequired(action); + + // Assert + Assert.True(result); + } + + [Fact] + public void ActionWithOptionalParameter_ReturnsOptional() + { + // Arrange + var model = new EdmModel(); + var action = new EdmAction("NS", "TestAction", null); + action.AddOptionalParameter("optionalParam", EdmCoreModel.Instance.GetString(false)); + model.AddElement(action); + + // Act + var result = RequestBodyRequirementAnalyzer.ShouldRequestBodyBeRequired(action); + + // Assert + Assert.False(result); + } + + [Fact] + public void BoundActionWithNullableParameter_ExcludesBindingParameter() + { + // Arrange + var model = new EdmModel(); + var entityType = new EdmEntityType("NS", "Entity"); + var action = new EdmAction("NS", "TestAction", null, true, null); + action.AddParameter("bindingParam", new EdmEntityTypeReference(entityType, false)); + action.AddParameter("nullableParam", EdmCoreModel.Instance.GetString(true)); + model.AddElement(entityType); + model.AddElement(action); + + // Act + var result = RequestBodyRequirementAnalyzer.ShouldRequestBodyBeRequired(action); + + // Assert + Assert.False(result); // Only non-binding parameter is nullable + } + + [Fact] + public void ActionWithNoParameters_ReturnsRequired() + { + // Arrange + var model = new EdmModel(); + var action = new EdmAction("NS", "TestAction", null); + model.AddElement(action); + + // Act + var result = RequestBodyRequirementAnalyzer.ShouldRequestBodyBeRequired(action); + + // Assert + Assert.True(result); // No parameters means no request body needed, but returns true (existing behavior) + } + + [Fact] + public void NullAction_ReturnsRequired() + { + // Act + var result = RequestBodyRequirementAnalyzer.ShouldRequestBodyBeRequired(null); + + // Assert + Assert.True(result); // Safe default + } + + #endregion + + #region Entity Type Tests - Create Operations + + [Fact] + public void EntityTypeWithAllNullableProperties_CreateOperation_ReturnsOptional() + { + // Arrange + var entityType = CreateEntityType("Customer", hasRequiredProperties: false); + + // Act + var result = RequestBodyRequirementAnalyzer.ShouldRequestBodyBeRequired( + entityType, + isUpdateOperation: false, + model: null); + + // Assert + Assert.False(result); + } + + [Fact] + public void EntityTypeWithRequiredProperty_CreateOperation_ReturnsRequired() + { + // Arrange + var entityType = CreateEntityType("Customer", hasRequiredProperties: true); + + // Act + var result = RequestBodyRequirementAnalyzer.ShouldRequestBodyBeRequired( + entityType, + isUpdateOperation: false, + model: null); + + // Assert + Assert.True(result); + } + + [Fact] + public void EntityTypeWithOnlyKeyProperty_CreateOperation_ReturnsRequired() + { + // Arrange + var entityType = new EdmEntityType("NS", "Entity"); + entityType.AddKeys(entityType.AddStructuralProperty("Id", EdmPrimitiveTypeKind.Int32, false)); + + // Act - Create operation includes key properties + var result = RequestBodyRequirementAnalyzer.ShouldRequestBodyBeRequired( + entityType, + isUpdateOperation: false, + model: null); + + // Assert + Assert.True(result); // Key is not nullable, so body is required + } + + #endregion + + #region Entity Type Tests - Update Operations + + [Fact] + public void EntityTypeWithOnlyKeyProperty_UpdateOperation_ReturnsOptional() + { + // Arrange + var entityType = new EdmEntityType("NS", "Entity"); + entityType.AddKeys(entityType.AddStructuralProperty("Id", EdmPrimitiveTypeKind.Int32, false)); + + // Act - Update operation excludes key properties + var result = RequestBodyRequirementAnalyzer.ShouldRequestBodyBeRequired( + entityType, + isUpdateOperation: true, + model: null); + + // Assert + Assert.False(result); // No non-key properties, so body is optional + } + + [Fact] + public void EntityTypeWithRequiredNonKeyProperty_UpdateOperation_ReturnsRequired() + { + // Arrange + var entityType = new EdmEntityType("NS", "Entity"); + entityType.AddKeys(entityType.AddStructuralProperty("Id", EdmPrimitiveTypeKind.Int32, false)); + entityType.AddStructuralProperty("Name", EdmPrimitiveTypeKind.String, false); // Required + + // Act + var result = RequestBodyRequirementAnalyzer.ShouldRequestBodyBeRequired( + entityType, + isUpdateOperation: true, + model: null); + + // Assert + Assert.True(result); // Has required non-key property + } + + [Fact] + public void EntityTypeWithNullableNonKeyProperties_UpdateOperation_ReturnsOptional() + { + // Arrange + var entityType = new EdmEntityType("NS", "Entity"); + entityType.AddKeys(entityType.AddStructuralProperty("Id", EdmPrimitiveTypeKind.Int32, false)); + entityType.AddStructuralProperty("Name", EdmPrimitiveTypeKind.String, true); // Nullable + entityType.AddStructuralProperty("Email", EdmPrimitiveTypeKind.String, true); // Nullable + + // Act + var result = RequestBodyRequirementAnalyzer.ShouldRequestBodyBeRequired( + entityType, + isUpdateOperation: true, + model: null); + + // Assert + Assert.False(result); // All non-key properties are nullable + } + + #endregion + + #region Inheritance Tests + + [Fact] + public void EntityTypeWithRequiredInheritedProperty_ReturnsRequired() + { + // Arrange + var baseType = new EdmEntityType("NS", "BaseEntity"); + baseType.AddKeys(baseType.AddStructuralProperty("Id", EdmPrimitiveTypeKind.Int32, false)); + baseType.AddStructuralProperty("BaseProperty", EdmPrimitiveTypeKind.String, false); // Required + + var derivedType = new EdmEntityType("NS", "DerivedEntity", baseType); + derivedType.AddStructuralProperty("DerivedProperty", EdmPrimitiveTypeKind.String, true); // Nullable + + // Act - Update operation + var result = RequestBodyRequirementAnalyzer.ShouldRequestBodyBeRequired( + derivedType, + isUpdateOperation: true, + model: null); + + // Assert + Assert.True(result); // Base type has required property + } + + [Fact] + public void EntityTypeWithAllNullableInheritedProperties_ReturnsOptional() + { + // Arrange + var baseType = new EdmEntityType("NS", "BaseEntity"); + baseType.AddKeys(baseType.AddStructuralProperty("Id", EdmPrimitiveTypeKind.Int32, false)); + baseType.AddStructuralProperty("BaseProperty", EdmPrimitiveTypeKind.String, true); // Nullable + + var derivedType = new EdmEntityType("NS", "DerivedEntity", baseType); + derivedType.AddStructuralProperty("DerivedProperty", EdmPrimitiveTypeKind.String, true); // Nullable + + // Act - Update operation + var result = RequestBodyRequirementAnalyzer.ShouldRequestBodyBeRequired( + derivedType, + isUpdateOperation: true, + model: null); + + // Assert + Assert.False(result); // All non-key properties are nullable + } + + #endregion + + #region Property with Default Value Tests + + [Fact] + public void PropertyWithDefaultValue_TreatedAsOptional() + { + // Arrange + var entityType = new EdmEntityType("NS", "Entity"); + entityType.AddKeys(entityType.AddStructuralProperty("Id", EdmPrimitiveTypeKind.Int32, false)); + + // Create property with default value + var nameProperty = new EdmStructuralProperty( + entityType, + "Name", + EdmCoreModel.Instance.GetString(false), + "DefaultName"); // Default value + entityType.AddProperty(nameProperty); + + // Act - Update operation + var result = RequestBodyRequirementAnalyzer.ShouldRequestBodyBeRequired( + entityType, + isUpdateOperation: true, + model: null); + + // Assert + Assert.False(result); // Has default value, so optional + } + + #endregion + + #region Computed Property Tests + + [Fact] + public void ComputedProperty_ExcludedFromAnalysis() + { + // Arrange + var model = new EdmModel(); + var entityType = new EdmEntityType("NS", "Entity"); + entityType.AddKeys(entityType.AddStructuralProperty("Id", EdmPrimitiveTypeKind.Int32, false)); + var computedProp = entityType.AddStructuralProperty("ComputedProp", EdmPrimitiveTypeKind.String, false); + model.AddElement(entityType); + + // Add Computed annotation + var term = CoreVocabularyModel.ComputedTerm; + var annotation = new EdmVocabularyAnnotation(computedProp, term, new EdmBooleanConstant(true)); + model.SetVocabularyAnnotation(annotation); + + // Act - Update operation + var result = RequestBodyRequirementAnalyzer.ShouldRequestBodyBeRequired( + entityType, + isUpdateOperation: true, + model: model); + + // Assert + Assert.False(result); // Computed property excluded, no other properties + } + + #endregion + + #region Complex Type Tests + + [Fact] + public void ComplexTypeWithAllNullableProperties_ReturnsOptional() + { + // Arrange + var complexType = new EdmComplexType("NS", "Address"); + complexType.AddStructuralProperty("Street", EdmPrimitiveTypeKind.String, true); + complexType.AddStructuralProperty("City", EdmPrimitiveTypeKind.String, true); + + // Act + var result = RequestBodyRequirementAnalyzer.ShouldRequestBodyBeRequired( + complexType, + isUpdateOperation: false, + model: null); + + // Assert + Assert.False(result); + } + + [Fact] + public void ComplexTypeWithRequiredProperty_ReturnsRequired() + { + // Arrange + var complexType = new EdmComplexType("NS", "Address"); + complexType.AddStructuralProperty("Street", EdmPrimitiveTypeKind.String, false); // Required + complexType.AddStructuralProperty("City", EdmPrimitiveTypeKind.String, true); + + // Act + var result = RequestBodyRequirementAnalyzer.ShouldRequestBodyBeRequired( + complexType, + isUpdateOperation: false, + model: null); + + // Assert + Assert.True(result); + } + + #endregion + + #region Navigation Property Tests + + [Fact] + public void EntityTypeWithNullableNavigationProperty_ReturnsOptional() + { + // Arrange + var model = new EdmModel(); + var entityType = new EdmEntityType("NS", "Order"); + entityType.AddKeys(entityType.AddStructuralProperty("Id", EdmPrimitiveTypeKind.Int32, false)); + + var customerType = new EdmEntityType("NS", "Customer"); + customerType.AddKeys(customerType.AddStructuralProperty("Id", EdmPrimitiveTypeKind.Int32, false)); + + var navProperty = entityType.AddUnidirectionalNavigation( + new EdmNavigationPropertyInfo + { + Name = "Customer", + Target = customerType, + TargetMultiplicity = EdmMultiplicity.ZeroOrOne + }); + + model.AddElement(entityType); + model.AddElement(customerType); + + // Act - Update operation (excludes key) + var result = RequestBodyRequirementAnalyzer.ShouldRequestBodyBeRequired( + entityType, + isUpdateOperation: true, + model: model); + + // Assert + Assert.False(result); // Navigation property is nullable + } + + [Fact] + public void EntityTypeWithRequiredNavigationProperty_ReturnsRequired() + { + // Arrange + var model = new EdmModel(); + var entityType = new EdmEntityType("NS", "Order"); + entityType.AddKeys(entityType.AddStructuralProperty("Id", EdmPrimitiveTypeKind.Int32, false)); + + var customerType = new EdmEntityType("NS", "Customer"); + customerType.AddKeys(customerType.AddStructuralProperty("Id", EdmPrimitiveTypeKind.Int32, false)); + + var navProperty = entityType.AddUnidirectionalNavigation( + new EdmNavigationPropertyInfo + { + Name = "Customer", + Target = customerType, + TargetMultiplicity = EdmMultiplicity.One // Required + }); + + model.AddElement(entityType); + model.AddElement(customerType); + + // Act - Update operation (excludes key) + var result = RequestBodyRequirementAnalyzer.ShouldRequestBodyBeRequired( + entityType, + isUpdateOperation: true, + model: model); + + // Assert + Assert.True(result); // Navigation property is required + } + + #endregion + + #region Edge Cases + + [Fact] + public void EmptyEntityType_ReturnsOptional() + { + // Arrange - Entity with only key, update operation excludes key + var entityType = new EdmEntityType("NS", "Empty"); + entityType.AddKeys(entityType.AddStructuralProperty("Id", EdmPrimitiveTypeKind.Int32, false)); + + // Act + var result = RequestBodyRequirementAnalyzer.ShouldRequestBodyBeRequired( + entityType, + isUpdateOperation: true, + model: null); + + // Assert + Assert.False(result); // No properties after excluding key + } + + [Fact] + public void NullStructuredType_ReturnsRequired() + { + // Act + var result = RequestBodyRequirementAnalyzer.ShouldRequestBodyBeRequired( + null, + isUpdateOperation: false, + model: null); + + // Assert + Assert.True(result); // Safe default + } + + #endregion + + #region Helper Methods + + private IEdmAction CreateAction(string name, bool isNullable) + { + var model = new EdmModel(); + var action = new EdmAction("NS", name, null); + action.AddParameter("param", EdmCoreModel.Instance.GetString(isNullable)); + model.AddElement(action); + return action; + } + + private IEdmEntityType CreateEntityType(string name, bool hasRequiredProperties) + { + var entityType = new EdmEntityType("NS", name); + // Key is always nullable for this helper (to allow testing all-nullable scenarios) + entityType.AddKeys(entityType.AddStructuralProperty("Id", EdmPrimitiveTypeKind.Int32, true)); + entityType.AddStructuralProperty("Name", EdmPrimitiveTypeKind.String, !hasRequiredProperties); + return entityType; + } + + #endregion + } +} diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Generator/OpenApiRequestBodyGeneratorTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Generator/OpenApiRequestBodyGeneratorTests.cs index 3e2555aa..ffa17aad 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Generator/OpenApiRequestBodyGeneratorTests.cs +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Generator/OpenApiRequestBodyGeneratorTests.cs @@ -120,8 +120,7 @@ public async Task CanSerializeAsJsonFromTheCreatedRequestBody() } } } - }, - ""required"": true + } }"; var actualJsonNode = JsonNode.Parse(json); diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V2.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V2.json index 3547391d..0c4cf15a 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V2.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V2.json @@ -203,7 +203,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "$ref": "#/definitions/DefaultNs.City" } @@ -479,7 +478,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "$ref": "#/definitions/DefaultNs.CountryOrRegion" } diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V2.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V2.yaml index 92d3100d..04c5823f 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V2.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V2.yaml @@ -134,7 +134,6 @@ paths: - in: body name: body description: New property values - required: true schema: $ref: '#/definitions/DefaultNs.City' responses: @@ -313,7 +312,6 @@ paths: - in: body name: body description: New property values - required: true schema: $ref: '#/definitions/DefaultNs.CountryOrRegion' responses: diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V3.1.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V3.1.json index 789386ea..88072ec5 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V3.1.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V3.1.json @@ -224,8 +224,7 @@ "$ref": "#/components/schemas/DefaultNs.City" } } - }, - "required": true + } }, "responses": { "204": { @@ -513,8 +512,7 @@ "$ref": "#/components/schemas/DefaultNs.CountryOrRegion" } } - }, - "required": true + } }, "responses": { "204": { @@ -1458,4 +1456,4 @@ "x-ms-docs-toc-type": "page" } ] -} +} \ No newline at end of file diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V3.1.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V3.1.yaml index c27ab822..ec5a4b0e 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V3.1.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V3.1.yaml @@ -146,7 +146,6 @@ paths: application/json: schema: $ref: '#/components/schemas/DefaultNs.City' - required: true responses: '204': description: Success @@ -332,7 +331,6 @@ paths: application/json: schema: $ref: '#/components/schemas/DefaultNs.CountryOrRegion' - required: true responses: '204': description: Success @@ -947,4 +945,4 @@ tags: - name: Me.Person x-ms-docs-toc-type: page - name: People.Person - x-ms-docs-toc-type: page + x-ms-docs-toc-type: page \ No newline at end of file diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.json index b7a79edc..efade297 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.json @@ -224,8 +224,7 @@ "$ref": "#/components/schemas/DefaultNs.City" } } - }, - "required": true + } }, "responses": { "204": { @@ -513,8 +512,7 @@ "$ref": "#/components/schemas/DefaultNs.CountryOrRegion" } } - }, - "required": true + } }, "responses": { "204": { @@ -984,6 +982,105 @@ }, "components": { "schemas": { + "DefaultNs.ODataErrors.ODataError": { + "required": [ + "error" + ], + "type": "object", + "properties": { + "error": { + "$ref": "#/components/schemas/DefaultNs.ODataErrors.MainError" + } + } + }, + "DefaultNs.ODataErrors.MainError": { + "required": [ + "code", + "message" + ], + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string", + "x-ms-primary-error-message": true + }, + "target": { + "type": "string", + "nullable": true + }, + "details": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DefaultNs.ODataErrors.ErrorDetails" + } + }, + "innerError": { + "$ref": "#/components/schemas/DefaultNs.ODataErrors.InnerError" + } + } + }, + "DefaultNs.ODataErrors.ErrorDetails": { + "required": [ + "code", + "message" + ], + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "target": { + "type": "string", + "nullable": true + } + } + }, + "DefaultNs.ODataErrors.InnerError": { + "type": "object", + "description": "The structure of this object is service-specific" + }, + "ODataCountResponse": { + "type": "number", + "format": "int64" + }, + "ReferenceUpdate": { + "type": "object", + "properties": { + "@odata.id": { + "type": "string" + }, + "@odata.type": { + "type": "string", + "nullable": true + } + } + }, + "ReferenceCreate": { + "type": "object", + "properties": { + "@odata.id": { + "type": "string" + } + }, + "additionalProperties": { + "type": "object" + } + }, + "ReferenceNumeric": { + "enum": [ + "-INF", + "INF", + "NaN" + ], + "type": "string", + "nullable": true + }, "DefaultNs.Color": { "title": "Color", "enum": [ @@ -1098,73 +1195,6 @@ } } }, - "DefaultNs.ODataErrors.ODataError": { - "required": [ - "error" - ], - "type": "object", - "properties": { - "error": { - "$ref": "#/components/schemas/DefaultNs.ODataErrors.MainError" - } - } - }, - "DefaultNs.ODataErrors.MainError": { - "required": [ - "code", - "message" - ], - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string", - "x-ms-primary-error-message": true - }, - "target": { - "type": "string", - "nullable": true - }, - "details": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DefaultNs.ODataErrors.ErrorDetails" - } - }, - "innerError": { - "$ref": "#/components/schemas/DefaultNs.ODataErrors.InnerError" - } - } - }, - "DefaultNs.ODataErrors.ErrorDetails": { - "required": [ - "code", - "message" - ], - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - }, - "target": { - "type": "string", - "nullable": true - } - } - }, - "DefaultNs.ODataErrors.InnerError": { - "type": "object", - "description": "The structure of this object is service-specific" - }, - "ODataCountResponse": { - "type": "number", - "format": "int64" - }, "DefaultNs.PersonCollectionResponse": { "title": "Collection of Person", "type": "object", @@ -1212,38 +1242,6 @@ } } } - }, - "ReferenceUpdate": { - "type": "object", - "properties": { - "@odata.id": { - "type": "string" - }, - "@odata.type": { - "type": "string", - "nullable": true - } - } - }, - "ReferenceCreate": { - "type": "object", - "properties": { - "@odata.id": { - "type": "string" - } - }, - "additionalProperties": { - "type": "object" - } - }, - "ReferenceNumeric": { - "enum": [ - "-INF", - "INF", - "NaN" - ], - "type": "string", - "nullable": true } }, "responses": { @@ -1363,18 +1361,18 @@ "examples": { "DefaultNs.Person": { "value": { - "Addresses": [ - { - "@odata.type": "DefaultNs.Address" - } - ], + "UserName": "string (identifier)", "HomeAddress": { "@odata.type": "DefaultNs.Address" }, - "UserName": "string (identifier)", "WorkAddress": { "@odata.type": "DefaultNs.Address" - } + }, + "Addresses": [ + { + "@odata.type": "DefaultNs.Address" + } + ] } }, "DefaultNs.City": { @@ -1389,21 +1387,21 @@ }, "DefaultNs.Address": { "value": { + "Id": 0, "City": { "@odata.type": "DefaultNs.City" - }, - "Id": 0 + } } }, "DefaultNs.WorkAddress": { "value": { + "Id": 0, "City": { "@odata.type": "DefaultNs.City" }, "CountryOrRegion": { "@odata.type": "DefaultNs.CountryOrRegion" - }, - "Id": 0 + } } } }, diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.yaml index 7f9acd1c..bea2123e 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.yaml @@ -146,7 +146,6 @@ paths: application/json: schema: $ref: '#/components/schemas/DefaultNs.City' - required: true responses: '204': description: Success @@ -332,7 +331,6 @@ paths: application/json: schema: $ref: '#/components/schemas/DefaultNs.CountryOrRegion' - required: true responses: '204': description: Success diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.V3.1.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.V3.1.json index 47a98e4b..e3dae54e 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.V3.1.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.V3.1.json @@ -220,4 +220,4 @@ } } } -} +} \ No newline at end of file diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.V3.1.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.V3.1.yaml index cc0c72f6..c7fa7f59 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.V3.1.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.V3.1.yaml @@ -148,4 +148,4 @@ components: application/json: schema: $ref: '#/components/schemas/ReferenceUpdate' - required: true + required: true \ No newline at end of file diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.json index 892884da..5e5109ba 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.json @@ -144,7 +144,7 @@ "schema": { "minimum": 0, "type": "number", - "format": "int64" + "format": "int64" }, "example": 50 }, diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json index 219c468a..3872430c 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json @@ -1165,7 +1165,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "object", "properties": { @@ -1222,7 +1221,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "array", "items": { @@ -1929,7 +1927,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "object", "properties": { @@ -1997,7 +1994,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "array", "items": { @@ -4240,7 +4236,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "object", "properties": { @@ -4297,7 +4292,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "array", "items": { diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml index 9d2db9e6..f7bd67c6 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml @@ -824,7 +824,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: object properties: @@ -863,7 +862,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: array items: @@ -1363,7 +1361,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: object properties: @@ -1411,7 +1408,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: array items: @@ -3007,7 +3003,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: object properties: @@ -3046,7 +3041,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: array items: diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V3.1.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V3.1.json index 90d241c0..0280db78 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V3.1.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V3.1.json @@ -1237,8 +1237,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -1289,8 +1288,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -2044,8 +2042,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -2109,8 +2106,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -4477,8 +4473,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -4529,8 +4524,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V3.1.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V3.1.yaml index 25cf8723..388da5a8 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V3.1.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V3.1.yaml @@ -865,7 +865,6 @@ paths: type: array items: $ref: '#/components/schemas/Siterra.Documents.App.DTO.DocumentTagRelDto' - required: true responses: '204': description: Success @@ -900,7 +899,6 @@ paths: type: array items: $ref: '#/components/schemas/Siterra.Documents.App.DTO.DocumentTagRelDto' - required: true responses: '204': description: Success @@ -1428,7 +1426,6 @@ paths: type: array items: $ref: '#/components/schemas/Siterra.Documents.App.DTO.DocumentTagRelDto' - required: true responses: '204': description: Success @@ -1473,7 +1470,6 @@ paths: type: array items: $ref: '#/components/schemas/Siterra.Documents.App.DTO.DocumentTagRelDto' - required: true responses: '204': description: Success @@ -3139,7 +3135,6 @@ paths: type: array items: $ref: '#/components/schemas/Siterra.Documents.App.DTO.DocumentTagRelDto' - required: true responses: '204': description: Success @@ -3174,7 +3169,6 @@ paths: type: array items: $ref: '#/components/schemas/Siterra.Documents.App.DTO.DocumentTagRelDto' - required: true responses: '204': description: Success diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json index 6963fb45..100f7dc2 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json @@ -1237,8 +1237,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -1289,8 +1288,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -2044,8 +2042,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -2109,8 +2106,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -4477,8 +4473,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -4529,8 +4524,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml index 3d5b1135..b6da54bd 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml @@ -865,7 +865,6 @@ paths: type: array items: $ref: '#/components/schemas/Siterra.Documents.App.DTO.DocumentTagRelDto' - required: true responses: '204': description: Success @@ -900,7 +899,6 @@ paths: type: array items: $ref: '#/components/schemas/Siterra.Documents.App.DTO.DocumentTagRelDto' - required: true responses: '204': description: Success @@ -1428,7 +1426,6 @@ paths: type: array items: $ref: '#/components/schemas/Siterra.Documents.App.DTO.DocumentTagRelDto' - required: true responses: '204': description: Success @@ -1473,7 +1470,6 @@ paths: type: array items: $ref: '#/components/schemas/Siterra.Documents.App.DTO.DocumentTagRelDto' - required: true responses: '204': description: Success @@ -3139,7 +3135,6 @@ paths: type: array items: $ref: '#/components/schemas/Siterra.Documents.App.DTO.DocumentTagRelDto' - required: true responses: '204': description: Success @@ -3174,7 +3169,6 @@ paths: type: array items: $ref: '#/components/schemas/Siterra.Documents.App.DTO.DocumentTagRelDto' - required: true responses: '204': description: Success diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json index c0300709..91b3fef3 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json @@ -188,7 +188,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Airline" } @@ -448,7 +447,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Airport" } @@ -576,7 +574,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.AirportLocation" } @@ -848,7 +845,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "object", "properties": { @@ -902,7 +898,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "array", "items": { @@ -1103,7 +1098,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } @@ -1541,7 +1535,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "object", "properties": { @@ -1594,7 +1587,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "array", "items": { @@ -2009,7 +2001,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "object", "properties": { @@ -2062,7 +2053,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "array", "items": { @@ -2256,7 +2246,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } @@ -2756,7 +2745,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "object", "properties": { @@ -2817,7 +2805,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "array", "items": { @@ -3053,7 +3040,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } @@ -3915,7 +3901,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } @@ -4107,7 +4092,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "object", "properties": { @@ -4160,7 +4144,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "array", "items": { @@ -4575,7 +4558,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "object", "properties": { @@ -4628,7 +4610,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "array", "items": { @@ -4822,7 +4803,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } @@ -5271,7 +5251,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "object", "properties": { @@ -5332,7 +5311,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "array", "items": { @@ -5568,7 +5546,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } @@ -6226,7 +6203,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } @@ -6501,7 +6477,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "object", "properties": { @@ -6562,7 +6537,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "array", "items": { @@ -6798,7 +6772,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } @@ -8272,7 +8245,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "object", "properties": { @@ -8325,7 +8297,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "array", "items": { @@ -8740,7 +8711,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "object", "properties": { @@ -8793,7 +8763,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "array", "items": { @@ -8987,7 +8956,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } @@ -9419,7 +9387,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "object", "properties": { @@ -9480,7 +9447,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "array", "items": { @@ -9716,7 +9682,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } @@ -10317,7 +10282,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "object", "properties": { @@ -10378,7 +10342,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "array", "items": { @@ -10614,7 +10577,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } @@ -11272,7 +11234,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } @@ -11345,7 +11306,6 @@ "in": "body", "name": "body", "description": "Action parameters", - "required": true, "schema": { "type": "object", "properties": { @@ -13537,7 +13497,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "object", "properties": { @@ -13591,7 +13550,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "array", "items": { @@ -14058,7 +14016,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "object", "properties": { @@ -14119,7 +14076,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "array", "items": { @@ -14355,7 +14311,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } @@ -14914,7 +14869,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "object", "properties": { @@ -14976,7 +14930,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "array", "items": { @@ -15217,7 +15170,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } @@ -16095,7 +16047,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } @@ -16330,7 +16281,6 @@ "in": "body", "name": "body", "description": "Action parameters", - "required": true, "schema": { "type": "object", "properties": { @@ -17788,7 +17738,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "object", "properties": { @@ -17849,7 +17798,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "array", "items": { @@ -18348,7 +18296,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "object", "properties": { @@ -18409,7 +18356,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "array", "items": { @@ -18645,7 +18591,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } @@ -19243,7 +19188,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "object", "properties": { @@ -19312,7 +19256,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "array", "items": { @@ -19588,7 +19531,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } @@ -20593,7 +20535,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } @@ -20831,7 +20772,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "object", "properties": { @@ -20892,7 +20832,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "array", "items": { @@ -21391,7 +21330,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "object", "properties": { @@ -21452,7 +21390,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "array", "items": { @@ -21688,7 +21625,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } @@ -22213,7 +22149,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "object", "properties": { @@ -22282,7 +22217,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "array", "items": { @@ -22558,7 +22492,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } @@ -23320,7 +23253,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } @@ -23637,7 +23569,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "object", "properties": { @@ -23706,7 +23637,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "array", "items": { @@ -23982,7 +23912,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } @@ -25686,7 +25615,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "object", "properties": { @@ -25747,7 +25675,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "array", "items": { @@ -26246,7 +26173,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "object", "properties": { @@ -26307,7 +26233,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "array", "items": { @@ -26543,7 +26468,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } @@ -27051,7 +26975,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "object", "properties": { @@ -27120,7 +27043,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "array", "items": { @@ -27396,7 +27318,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } @@ -28093,7 +28014,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "object", "properties": { @@ -28162,7 +28082,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "type": "array", "items": { @@ -28438,7 +28357,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } @@ -29200,7 +29118,6 @@ "in": "body", "name": "body", "description": "New property values", - "required": true, "schema": { "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } @@ -29291,7 +29208,6 @@ "in": "body", "name": "body", "description": "Action parameters", - "required": true, "schema": { "type": "object", "properties": { diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml index 4f77842d..4cbb3137 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml @@ -124,7 +124,6 @@ paths: - in: body name: body description: New property values - required: true schema: $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Airline' responses: @@ -292,7 +291,6 @@ paths: - in: body name: body description: New property values - required: true schema: $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Airport' responses: @@ -379,7 +377,6 @@ paths: - in: body name: body description: New property values - required: true schema: $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.AirportLocation' responses: @@ -558,7 +555,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: object properties: @@ -594,7 +590,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: array items: @@ -726,7 +721,6 @@ paths: - in: body name: body description: New property values - required: true schema: $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: @@ -1018,7 +1012,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: object properties: @@ -1054,7 +1047,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: array items: @@ -1335,7 +1327,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: object properties: @@ -1371,7 +1362,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: array items: @@ -1502,7 +1492,6 @@ paths: - in: body name: body description: New property values - required: true schema: $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: @@ -1840,7 +1829,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: object properties: @@ -1882,7 +1870,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: array items: @@ -2044,7 +2031,6 @@ paths: - in: body name: body description: New property values - required: true schema: $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: @@ -2620,7 +2606,6 @@ paths: - in: body name: body description: New property values - required: true schema: $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: @@ -2747,7 +2732,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: object properties: @@ -2783,7 +2767,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: array items: @@ -3064,7 +3047,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: object properties: @@ -3100,7 +3082,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: array items: @@ -3231,7 +3212,6 @@ paths: - in: body name: body description: New property values - required: true schema: $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: @@ -3534,7 +3514,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: object properties: @@ -3576,7 +3555,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: array items: @@ -3738,7 +3716,6 @@ paths: - in: body name: body description: New property values - required: true schema: $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: @@ -4181,7 +4158,6 @@ paths: - in: body name: body description: New property values - required: true schema: $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: @@ -4362,7 +4338,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: object properties: @@ -4404,7 +4379,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: array items: @@ -4566,7 +4540,6 @@ paths: - in: body name: body description: New property values - required: true schema: $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: @@ -5566,7 +5539,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: object properties: @@ -5602,7 +5574,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: array items: @@ -5883,7 +5854,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: object properties: @@ -5919,7 +5889,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: array items: @@ -6050,7 +6019,6 @@ paths: - in: body name: body description: New property values - required: true schema: $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: @@ -6341,7 +6309,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: object properties: @@ -6383,7 +6350,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: array items: @@ -6545,7 +6511,6 @@ paths: - in: body name: body description: New property values - required: true schema: $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: @@ -6948,7 +6913,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: object properties: @@ -6990,7 +6954,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: array items: @@ -7152,7 +7115,6 @@ paths: - in: body name: body description: New property values - required: true schema: $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: @@ -7595,7 +7557,6 @@ paths: - in: body name: body description: New property values - required: true schema: $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: @@ -7646,7 +7607,6 @@ paths: - in: body name: body description: Action parameters - required: true schema: type: object properties: @@ -9139,7 +9099,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: object properties: @@ -9175,7 +9134,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: array items: @@ -9491,7 +9449,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: object properties: @@ -9533,7 +9490,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: array items: @@ -9695,7 +9651,6 @@ paths: - in: body name: body description: New property values - required: true schema: $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: @@ -10074,7 +10029,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: object properties: @@ -10116,7 +10070,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: array items: @@ -10278,7 +10231,6 @@ paths: - in: body name: body description: New property values - required: true schema: $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: @@ -10854,7 +10806,6 @@ paths: - in: body name: body description: New property values - required: true schema: $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: @@ -11009,7 +10960,6 @@ paths: - in: body name: body description: Action parameters - required: true schema: type: object properties: @@ -11988,7 +11938,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: object properties: @@ -12030,7 +11979,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: array items: @@ -12373,7 +12321,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: object properties: @@ -12415,7 +12362,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: array items: @@ -12577,7 +12523,6 @@ paths: - in: body name: body description: New property values - required: true schema: $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: @@ -12988,7 +12933,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: object properties: @@ -13036,7 +12980,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: array items: @@ -13228,7 +13171,6 @@ paths: - in: body name: body description: New property values - required: true schema: $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: @@ -13912,7 +13854,6 @@ paths: - in: body name: body description: New property values - required: true schema: $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: @@ -14072,7 +14013,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: object properties: @@ -14114,7 +14054,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: array items: @@ -14457,7 +14396,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: object properties: @@ -14499,7 +14437,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: array items: @@ -14661,7 +14598,6 @@ paths: - in: body name: body description: New property values - required: true schema: $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: @@ -15020,7 +14956,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: object properties: @@ -15068,7 +15003,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: array items: @@ -15260,7 +15194,6 @@ paths: - in: body name: body description: New property values - required: true schema: $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: @@ -15781,7 +15714,6 @@ paths: - in: body name: body description: New property values - required: true schema: $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: @@ -15993,7 +15925,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: object properties: @@ -16041,7 +15972,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: array items: @@ -16233,7 +16163,6 @@ paths: - in: body name: body description: New property values - required: true schema: $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: @@ -17404,7 +17333,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: object properties: @@ -17446,7 +17374,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: array items: @@ -17789,7 +17716,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: object properties: @@ -17831,7 +17757,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: array items: @@ -17993,7 +17918,6 @@ paths: - in: body name: body description: New property values - required: true schema: $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: @@ -18340,7 +18264,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: object properties: @@ -18388,7 +18311,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: array items: @@ -18580,7 +18502,6 @@ paths: - in: body name: body description: New property values - required: true schema: $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: @@ -19055,7 +18976,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: object properties: @@ -19103,7 +19023,6 @@ paths: - in: body name: body description: New property values - required: true schema: type: array items: @@ -19295,7 +19214,6 @@ paths: - in: body name: body description: New property values - required: true schema: $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: @@ -19816,7 +19734,6 @@ paths: - in: body name: body description: New property values - required: true schema: $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: @@ -19880,7 +19797,6 @@ paths: - in: body name: body description: Action parameters - required: true schema: type: object properties: diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V3.1.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V3.1.json index 1df6da05..2400ea8f 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V3.1.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V3.1.json @@ -208,8 +208,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Airline" } } - }, - "required": true + } }, "responses": { "204": { @@ -481,8 +480,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Airport" } } - }, - "required": true + } }, "responses": { "204": { @@ -618,8 +616,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.AirportLocation" } } - }, - "required": true + } }, "responses": { "204": { @@ -918,8 +915,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -967,8 +963,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -1173,8 +1168,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -1677,8 +1671,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -1723,8 +1716,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -2134,8 +2126,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -2180,8 +2171,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -2367,8 +2357,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -2908,8 +2897,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -2964,8 +2952,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -3205,8 +3192,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -4112,8 +4098,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -4325,8 +4310,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -4371,8 +4355,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -4782,8 +4765,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -4828,8 +4810,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -5015,8 +4996,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -5496,8 +5476,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -5552,8 +5531,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -5793,8 +5771,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -6474,8 +6451,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -6777,8 +6753,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -6833,8 +6808,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -7074,8 +7048,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -8609,8 +8582,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -8655,8 +8627,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -9066,8 +9037,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -9112,8 +9082,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -9299,8 +9268,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -9761,8 +9729,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -9817,8 +9784,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -10058,8 +10024,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -10682,8 +10647,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -10738,8 +10702,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -10979,8 +10942,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -11660,8 +11622,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -11741,8 +11702,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -14039,8 +13999,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -14088,8 +14047,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -14577,8 +14535,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -14633,8 +14590,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -14874,8 +14830,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -15496,8 +15451,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -15555,8 +15509,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -15811,8 +15764,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -16770,8 +16722,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -17027,8 +16978,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -18586,8 +18536,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -18642,8 +18591,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -19163,8 +19111,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -19219,8 +19166,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -19460,8 +19406,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -20121,8 +20066,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -20187,8 +20131,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -20478,8 +20421,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -21564,8 +21506,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -21835,8 +21776,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -21891,8 +21831,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -22412,8 +22351,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -22468,8 +22406,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -22709,8 +22646,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -23286,8 +23222,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -23352,8 +23287,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -23643,8 +23577,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -24458,8 +24391,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -24813,8 +24745,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -24879,8 +24810,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -25170,8 +25100,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -26999,8 +26928,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -27055,8 +26983,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -27576,8 +27503,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -27632,8 +27558,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -27873,8 +27798,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -28431,8 +28355,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -28497,8 +28420,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -28788,8 +28710,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -29534,8 +29455,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -29600,8 +29520,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -29891,8 +29810,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -30706,8 +30624,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -30811,8 +30728,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V3.1.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V3.1.yaml index 3f4fd531..805a0b42 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V3.1.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V3.1.yaml @@ -135,7 +135,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Airline' - required: true responses: '204': description: Success @@ -310,7 +309,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Airport' - required: true responses: '204': description: Success @@ -401,7 +399,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.AirportLocation' - required: true responses: '204': description: Success @@ -597,7 +594,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -629,7 +625,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -761,7 +756,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -1079,7 +1073,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -1110,7 +1103,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -1388,7 +1380,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -1419,7 +1410,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -1544,7 +1534,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -1907,7 +1896,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -1945,7 +1933,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -2107,7 +2094,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -2708,7 +2694,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -2849,7 +2834,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -2880,7 +2864,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -3158,7 +3141,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -3189,7 +3171,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -3314,7 +3295,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -3636,7 +3616,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -3674,7 +3653,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -3836,7 +3814,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -4290,7 +4267,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -4489,7 +4465,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -4527,7 +4502,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -4689,7 +4663,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -5726,7 +5699,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -5757,7 +5729,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -6035,7 +6006,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -6066,7 +6036,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -6191,7 +6160,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -6500,7 +6468,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -6538,7 +6505,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -6700,7 +6666,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -7115,7 +7080,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -7153,7 +7117,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -7315,7 +7278,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -7769,7 +7731,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -7822,7 +7783,6 @@ paths: anyOf: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person' - type: 'null' - required: true responses: '204': description: Success @@ -9377,7 +9337,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -9409,7 +9368,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -9735,7 +9693,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -9773,7 +9730,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -9935,7 +9891,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -10350,7 +10305,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -10389,7 +10343,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -10556,7 +10509,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -11175,7 +11127,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -11341,7 +11292,6 @@ paths: anyOf: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person' - type: 'null' - required: true responses: '204': description: Success @@ -12374,7 +12324,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -12412,7 +12361,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -12765,7 +12713,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -12803,7 +12750,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -12965,7 +12911,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -13412,7 +13357,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -13457,7 +13401,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -13654,7 +13597,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -14381,7 +14323,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -14561,7 +14502,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -14599,7 +14539,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -14952,7 +14891,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -14990,7 +14928,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -15152,7 +15089,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -15540,7 +15476,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -15585,7 +15520,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -15782,7 +15716,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -16329,7 +16262,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -16564,7 +16496,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -16609,7 +16540,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -16806,7 +16736,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -18046,7 +17975,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -18084,7 +18012,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -18437,7 +18364,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -18475,7 +18401,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -18637,7 +18562,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -19012,7 +18936,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -19057,7 +18980,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -19254,7 +19176,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -19754,7 +19675,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -19799,7 +19719,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -19996,7 +19915,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -20543,7 +20461,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -20612,7 +20529,6 @@ paths: anyOf: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person' - type: 'null' - required: true responses: '204': description: Success diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json index 02544ed6..828daac9 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json @@ -208,8 +208,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Airline" } } - }, - "required": true + } }, "responses": { "204": { @@ -481,8 +480,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Airport" } } - }, - "required": true + } }, "responses": { "204": { @@ -618,8 +616,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.AirportLocation" } } - }, - "required": true + } }, "responses": { "204": { @@ -918,8 +915,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -967,8 +963,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -1173,8 +1168,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -1667,8 +1661,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -1713,8 +1706,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -2124,8 +2116,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -2170,8 +2161,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -2357,8 +2347,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -2898,8 +2887,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -2954,8 +2942,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -3195,8 +3182,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -4102,8 +4088,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -4315,8 +4300,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -4361,8 +4345,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -4772,8 +4755,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -4818,8 +4800,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -5005,8 +4986,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -5486,8 +5466,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -5542,8 +5521,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -5783,8 +5761,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -6464,8 +6441,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -6767,8 +6743,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -6823,8 +6798,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -7064,8 +7038,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -8599,8 +8572,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -8645,8 +8617,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -9056,8 +9027,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -9102,8 +9072,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -9289,8 +9258,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -9751,8 +9719,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -9807,8 +9774,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -10048,8 +10014,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -10672,8 +10637,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -10728,8 +10692,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -10969,8 +10932,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -11650,8 +11612,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -11730,8 +11691,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -14028,8 +13988,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -14077,8 +14036,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -14566,8 +14524,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -14622,8 +14579,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -14863,8 +14819,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -15485,8 +15440,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -15544,8 +15498,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -15800,8 +15753,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -16759,8 +16711,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -17015,8 +16966,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -18574,8 +18524,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -18630,8 +18579,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -19151,8 +19099,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -19207,8 +19154,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -19448,8 +19394,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -20109,8 +20054,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -20175,8 +20119,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -20466,8 +20409,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -21552,8 +21494,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -21823,8 +21764,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -21879,8 +21819,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -22400,8 +22339,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -22456,8 +22394,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -22697,8 +22634,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -23274,8 +23210,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -23340,8 +23275,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -23631,8 +23565,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -24446,8 +24379,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -24801,8 +24733,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -24867,8 +24798,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -25158,8 +25088,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -26987,8 +26916,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -27043,8 +26971,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -27564,8 +27491,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -27620,8 +27546,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -27861,8 +27786,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -28419,8 +28343,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -28485,8 +28408,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -28776,8 +28698,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -29522,8 +29443,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -29588,8 +29508,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { @@ -29879,8 +29798,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -30694,8 +30612,7 @@ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" } } - }, - "required": true + } }, "responses": { "204": { @@ -30798,8 +30715,7 @@ } } } - }, - "required": true + } }, "responses": { "204": { diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml index ab75ef59..19ef166e 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml @@ -135,7 +135,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Airline' - required: true responses: '204': description: Success @@ -310,7 +309,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Airport' - required: true responses: '204': description: Success @@ -401,7 +399,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.AirportLocation' - required: true responses: '204': description: Success @@ -597,7 +594,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -629,7 +625,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -761,7 +756,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -1077,7 +1071,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -1108,7 +1101,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -1386,7 +1378,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -1417,7 +1408,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -1542,7 +1532,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -1905,7 +1894,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -1943,7 +1931,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -2105,7 +2092,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -2706,7 +2692,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -2847,7 +2832,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -2878,7 +2862,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -3156,7 +3139,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -3187,7 +3169,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -3312,7 +3293,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -3634,7 +3614,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -3672,7 +3651,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -3834,7 +3812,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -4288,7 +4265,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -4487,7 +4463,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -4525,7 +4500,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -4687,7 +4661,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -5724,7 +5697,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -5755,7 +5727,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -6033,7 +6004,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -6064,7 +6034,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -6189,7 +6158,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -6498,7 +6466,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -6536,7 +6503,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -6698,7 +6664,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -7113,7 +7078,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -7151,7 +7115,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -7313,7 +7276,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -7767,7 +7729,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -7821,7 +7782,6 @@ paths: anyOf: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person' nullable: true - required: true responses: '204': description: Success @@ -9376,7 +9336,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -9408,7 +9367,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -9734,7 +9692,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -9772,7 +9729,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -9934,7 +9890,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -10349,7 +10304,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -10388,7 +10342,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -10555,7 +10508,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -11174,7 +11126,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -11341,7 +11292,6 @@ paths: anyOf: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person' nullable: true - required: true responses: '204': description: Success @@ -12374,7 +12324,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -12412,7 +12361,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -12765,7 +12713,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -12803,7 +12750,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -12965,7 +12911,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -13412,7 +13357,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -13457,7 +13401,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -13654,7 +13597,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -14381,7 +14323,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -14561,7 +14502,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -14599,7 +14539,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -14952,7 +14891,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -14990,7 +14928,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -15152,7 +15089,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -15540,7 +15476,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -15585,7 +15520,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -15782,7 +15716,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -16329,7 +16262,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -16564,7 +16496,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -16609,7 +16540,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -16806,7 +16736,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -18046,7 +17975,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -18084,7 +18012,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -18437,7 +18364,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -18475,7 +18401,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -18637,7 +18562,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -19012,7 +18936,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -19057,7 +18980,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -19254,7 +19176,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -19754,7 +19675,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -19799,7 +19719,6 @@ paths: type: array items: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -19996,7 +19915,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -20543,7 +20461,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' - required: true responses: '204': description: Success @@ -20613,7 +20530,6 @@ paths: anyOf: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person' nullable: true - required: true responses: '204': description: Success