Skip to content

Commit 07d563b

Browse files
committed
adjust xml comment tests so endpoint isn't overloaded
1 parent 5722bc5 commit 07d563b

File tree

3 files changed

+96
-32
lines changed

3 files changed

+96
-32
lines changed

src/OpenApi/sample/Controllers/XmlController.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@
88
[ApiExplorerSettings(GroupName = "xml")]
99
public class XmlController : ControllerBase
1010
{
11-
/// <param name="name">The name of the person.</param>
12-
/// <response code="200">Returns the greeting.</response>
13-
[HttpGet]
14-
public string Get1(string name)
15-
{
16-
return $"Hello, {name}!";
17-
}
18-
1911
/// <summary>
2012
/// A summary of the action.
2113
/// </summary>
@@ -28,6 +20,14 @@ public string Get()
2820
return "Hello, World!";
2921
}
3022

23+
/// <param name="name">The name of the person.</param>
24+
/// <response code="200">Returns the greeting.</response>
25+
[HttpGet("{name}")]
26+
public string Get1(string name)
27+
{
28+
return $"Hello, {name}!";
29+
}
30+
3131
/// <param name="todo">The todo to insert into the database.</param>
3232
[HttpPost]
3333
public string Post(Todo todo)

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Integration/snapshots/OpenApi3_0/OpenApiDocumentIntegrationTests.VerifyOpenApiDocument_documentName=xml.verified.txt

Lines changed: 44 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -149,19 +149,11 @@
149149
"tags": [
150150
"Xml"
151151
],
152-
"parameters": [
153-
{
154-
"name": "name",
155-
"in": "query",
156-
"description": "The name of the person.",
157-
"schema": {
158-
"type": "string"
159-
}
160-
}
161-
],
152+
"summary": "A summary of the action.",
153+
"description": "A description of the action.",
162154
"responses": {
163155
"200": {
164-
"description": "Returns the greeting.",
156+
"description": "OK",
165157
"content": {
166158
"text/plain": {
167159
"schema": {
@@ -230,6 +222,46 @@
230222
}
231223
}
232224
}
225+
},
226+
"/Xml/{name}": {
227+
"get": {
228+
"tags": [
229+
"Xml"
230+
],
231+
"parameters": [
232+
{
233+
"name": "name",
234+
"in": "path",
235+
"description": "The name of the person.",
236+
"required": true,
237+
"schema": {
238+
"type": "string"
239+
}
240+
}
241+
],
242+
"responses": {
243+
"200": {
244+
"description": "Returns the greeting.",
245+
"content": {
246+
"text/plain": {
247+
"schema": {
248+
"type": "string"
249+
}
250+
},
251+
"application/json": {
252+
"schema": {
253+
"type": "string"
254+
}
255+
},
256+
"text/json": {
257+
"schema": {
258+
"type": "string"
259+
}
260+
}
261+
}
262+
}
263+
}
264+
}
233265
}
234266
},
235267
"components": {
@@ -394,4 +426,4 @@
394426
"name": "Xml"
395427
}
396428
]
397-
}
429+
}

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Integration/snapshots/OpenApi3_1/OpenApiDocumentIntegrationTests.VerifyOpenApiDocument_documentName=xml.verified.txt

Lines changed: 44 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -149,19 +149,11 @@
149149
"tags": [
150150
"Xml"
151151
],
152-
"parameters": [
153-
{
154-
"name": "name",
155-
"in": "query",
156-
"description": "The name of the person.",
157-
"schema": {
158-
"type": "string"
159-
}
160-
}
161-
],
152+
"summary": "A summary of the action.",
153+
"description": "A description of the action.",
162154
"responses": {
163155
"200": {
164-
"description": "Returns the greeting.",
156+
"description": "OK",
165157
"content": {
166158
"text/plain": {
167159
"schema": {
@@ -230,6 +222,46 @@
230222
}
231223
}
232224
}
225+
},
226+
"/Xml/{name}": {
227+
"get": {
228+
"tags": [
229+
"Xml"
230+
],
231+
"parameters": [
232+
{
233+
"name": "name",
234+
"in": "path",
235+
"description": "The name of the person.",
236+
"required": true,
237+
"schema": {
238+
"type": "string"
239+
}
240+
}
241+
],
242+
"responses": {
243+
"200": {
244+
"description": "Returns the greeting.",
245+
"content": {
246+
"text/plain": {
247+
"schema": {
248+
"type": "string"
249+
}
250+
},
251+
"application/json": {
252+
"schema": {
253+
"type": "string"
254+
}
255+
},
256+
"text/json": {
257+
"schema": {
258+
"type": "string"
259+
}
260+
}
261+
}
262+
}
263+
}
264+
}
233265
}
234266
},
235267
"components": {
@@ -394,4 +426,4 @@
394426
"name": "Xml"
395427
}
396428
]
397-
}
429+
}

0 commit comments

Comments
 (0)