mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 10:58:55 +00:00
137 lines
3.8 KiB
JSON
137 lines
3.8 KiB
JSON
{
|
|
"swagger": 2,
|
|
"info": {
|
|
"title": "HR API",
|
|
"description": "A way to manage people in our organization",
|
|
"version": "1.0.0"
|
|
},
|
|
"host": "my.api.com",
|
|
"basePath": "/v2",
|
|
"paths": {
|
|
"/users": {
|
|
"get": {
|
|
"operationId": "getUsers",
|
|
"tags": [
|
|
"users are awesome"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "query",
|
|
"description": "number of records to skip",
|
|
"name": "skip",
|
|
"type": "integer",
|
|
"format": "int32"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "successful response",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "User"
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "bad input",
|
|
"schema": {
|
|
"$ref": "ErrorModel"
|
|
}
|
|
},
|
|
"default": {
|
|
"description": "got a response"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/{id}": {
|
|
"get": {
|
|
"tags": [
|
|
"users"
|
|
],
|
|
"operationId": "getUserById",
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "id",
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"description": "user id to look up by"
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "got a response"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/places": {
|
|
"get": {
|
|
"tags": [
|
|
"locations"
|
|
],
|
|
"operationId": "getPlaces",
|
|
"responses": {
|
|
"default": {
|
|
"description": "got a response"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/photos": {
|
|
"get": {
|
|
"tags": [
|
|
"users"
|
|
],
|
|
"operationId": "getPhotos",
|
|
"responses": {
|
|
"default": {
|
|
"description": "got a response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"ErrorModel": {
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
],
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"message": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"User": {
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"firstName": {
|
|
"type": "string"
|
|
},
|
|
"lastName": {
|
|
"type": "string"
|
|
},
|
|
"age": {
|
|
"type": "integer",
|
|
"format": "int32"
|
|
},
|
|
"lastUpdated": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|