Skip to content

Commit dc5589a

Browse files
committed
test: added test for verifying changed component section identification
1 parent 571a7a1 commit dc5589a

File tree

3 files changed

+165
-0
lines changed

3 files changed

+165
-0
lines changed
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
{
2+
"openapi": "3.0.0",
3+
"info": {
4+
"title": "Test API",
5+
"description": "A sample API for testing"
6+
},
7+
"servers": [
8+
{
9+
"url": "https://api.example.com/v1"
10+
}
11+
],
12+
"paths": {
13+
"/user/{id}": {
14+
"get": {
15+
"summary": "Get user by ID",
16+
"parameters": [
17+
{
18+
"$ref": "#/components/parameters/StringUserId"
19+
},
20+
{
21+
"$ref": "#/components/parameters/NumberUserId"
22+
}
23+
],
24+
"responses": {
25+
"200": {
26+
"description": "User found",
27+
"content": {
28+
"application/json": {
29+
"schema": {
30+
"type": "object",
31+
"properties": {
32+
"userCreated": {
33+
"type": "array",
34+
"items": {
35+
"$ref": "#/components/schemas/User"
36+
}
37+
}
38+
}
39+
}
40+
}
41+
}
42+
}
43+
}
44+
}
45+
}
46+
},
47+
"components": {
48+
"parameters": {
49+
"StringUserId": {
50+
"type": "string",
51+
"description": "The unique identifier for a user",
52+
"example": 1234
53+
},
54+
"NumberUserId": {
55+
"type": "number",
56+
"description": "The unique identifier for a user",
57+
"example": 1234
58+
}
59+
},
60+
"schemas": {
61+
"User": {
62+
"type": "object",
63+
"properties": {
64+
"id": {
65+
"type": "string"
66+
},
67+
"name": {
68+
"type": "string"
69+
},
70+
"email": {
71+
"$ref": "#/components/schemas/Email"
72+
}
73+
}
74+
},
75+
"Email": {
76+
"type": "string",
77+
"format": "email"
78+
}
79+
}
80+
}
81+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
## Modified
2+
- [GET] `/user/{id}`
3+
- `NumberUserId` modified in parameters
4+
- `User` modified in responses
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
{
2+
"openapi": "3.0.0",
3+
"info": {
4+
"title": "Test API",
5+
"description": "A sample API for testing"
6+
},
7+
"servers": [
8+
{
9+
"url": "https://api.example.com/v1"
10+
}
11+
],
12+
"paths": {
13+
"/user/{id}": {
14+
"get": {
15+
"summary": "Get user by ID",
16+
"parameters": [
17+
{
18+
"$ref": "#/components/parameters/StringUserId"
19+
},
20+
{
21+
"$ref": "#/components/parameters/NumberUserId"
22+
}
23+
],
24+
"responses": {
25+
"200": {
26+
"description": "User found",
27+
"content": {
28+
"application/json": {
29+
"schema": {
30+
"type": "object",
31+
"properties": {
32+
"userCreated": {
33+
"type": "array",
34+
"items": {
35+
"$ref": "#/components/schemas/User"
36+
}
37+
}
38+
}
39+
}
40+
}
41+
}
42+
}
43+
}
44+
}
45+
}
46+
},
47+
"components": {
48+
"parameters": {
49+
"StringUserId": {
50+
"type": "string",
51+
"description": "The unique identifier for a user",
52+
"example": 1234
53+
},
54+
"NumberUserId": {
55+
"type": "number",
56+
"description": "The unique identifier for a user",
57+
"example": 12345
58+
}
59+
},
60+
"schemas": {
61+
"User": {
62+
"type": "object",
63+
"properties": {
64+
"id": {
65+
"type": "string"
66+
},
67+
"name": {
68+
"type": "string"
69+
},
70+
"email": {
71+
"$ref": "#/components/schemas/Email"
72+
}
73+
}
74+
},
75+
"Email": {
76+
"type": "string"
77+
}
78+
}
79+
}
80+
}

0 commit comments

Comments
 (0)