Skip to content

Commit 86f4e83

Browse files
committed
chore: avoid serializing media types components for anything bellow version 3.2
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
1 parent de83a99 commit 86f4e83

File tree

1 file changed

+2
-44
lines changed

1 file changed

+2
-44
lines changed

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

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -86,28 +86,7 @@ public async Task SerializeMediaTypesAsV31JsonWorks()
8686
// Arrange - When serializing to v3.1, mediaTypes should be prefixed with x-oai-
8787
var expected =
8888
"""
89-
{
90-
"x-oai-mediaTypes": {
91-
"application/json": {
92-
"schema": {
93-
"type": "object",
94-
"properties": {
95-
"name": {
96-
"type": "string"
97-
},
98-
"age": {
99-
"type": "integer"
100-
}
101-
}
102-
}
103-
},
104-
"text/plain": {
105-
"schema": {
106-
"type": "string"
107-
}
108-
}
109-
}
110-
}
89+
{}
11190
""";
11291

11392
// Act
@@ -123,28 +102,7 @@ public async Task SerializeMediaTypesAsV30JsonWorks()
123102
// Arrange - When serializing to v3.0, mediaTypes should be prefixed with x-oai-
124103
var expected =
125104
"""
126-
{
127-
"x-oai-mediaTypes": {
128-
"application/json": {
129-
"schema": {
130-
"type": "object",
131-
"properties": {
132-
"name": {
133-
"type": "string"
134-
},
135-
"age": {
136-
"type": "integer"
137-
}
138-
}
139-
}
140-
},
141-
"text/plain": {
142-
"schema": {
143-
"type": "string"
144-
}
145-
}
146-
}
147-
}
105+
{}
148106
""";
149107

150108
// Act

0 commit comments

Comments
 (0)