Skip to content

Commit 66dcf6d

Browse files
committed
test: add tests for renamed endpoint detection
1 parent dd67480 commit 66dcf6d

File tree

6 files changed

+311
-0
lines changed

6 files changed

+311
-0
lines changed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"openapi": "3.0.3",
3+
"info": {
4+
"title": "Test API",
5+
"description": "A sample API to for testing",
6+
"version": "1.0.0"
7+
},
8+
"servers": [
9+
{
10+
"url": "https://api.example.com/v1"
11+
}
12+
],
13+
"paths": {
14+
"/user": {
15+
"post": {
16+
"summary": "Creates a new user profile",
17+
"operationId": "createUser",
18+
"requestBody": {
19+
"required": true,
20+
"content": {
21+
"application/json": {
22+
"schema": {
23+
"$ref": "#/components/schemas/NewUser"
24+
}
25+
}
26+
}
27+
},
28+
"responses": {
29+
"201": {
30+
"description": "User created successfully",
31+
"content": {
32+
"application/json": {
33+
"schema": {
34+
"$ref": "#/components/schemas/User"
35+
}
36+
}
37+
}
38+
}
39+
}
40+
}
41+
}
42+
},
43+
"components": {
44+
"schemas": {
45+
"User": {
46+
"type": "object",
47+
"properties": {
48+
"id": {
49+
"type": "string"
50+
},
51+
"name": {
52+
"type": "string"
53+
},
54+
"email": {
55+
"type": "string"
56+
}
57+
}
58+
},
59+
"NewUser": {
60+
"type": "object",
61+
"required": [
62+
"name",
63+
"email"
64+
],
65+
"properties": {
66+
"name": {
67+
"type": "string"
68+
},
69+
"email": {
70+
"type": "string"
71+
}
72+
}
73+
}
74+
}
75+
}
76+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Added
2+
- [POST] `/user`
3+
4+
## Removed
5+
- [POST] `/users`
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"openapi": "3.0.3",
3+
"info": {
4+
"title": "Test API",
5+
"description": "A sample API to for testing",
6+
"version": "1.0.0"
7+
},
8+
"servers": [
9+
{
10+
"url": "https://api.example.com/v1"
11+
}
12+
],
13+
"paths": {
14+
"/users": {
15+
"post": {
16+
"summary": "Creates a new user profile",
17+
"operationId": "createNewUser",
18+
"requestBody": {
19+
"required": true,
20+
"content": {
21+
"application/json": {
22+
"schema": {
23+
"$ref": "#/components/schemas/NewUser"
24+
}
25+
}
26+
}
27+
},
28+
"responses": {
29+
"201": {
30+
"description": "User created successfully",
31+
"content": {
32+
"application/json": {
33+
"schema": {
34+
"$ref": "#/components/schemas/User"
35+
}
36+
}
37+
}
38+
}
39+
}
40+
}
41+
}
42+
},
43+
"components": {
44+
"schemas": {
45+
"User": {
46+
"type": "object",
47+
"properties": {
48+
"id": {
49+
"type": "string"
50+
},
51+
"name": {
52+
"type": "string"
53+
},
54+
"email": {
55+
"type": "string"
56+
}
57+
}
58+
},
59+
"NewUser": {
60+
"type": "object",
61+
"required": [
62+
"name",
63+
"email"
64+
],
65+
"properties": {
66+
"name": {
67+
"type": "string"
68+
},
69+
"email": {
70+
"type": "string"
71+
}
72+
}
73+
}
74+
}
75+
}
76+
}
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"openapi": "3.0.3",
3+
"info": {
4+
"title": "Test API",
5+
"description": "A sample API to for testing",
6+
"version": "1.0.0"
7+
},
8+
"servers": [
9+
{
10+
"url": "https://api.example.com/v1"
11+
}
12+
],
13+
"paths": {
14+
"/user": {
15+
"post": {
16+
"summary": "Creates a new user profile",
17+
"operationId": "createUser",
18+
"requestBody": {
19+
"required": true,
20+
"content": {
21+
"application/json": {
22+
"schema": {
23+
"$ref": "#/components/schemas/NewUser"
24+
}
25+
}
26+
}
27+
},
28+
"responses": {
29+
"201": {
30+
"description": "User created successfully",
31+
"content": {
32+
"application/json": {
33+
"schema": {
34+
"$ref": "#/components/schemas/User"
35+
}
36+
}
37+
}
38+
}
39+
}
40+
}
41+
}
42+
},
43+
"components": {
44+
"schemas": {
45+
"User": {
46+
"type": "object",
47+
"properties": {
48+
"id": {
49+
"type": "string"
50+
},
51+
"name": {
52+
"type": "string"
53+
},
54+
"email": {
55+
"type": "string"
56+
}
57+
}
58+
},
59+
"NewUser": {
60+
"type": "object",
61+
"required": [
62+
"name",
63+
"email"
64+
],
65+
"properties": {
66+
"name": {
67+
"type": "string"
68+
},
69+
"email": {
70+
"type": "string"
71+
}
72+
}
73+
}
74+
}
75+
}
76+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
## Renamed
2+
- [POST] `/users``/user`
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"openapi": "3.0.3",
3+
"info": {
4+
"title": "Test API",
5+
"description": "A sample API to for testing",
6+
"version": "1.0.0"
7+
},
8+
"servers": [
9+
{
10+
"url": "https://api.example.com/v1"
11+
}
12+
],
13+
"paths": {
14+
"/users": {
15+
"post": {
16+
"summary": "Creates a new user profile",
17+
"operationId": "createUser",
18+
"requestBody": {
19+
"required": true,
20+
"content": {
21+
"application/json": {
22+
"schema": {
23+
"$ref": "#/components/schemas/NewUser"
24+
}
25+
}
26+
}
27+
},
28+
"responses": {
29+
"201": {
30+
"description": "User is created successfully",
31+
"content": {
32+
"application/json": {
33+
"schema": {
34+
"$ref": "#/components/schemas/User"
35+
}
36+
}
37+
}
38+
}
39+
}
40+
}
41+
}
42+
},
43+
"components": {
44+
"schemas": {
45+
"User": {
46+
"type": "object",
47+
"properties": {
48+
"id": {
49+
"type": "string"
50+
},
51+
"name": {
52+
"type": "string"
53+
},
54+
"email": {
55+
"type": "string"
56+
}
57+
}
58+
},
59+
"NewUser": {
60+
"type": "object",
61+
"required": [
62+
"name",
63+
"email"
64+
],
65+
"properties": {
66+
"name": {
67+
"type": "string"
68+
},
69+
"email": {
70+
"type": "string"
71+
}
72+
}
73+
}
74+
}
75+
}
76+
}

0 commit comments

Comments
 (0)