Below code is what I am having my project. I have used the swagger-tools
dependency and the version is 0.10.4
.
swagger.json
{
"swagger": "2.0",
"info": {
"title": "Node JS APP",
"description": "Node JS APP",
"version": "1.0.0"
},
"produces": [
"application/json"
],
"host": "localhost:9000",
"basePath": "/api",
"paths": {
"/cinema-mgr-api/users/movies":{
"post": {
"tags": ["controller"],
"description": "movies",
"x-swagger-router-controller": "controller",
"operationId": "movies",
"parameters": [
{
"name": "body",
"in": "body",
"description": "movies",
"required": true,
"schema": {
"$ref": "#/definitions/movies"
}
}
],
"responses": {
"200": {
"description": "search successful"
}
}
}
},
"/aws-mgr-api/storage": {
"post": {
"tags": ["aws-controller"],
"description": "storage",
"x-swagger-router-controller": "aws-controller",
"operationId": "storage",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/storage"
}
}
],
"responses": {
"200": {
"description": "stored Successfully"
}
}
}
}
},
"definitions": {
"movies": {
"type": "object",
"required": [
"movieName"
],
"properties": {
"movieId": {
"type": "string"
},
"movieName": {
"type": "string"
},
"filters": {
"type": "object",
"properties": {
"period": {
"type": "string"
},
"year": {
"type": "array"
},
"language": {
"type": "array"
}
}
}
}
},
"storage": {
"type":"object"
}
}
}