File tree Expand file tree Collapse file tree 2 files changed +44
-57
lines changed
test/Microsoft.OpenApi.Tests Expand file tree Collapse file tree 2 files changed +44
-57
lines changed Original file line number Diff line number Diff line change @@ -669,25 +669,6 @@ public void SerializeComponentsWithPathItemsAsJsonWorks()
669
669
{
670
670
// Arrange
671
671
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
- },
691
672
""pathItems"": {
692
673
""/pets"": {
693
674
""post"": {
@@ -708,6 +689,25 @@ public void SerializeComponentsWithPathItemsAsJsonWorks()
708
689
}
709
690
}
710
691
}
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
+ }
711
711
}
712
712
}" ;
713
713
// Act
@@ -723,18 +723,7 @@ public void SerializeComponentsWithPathItemsAsJsonWorks()
723
723
public void SerializeComponentsWithPathItemsAsYamlWorks ( )
724
724
{
725
725
// 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:
738
727
/pets:
739
728
post:
740
729
requestBody:
@@ -745,7 +734,18 @@ public void SerializeComponentsWithPathItemsAsYamlWorks()
745
734
$ref: '#/components/schemas/schema1'
746
735
responses:
747
736
'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" ;
749
749
750
750
// Act
751
751
var actual = ComponentsWithPathItem . SerializeAsYaml ( OpenApiSpecVersion . OpenApi3_1 ) ;
You can’t perform that action at this time.
0 commit comments