|
25 | 25 | "summary": "This API will return a random greeting.",
|
26 | 26 | "operationId": "sayHello",
|
27 | 27 | "responses": {
|
28 |
| - "500": { |
29 |
| - "description": "Internal Server Error", |
| 28 | + "400": { |
| 29 | + "description": "Bad Request", |
30 | 30 | "content": {
|
31 | 31 | "application/json": {
|
32 | 32 | "schema": {
|
33 | 33 | "$ref": "#/components/schemas/ApiError"
|
34 | 34 | },
|
35 | 35 | "examples": {
|
36 |
| - "Service-500": { |
37 |
| - "summary": "500 from the service directly", |
38 |
| - "description": "Service-500", |
| 36 | + "Service-400": { |
| 37 | + "summary": "400 from the service directly", |
| 38 | + "description": "Service-400", |
39 | 39 | "value": {
|
40 |
| - "status": 500, |
41 |
| - "errorCode": "ERROR_002", |
42 |
| - "message": "Another example message..." |
| 40 | + "status": 400, |
| 41 | + "errorCode": "ERROR_001", |
| 42 | + "message": "An example message..." |
43 | 43 | }
|
44 | 44 | }
|
45 | 45 | }
|
46 | 46 | }
|
47 | 47 | }
|
48 | 48 | },
|
49 |
| - "400": { |
50 |
| - "description": "Bad Request", |
| 49 | + "500": { |
| 50 | + "description": "Internal Server Error", |
51 | 51 | "content": {
|
52 | 52 | "application/json": {
|
53 | 53 | "schema": {
|
54 | 54 | "$ref": "#/components/schemas/ApiError"
|
55 | 55 | },
|
56 | 56 | "examples": {
|
57 |
| - "Service-400": { |
58 |
| - "summary": "400 from the service directly", |
59 |
| - "description": "Service-400", |
| 57 | + "Service-500": { |
| 58 | + "summary": "500 from the service directly", |
| 59 | + "description": "Service-500", |
60 | 60 | "value": {
|
61 |
| - "status": 400, |
62 |
| - "errorCode": "ERROR_001", |
63 |
| - "message": "An example message..." |
| 61 | + "status": 500, |
| 62 | + "errorCode": "ERROR_002", |
| 63 | + "message": "Another example message..." |
64 | 64 | }
|
65 | 65 | }
|
66 | 66 | }
|
|
79 | 79 | }
|
80 | 80 | }
|
81 | 81 | }
|
| 82 | + }, |
| 83 | + "/test": { |
| 84 | + "get": { |
| 85 | + "tags": [ |
| 86 | + "Demo" |
| 87 | + ], |
| 88 | + "operationId": "sayHello2", |
| 89 | + "responses": { |
| 90 | + "400": { |
| 91 | + "description": "invalid input, object invalid", |
| 92 | + "content": { |
| 93 | + "*/*": { |
| 94 | + "schema": { |
| 95 | + "$ref": "#/components/schemas/Greeting" |
| 96 | + } |
| 97 | + } |
| 98 | + } |
| 99 | + }, |
| 100 | + "201": { |
| 101 | + "description": "item created", |
| 102 | + "content": { |
| 103 | + "*/*": { |
| 104 | + "schema": { |
| 105 | + "$ref": "#/components/schemas/Greeting" |
| 106 | + } |
| 107 | + } |
| 108 | + } |
| 109 | + }, |
| 110 | + "409": { |
| 111 | + "description": "an existing item already exists", |
| 112 | + "content": { |
| 113 | + "*/*": { |
| 114 | + "schema": { |
| 115 | + "$ref": "#/components/schemas/Greeting" |
| 116 | + } |
| 117 | + } |
| 118 | + } |
| 119 | + } |
| 120 | + } |
| 121 | + } |
82 | 122 | }
|
83 | 123 | },
|
84 | 124 | "components": {
|
|
0 commit comments