File tree Expand file tree Collapse file tree 3 files changed +165
-0
lines changed
tests/fixtures/component-section Expand file tree Collapse file tree 3 files changed +165
-0
lines changed Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 1+ ## Modified
2+ - [ GET] ` /user/{id} `
3+ - ` NumberUserId ` modified in parameters
4+ - ` User ` modified in responses
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments