Skip to content

Commit 402595e

Browse files
committed
Merge pull request OAI#372 from swagger-api/guidelines
Guidelines
2 parents 059ebd4 + 1ee1e60 commit 402595e

File tree

4 files changed

+38
-0
lines changed

4 files changed

+38
-0
lines changed

guidelines/sample-server/files/models.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"Model": {
3+
"type": "object",
34
"description": "A simple model",
45
"properties": {
56
"id": {
@@ -13,6 +14,7 @@
1314
}
1415
},
1516
"Tag": {
17+
"type": "object",
1618
"description": "A tag entity in the system",
1719
"properties": {
1820
"name": {
@@ -21,6 +23,7 @@
2123
}
2224
},
2325
"Health": {
26+
"type": "object",
2427
"description": "An object representing the health of a server",
2528
"required": [
2629
"liveThreadCount",
@@ -52,6 +55,7 @@
5255
}
5356
},
5457
"JVMMemory": {
58+
"type": "object",
5559
"required": [
5660
"allocated",
5761
"max",
@@ -81,5 +85,24 @@
8185
"format": "double"
8286
}
8387
}
88+
},
89+
"ErrorMessage": {
90+
"type": "object",
91+
"description": "A shared model for error message",
92+
"required" : ["errorCode","reason"],
93+
"properties": {
94+
"errorCode": {
95+
"type": "integer",
96+
"format": "int64"
97+
},
98+
"reason": {
99+
"description": "the reason for this error",
100+
"type": "string"
101+
},
102+
"description": {
103+
"description": "an optional longer description of this error message",
104+
"type": "string"
105+
}
106+
}
84107
}
85108
}

guidelines/sample-server/files/operations.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,12 @@
1616
"schema": {
1717
"$ref": "http://localhost:8000/models.json#/Health"
1818
}
19+
},
20+
"404": {
21+
"$ref": "http://localhost:8000/responses.json#/NotFoundError"
1922
}
2023
}
2124
}
2225
}
2326
}
27+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"NotFoundError": {
3+
"description": "Entity not found",
4+
"schema": {
5+
"$ref": "http://localhost:8000/models.json#/ErrorMessage"
6+
}
7+
}
8+
}

guidelines/sample-server/files/swagger.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
"$ref": "http://localhost:8000/models.json#/Health"
3737
}
3838
}
39+
},
40+
"404": {
41+
"$ref": "http://localhost:8000/responses.json#/NotFoundError"
3942
}
4043
}
4144
}

0 commit comments

Comments
 (0)