Skip to content

Commit

Permalink
feat: bumps target OAS version to 3.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
baywet committed Oct 24, 2024
1 parent 899a541 commit ad1bdec
Show file tree
Hide file tree
Showing 16 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/Microsoft.OpenApi/Models/OpenApiDocument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public void SerializeAsV31(IOpenApiWriter writer)
writer.WriteStartObject();

// openApi;

Check warning on line 140 in src/Microsoft.OpenApi/Models/OpenApiDocument.cs

View workflow job for this annotation

GitHub Actions / Build

Remove this commented out code. (https://rules.sonarsource.com/csharp/RSPEC-125)
writer.WriteProperty(OpenApiConstants.OpenApi, "3.1.0");
writer.WriteProperty(OpenApiConstants.OpenApi, "3.1.1");

// jsonSchemaDialect
writer.WriteProperty(OpenApiConstants.JsonSchemaDialect, JsonSchemaDialect);
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.1.0
openapi: 3.1.1
info:
title: Example API
version: 1.0.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.1.0
openapi: 3.1.1
info:
title: ReferenceById
version: 1.0.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi : 3.1.0
openapi : 3.1.1
info:
title: Webhook Example
version: 1.0.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: '3.1.0'
openapi: '3.1.1'
info:
version: '1.0.0'
title: Swagger Petstore (Simple)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.1.0
openapi: 3.1.1
info:
title: Webhook Example
version: 1.0.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.1.0
openapi: 3.1.1
info:
title: ReferenceById
version: 1.0.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.1.0
openapi: 3.1.1
info:
title: ReferenceById
version: 1.0.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.1.0
openapi: 3.1.1
info:
title: ReferencedById
version: 1.0.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"openapi": "3.1.0",
"openapi": "3.1.1",
"info": {
"title": "Webhook Example",
"version": "1.0.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -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"}}}}}}
{"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"}}}}}}
6 changes: 3 additions & 3 deletions test/Microsoft.OpenApi.Tests/Models/OpenApiDocumentTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.1.0
openapi: 3.1.1
info:
title: Simple API
version: 1.0.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi : 3.1.0
openapi : 3.1.1
info:
title: Webhook Example
version: 1.0.0
Expand Down

0 comments on commit ad1bdec

Please sign in to comment.