Skip to content

Commit 7d7e056

Browse files
committed
Fix failing test and update public API surface
1 parent 82b4c60 commit 7d7e056

File tree

2 files changed

+44
-57
lines changed

2 files changed

+44
-57
lines changed

test/Microsoft.OpenApi.Tests/Models/OpenApiComponentsTests.cs

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -669,25 +669,6 @@ public void SerializeComponentsWithPathItemsAsJsonWorks()
669669
{
670670
// Arrange
671671
var expected = @"{
672-
""schemas"": {
673-
""schema1"": {
674-
""properties"": {
675-
""property2"": {
676-
""type"": ""integer""
677-
},
678-
""property3"": {
679-
""$ref"": ""#/components/schemas/schema2""
680-
}
681-
}
682-
},
683-
""schema2"": {
684-
""properties"": {
685-
""property2"": {
686-
""type"": ""integer""
687-
}
688-
}
689-
}
690-
},
691672
""pathItems"": {
692673
""/pets"": {
693674
""post"": {
@@ -708,6 +689,25 @@ public void SerializeComponentsWithPathItemsAsJsonWorks()
708689
}
709690
}
710691
}
692+
},
693+
""schemas"": {
694+
""schema1"": {
695+
""properties"": {
696+
""property2"": {
697+
""type"": ""integer""
698+
},
699+
""property3"": {
700+
""$ref"": ""#/components/schemas/schema2""
701+
}
702+
}
703+
},
704+
""schema2"": {
705+
""properties"": {
706+
""property2"": {
707+
""type"": ""integer""
708+
}
709+
}
710+
}
711711
}
712712
}";
713713
// Act
@@ -723,18 +723,7 @@ public void SerializeComponentsWithPathItemsAsJsonWorks()
723723
public void SerializeComponentsWithPathItemsAsYamlWorks()
724724
{
725725
// Arrange
726-
var expected = @"schemas:
727-
schema1:
728-
properties:
729-
property2:
730-
type: integer
731-
property3:
732-
$ref: '#/components/schemas/schema2'
733-
schema2:
734-
properties:
735-
property2:
736-
type: integer
737-
pathItems:
726+
var expected = @"pathItems:
738727
/pets:
739728
post:
740729
requestBody:
@@ -745,7 +734,18 @@ public void SerializeComponentsWithPathItemsAsYamlWorks()
745734
$ref: '#/components/schemas/schema1'
746735
responses:
747736
'200':
748-
description: Return a 200 status to indicate that the data was received successfully";
737+
description: Return a 200 status to indicate that the data was received successfully
738+
schemas:
739+
schema1:
740+
properties:
741+
property2:
742+
type: integer
743+
property3:
744+
$ref: '#/components/schemas/schema2'
745+
schema2:
746+
properties:
747+
property2:
748+
type: integer";
749749

750750
// Act
751751
var actual = ComponentsWithPathItem.SerializeAsYaml(OpenApiSpecVersion.OpenApi3_1);

0 commit comments

Comments
 (0)