From 9e8d8a4f46a6ae79d8bb53e18ff6e9d159388893 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Thu, 24 Oct 2024 13:18:56 -0400 Subject: [PATCH] feat: bumps target OAS version to 3.1.1 fix: additional 3.1.0 constants after merge and v2 release --- src/Microsoft.OpenApi.Workbench/MainWindow.xaml | 2 +- src/Microsoft.OpenApi/Models/OpenApiDocument.cs | 2 +- ...entTests.ParseDocumentWith31PropertiesWorks.verified.txt | 2 +- .../V31Tests/Samples/OpenApiDocument/docWithExample.yaml | 2 +- .../OpenApiDocument/docWithPatternPropertiesInSchema.yaml | 2 +- .../Samples/OpenApiDocument/docWithReferenceById.yaml | 2 +- .../Samples/OpenApiDocument/documentWith31Properties.yaml | 2 +- .../Samples/OpenApiDocument/documentWithReusablePaths.yaml | 2 +- .../documentWithSummaryAndDescriptionInReference.yaml | 2 +- .../Samples/OpenApiDocument/documentWithWebhooks.yaml | 2 +- .../V31Tests/Samples/OpenApiDocument/externalRefById.yaml | 2 +- .../Samples/OpenApiDocument/externalRefByJsonPointer.yaml | 2 +- .../V31Tests/Samples/OpenApiDocument/externalResource.yaml | 2 +- ...hooksAsV3JsonWorks_produceTerseOutput=False.verified.txt | 2 +- ...bhooksAsV3JsonWorks_produceTerseOutput=True.verified.txt | 2 +- test/Microsoft.OpenApi.Tests/Models/OpenApiDocumentTests.cs | 6 +++--- .../Models/References/OpenApiPathItemReferenceTests.cs | 4 ++-- .../Models/Samples/docWithDollarId.yaml | 2 +- .../Models/Samples/docWithReusableWebhooks.yaml | 2 +- 19 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/Microsoft.OpenApi.Workbench/MainWindow.xaml b/src/Microsoft.OpenApi.Workbench/MainWindow.xaml index 04a42c1c3..a70295946 100644 --- a/src/Microsoft.OpenApi.Workbench/MainWindow.xaml +++ b/src/Microsoft.OpenApi.Workbench/MainWindow.xaml @@ -40,7 +40,7 @@ - + diff --git a/src/Microsoft.OpenApi/Models/OpenApiDocument.cs b/src/Microsoft.OpenApi/Models/OpenApiDocument.cs index 98979a54b..0261fcff9 100644 --- a/src/Microsoft.OpenApi/Models/OpenApiDocument.cs +++ b/src/Microsoft.OpenApi/Models/OpenApiDocument.cs @@ -138,7 +138,7 @@ public void SerializeAsV31(IOpenApiWriter writer) writer.WriteStartObject(); // openApi; - writer.WriteProperty(OpenApiConstants.OpenApi, "3.1.0"); + writer.WriteProperty(OpenApiConstants.OpenApi, "3.1.1"); // jsonSchemaDialect writer.WriteProperty(OpenApiConstants.JsonSchemaDialect, JsonSchemaDialect); diff --git a/test/Microsoft.OpenApi.Readers.Tests/V31Tests/OpenApiDocumentTests.ParseDocumentWith31PropertiesWorks.verified.txt b/test/Microsoft.OpenApi.Readers.Tests/V31Tests/OpenApiDocumentTests.ParseDocumentWith31PropertiesWorks.verified.txt index 6c2f850fe..3392a4bb8 100644 --- a/test/Microsoft.OpenApi.Readers.Tests/V31Tests/OpenApiDocumentTests.ParseDocumentWith31PropertiesWorks.verified.txt +++ b/test/Microsoft.OpenApi.Readers.Tests/V31Tests/OpenApiDocumentTests.ParseDocumentWith31PropertiesWorks.verified.txt @@ -1,4 +1,4 @@ -openapi: '3.1.0' +openapi: '3.1.1' jsonSchemaDialect: https://json-schema.org/draft/2020-12/schema info: title: Sample OpenAPI 3.1 API diff --git a/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/docWithExample.yaml b/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/docWithExample.yaml index 44ede6301..f2a5dae79 100644 --- a/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/docWithExample.yaml +++ b/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/docWithExample.yaml @@ -1,4 +1,4 @@ -openapi: 3.1.0 # The version of the OpenAPI Specification +openapi: 3.1.1 # The version of the OpenAPI Specification info: # Metadata about the API title: A simple OpenAPI 3.1 example version: 1.0.0 diff --git a/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/docWithPatternPropertiesInSchema.yaml b/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/docWithPatternPropertiesInSchema.yaml index 4ea2407d7..bc70bb95e 100644 --- a/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/docWithPatternPropertiesInSchema.yaml +++ b/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/docWithPatternPropertiesInSchema.yaml @@ -1,4 +1,4 @@ -openapi: 3.1.0 +openapi: 3.1.1 info: title: Example API version: 1.0.0 diff --git a/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/docWithReferenceById.yaml b/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/docWithReferenceById.yaml index d6c0121e4..b02ce3e57 100644 --- a/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/docWithReferenceById.yaml +++ b/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/docWithReferenceById.yaml @@ -1,4 +1,4 @@ -openapi: 3.1.0 +openapi: 3.1.1 info: title: ReferenceById version: 1.0.0 diff --git a/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/documentWith31Properties.yaml b/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/documentWith31Properties.yaml index 41817174e..35e5ccf80 100644 --- a/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/documentWith31Properties.yaml +++ b/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/documentWith31Properties.yaml @@ -1,4 +1,4 @@ -openapi: 3.1.0 +openapi: 3.1.1 info: title: Sample OpenAPI 3.1 API description: A sample API demonstrating OpenAPI 3.1 features diff --git a/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/documentWithReusablePaths.yaml b/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/documentWithReusablePaths.yaml index 28fa04b19..2ce75167e 100644 --- a/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/documentWithReusablePaths.yaml +++ b/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/documentWithReusablePaths.yaml @@ -1,4 +1,4 @@ -openapi : 3.1.0 +openapi : 3.1.1 info: title: Webhook Example version: 1.0.0 diff --git a/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/documentWithSummaryAndDescriptionInReference.yaml b/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/documentWithSummaryAndDescriptionInReference.yaml index bfa7ab627..d789b48e9 100644 --- a/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/documentWithSummaryAndDescriptionInReference.yaml +++ b/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/documentWithSummaryAndDescriptionInReference.yaml @@ -1,4 +1,4 @@ -openapi: '3.1.0' +openapi: '3.1.1' info: version: '1.0.0' title: Swagger Petstore (Simple) diff --git a/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/documentWithWebhooks.yaml b/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/documentWithWebhooks.yaml index aeadc3d69..5b535a55e 100644 --- a/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/documentWithWebhooks.yaml +++ b/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/documentWithWebhooks.yaml @@ -1,4 +1,4 @@ -openapi: 3.1.0 +openapi: 3.1.1 info: title: Webhook Example version: 1.0.0 diff --git a/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/externalRefById.yaml b/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/externalRefById.yaml index bb3755180..35eece7f8 100644 --- a/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/externalRefById.yaml +++ b/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/externalRefById.yaml @@ -1,4 +1,4 @@ -openapi: 3.1.0 +openapi: 3.1.1 info: title: ReferenceById version: 1.0.0 diff --git a/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/externalRefByJsonPointer.yaml b/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/externalRefByJsonPointer.yaml index 913b20e7c..0903bc27b 100644 --- a/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/externalRefByJsonPointer.yaml +++ b/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/externalRefByJsonPointer.yaml @@ -1,4 +1,4 @@ -openapi: 3.1.0 +openapi: 3.1.1 info: title: ReferenceById version: 1.0.0 diff --git a/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/externalResource.yaml b/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/externalResource.yaml index 78d6c0851..19bb025d0 100644 --- a/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/externalResource.yaml +++ b/test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/externalResource.yaml @@ -1,4 +1,4 @@ -openapi: 3.1.0 +openapi: 3.1.1 info: title: ReferencedById version: 1.0.0 diff --git a/test/Microsoft.OpenApi.Tests/Models/OpenApiDocumentTests.SerializeDocumentWithWebhooksAsV3JsonWorks_produceTerseOutput=False.verified.txt b/test/Microsoft.OpenApi.Tests/Models/OpenApiDocumentTests.SerializeDocumentWithWebhooksAsV3JsonWorks_produceTerseOutput=False.verified.txt index 4eebd3082..417f9cbea 100644 --- a/test/Microsoft.OpenApi.Tests/Models/OpenApiDocumentTests.SerializeDocumentWithWebhooksAsV3JsonWorks_produceTerseOutput=False.verified.txt +++ b/test/Microsoft.OpenApi.Tests/Models/OpenApiDocumentTests.SerializeDocumentWithWebhooksAsV3JsonWorks_produceTerseOutput=False.verified.txt @@ -1,5 +1,5 @@ { - "openapi": "3.1.0", + "openapi": "3.1.1", "info": { "title": "Webhook Example", "version": "1.0.0" diff --git a/test/Microsoft.OpenApi.Tests/Models/OpenApiDocumentTests.SerializeDocumentWithWebhooksAsV3JsonWorks_produceTerseOutput=True.verified.txt b/test/Microsoft.OpenApi.Tests/Models/OpenApiDocumentTests.SerializeDocumentWithWebhooksAsV3JsonWorks_produceTerseOutput=True.verified.txt index d105617d2..5c0c4058d 100644 --- a/test/Microsoft.OpenApi.Tests/Models/OpenApiDocumentTests.SerializeDocumentWithWebhooksAsV3JsonWorks_produceTerseOutput=True.verified.txt +++ b/test/Microsoft.OpenApi.Tests/Models/OpenApiDocumentTests.SerializeDocumentWithWebhooksAsV3JsonWorks_produceTerseOutput=True.verified.txt @@ -1 +1 @@ -{"openapi":"3.1.0","info":{"title":"Webhook Example","version":"1.0.0"},"paths":{},"components":{"schemas":{"Pet":{"required":["id","name"],"properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"tag":{"type":"string"}}}}},"webhooks":{"newPet":{"post":{"requestBody":{"description":"Information about a new pet in the system","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pet"}}}},"responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}}}} \ No newline at end of file +{"openapi":"3.1.1","info":{"title":"Webhook Example","version":"1.0.0"},"paths":{},"components":{"schemas":{"Pet":{"required":["id","name"],"properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"tag":{"type":"string"}}}}},"webhooks":{"newPet":{"post":{"requestBody":{"description":"Information about a new pet in the system","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pet"}}}},"responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}}}} \ No newline at end of file diff --git a/test/Microsoft.OpenApi.Tests/Models/OpenApiDocumentTests.cs b/test/Microsoft.OpenApi.Tests/Models/OpenApiDocumentTests.cs index 32d5c1aaf..884ffa68c 100644 --- a/test/Microsoft.OpenApi.Tests/Models/OpenApiDocumentTests.cs +++ b/test/Microsoft.OpenApi.Tests/Models/OpenApiDocumentTests.cs @@ -1929,7 +1929,7 @@ public async Task SerializeDocumentWithWebhooksAsV3JsonWorks(bool produceTerseOu public void SerializeDocumentWithWebhooksAsV3YamlWorks() { // Arrange - var expected = @"openapi: '3.1.0' + var expected = @"openapi: '3.1.1' info: title: Webhook Example version: 1.0.0 @@ -1984,7 +1984,7 @@ public void SerializeDocumentWithRootJsonSchemaDialectPropertyWorks() JsonSchemaDialect = "http://json-schema.org/draft-07/schema#" }; - var expected = @"openapi: '3.1.0' + var expected = @"openapi: '3.1.1' jsonSchemaDialect: http://json-schema.org/draft-07/schema# info: title: JsonSchemaDialectTest @@ -2027,7 +2027,7 @@ public void SerializeV31DocumentWithRefsInWebhooksWorks() [Fact] public void SerializeDocWithDollarIdInDollarRefSucceeds() { - var expected = @"openapi: '3.1.0' + var expected = @"openapi: '3.1.1' info: title: Simple API version: 1.0.0 diff --git a/test/Microsoft.OpenApi.Tests/Models/References/OpenApiPathItemReferenceTests.cs b/test/Microsoft.OpenApi.Tests/Models/References/OpenApiPathItemReferenceTests.cs index 2d7354f78..a2d9b525d 100644 --- a/test/Microsoft.OpenApi.Tests/Models/References/OpenApiPathItemReferenceTests.cs +++ b/test/Microsoft.OpenApi.Tests/Models/References/OpenApiPathItemReferenceTests.cs @@ -20,7 +20,7 @@ namespace Microsoft.OpenApi.Tests.Models.References public class OpenApiPathItemReferenceTests { private const string OpenApi = @" -openapi: 3.1.0 +openapi: 3.1.1 info: title: Sample API version: 1.0.0 @@ -41,7 +41,7 @@ public class OpenApiPathItemReferenceTests "; private const string OpenApi_2 = @" -openapi: 3.1.0 +openapi: 3.1.1 info: title: Sample API version: 1.0.0 diff --git a/test/Microsoft.OpenApi.Tests/Models/Samples/docWithDollarId.yaml b/test/Microsoft.OpenApi.Tests/Models/Samples/docWithDollarId.yaml index e8916f895..8ac0816fa 100644 --- a/test/Microsoft.OpenApi.Tests/Models/Samples/docWithDollarId.yaml +++ b/test/Microsoft.OpenApi.Tests/Models/Samples/docWithDollarId.yaml @@ -1,4 +1,4 @@ -openapi: 3.1.0 +openapi: 3.1.1 info: title: Simple API version: 1.0.0 diff --git a/test/Microsoft.OpenApi.Tests/Models/Samples/docWithReusableWebhooks.yaml b/test/Microsoft.OpenApi.Tests/Models/Samples/docWithReusableWebhooks.yaml index 6d3af550e..844c9caf0 100644 --- a/test/Microsoft.OpenApi.Tests/Models/Samples/docWithReusableWebhooks.yaml +++ b/test/Microsoft.OpenApi.Tests/Models/Samples/docWithReusableWebhooks.yaml @@ -1,4 +1,4 @@ -openapi : 3.1.0 +openapi : 3.1.1 info: title: Webhook Example version: 1.0.0