{ "swagger": "2.0", "info": { "version": "0.0.1", "title": "Crud Operations", "description": "Making CRUD operations with swagger.\n", "termsOfService":"https://developer.ferguson.com/TOS", "contact":{ "name":"apiteam" }, "license":{ "name":"Apis" } }, "host": "abhiben0-eval-test.apigee.net", "basePath": "/crudoperations", "schemes": [ "http" ], "paths": { "/employee": { "post": { "tags": [ "EmployeeCrud-Operations" ], "summary": "add new Employee details", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "in": "body", "name": "id", "schema": { "type": "object", "required": [ "id", "name" ], "properties": { "id": { "type": "integer" }, "name": { "type": "string" } } } } ], "responses": { "201": { "description": "successfully created", "schema": { "$ref": "#/definitions/Operations" } } } }, "put": { "tags": [ "EmployeeCrud-Operations" ], "summary": "Update an Employee id & name", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "in": "body", "name": "Eid", "schema": { "type": "object", "required": [ "id", "name" ], "properties": { "id": { "type": "integer" }, "name": { "type": "string" } } } } ], "responses": { "201": { "description": "successfully updated", "schema": { "$ref": "#/definitions/Operations" } }, "404": { "description": "successfully updated", "schema": { "$ref": "#/definitions/Operations" } } } }, "get": { "tags": [ "EmployeeCrud-Operations" ], "summary": "get the Employee details", "produces": [ "application/json" ], "consumes": [ "application/json" ], "parameters": [ { "name": "Eid", "in": "query", "type": "integer", "description": "get the student id data", "required": true } ], "responses": { "200": { "description": "successfully fetched", "schema": { "$ref": "#/definitions/Operations" } } } }, "delete": { "tags": [ "EmployeeCrud-Operations" ], "summary": "Delete a Employee details", "produces": [ "application/json" ], "consumes": [ "application/json" ], "parameters": [ { "in": "body", "name": "sid", "schema": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "integer" } } } } ], "responses": { "204": { "description": "successfully deleted", "schema": { "$ref": "#/definitions/del" } } } } }, "/student": { "post": { "tags": [ "StudentCrud-Operations" ], "summary": "add new student details", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "in": "body", "name": "id", "schema": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "integer" }, "name": { "type": "string" } } } } ], "responses": { "201": { "description": "successfully created", "schema": { "$ref": "#/definitions/Operations" } }, "401": { "description": "successfully created", "schema": { "$ref": "#/definitions/Operations" } } } }, "put": { "tags": [ "StudentCrud-Operations" ], "summary": "Update an existing Student id details", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "in": "body", "name": "sid", "schema": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "integer" }, "name": { "type": "string" } } } } ], "responses": { "200": { "description": "successfully created", "schema": { "$ref": "#/definitions/Operations" } } } }, "get": { "tags": [ "StudentCrud-Operations" ], "summary": "get the student details", "produces": [ "application/json" ], "consumes": [ "application/json" ], "parameters": [ { "name": "sid", "in": "query", "type": "integer", "description": "get the student id data", "required": true } ], "responses": { "201": { "description": "successfully created", "schema": { "$ref": "#/definitions/res" } } } }, "delete": { "tags": [ "StudentCrud-Operations" ], "summary": "Delete Student details", "produces": [ "application/json" ], "consumes": [ "application/json" ], "parameters": [ { "in": "body", "name": "sid", "schema": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "integer" } } } } ], "responses": { "201": { "description": "successfully created", "schema": { "$ref": "#/definitions/del" } } } } }, "/Book": { "post": { "tags": [ "BookCrud-Operations" ], "summary": "add new Book details", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "in": "body", "name": "bid", "schema": { "type": "object", "required": [ "bid", "bname" ], "properties": { "bid": { "type": "integer" }, "bname": { "type": "string" } } } } ], "responses": { "201": { "description": "successfully created", "schema": { "$ref": "#/definitions/Operations" } } } }, "put": { "tags": [ "BookCrud-Operations" ], "summary": "Update an Book id details", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "in": "body", "name": "bid", "schema": { "type": "object", "required": [ "bid" ], "properties": { "bid": { "type": "integer" }, "bname": { "type": "string" } } } } ], "responses": { "201": { "description": "successfully created", "schema": { "$ref": "#/definitions/Operations" } } } }, "get": { "tags": [ "BookCrud-Operations" ], "summary": "get the Book details", "parameters": [ { "name": "bid", "in": "query", "type": "integer", "description": "get the student id data", "required": true } ], "responses": { "201": { "description": "successfully created", "schema": { "$ref": "#/definitions/res" } } } }, "delete": { "tags": [ "BookCrud-Operations" ], "summary": "Delete the book data", "produces": [ "application/json" ], "consumes": [ "application/json" ], "parameters": [ { "in": "body", "name": "bid", "schema": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "integer" } } } } ], "responses": { "201": { "description": "successfully created", "schema": { "$ref": "#/definitions/del" } } } } }, "/stores": { "post": { "tags": [ "storeCrud-Operations" ], "summary": "add new Book details", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "in": "body", "name": "stid", "schema": { "type": "object", "required": [ "stid", "stname" ], "properties": { "stid": { "type": "integer" }, "stname": { "type": "string" } } } } ], "responses": { "201": { "description": "successfully created", "schema": { "$ref": "#/definitions/Operations" } } } }, "put": { "tags": [ "storeCrud-Operations" ], "summary": "Update an Book id and Book name", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "in": "body", "name": "stid", "schema": { "type": "object", "required": [ "stid" ], "properties": { "stid": { "type": "integer" }, "stname": { "type": "string" } } } } ], "responses": { "201": { "description": "successfully created", "schema": { "$ref": "#/definitions/Operations" } } } }, "get": { "tags": [ "storeCrud-Operations" ], "summary": "get the Book details", "produces": [ "application/json" ], "consumes": [ "application/json" ], "parameters": [ { "name": "stid", "in": "query", "type": "integer", "description": "get the student id data", "required": true } ], "responses": { "201": { "description": "successfully created", "schema": { "$ref": "#/definitions/res" } } } }, "delete": { "tags": [ "storeCrud-Operations" ], "summary": "Delete the book data", "produces": [ "application/json" ], "consumes": [ "application/json" ], "parameters": [ { "in": "body", "name": "stid", "schema": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "integer" } } } } ], "responses": { "201": { "description": "successfully created", "schema": { "$ref": "#/definitions/del" } } } } } }, "responses":{ "Error":{ "description":"Backend issues or other problems.", "schema":{ "$ref":"#/definitions/Error" } } }, "definitions": { "Error": { "type": "object", "properties": { "message": { "type": "array", "description": "Can contain a single string, array, integer or another JSON object. Intentionally vague as it will sometimes contain the error response from the backend server.", "items": {}, "example": "T-shirt" }, "error code": { "type": "string", "description": "HTTP status code.", "example": "T-shirt" }, "reason": { "type": "string", "description": "A short meaningful reason.", "example": "T-shirt" }, "contact": { "type": "string", "description": "Contact info for the error.", "example": "T-shirt" } }, "required": [ "message","error code","reason","contact" ] }, "Operations": { "type": "object", "properties": { "Stid": { "type": "integer", "format": "int64", "example": "T-shirt" }, "Stname": { "type": "string", "description": "store name", "example": "T-shirt" }, "Bid": { "type": "integer", "format": "int64", "example": "T-shirt" }, "Bname": { "type": "string", "description": "book name", "example": "T-shirt" }, "Eid": { "type": "integer", "format": "int64", "example": "T-shirt" }, "Ename": { "type": "string", "description": "employee name", "example": "T-shirt" }, "sid": { "type": "integer", "format": "int64", "example": "T-shirt" }, "sname": { "type": "string", "description": "Student name", "example": "T-shirt" }, "status": { "type": "string", "description": "Order Status", "example": "T-shirt" } } }, "res": { "properties": { "200": { "description": "successful operation", "example": "T-shirt" }, "201": { "description": "created", "example": "T-shirt" }, "204": { "description": "put or delete", "example": "T-shirt" }, "404": { "description": "not found", "example": "T-shirt" }, "400": { "description": "bad request", "example": "T-shirt" }, "401": { "description": "unauthorized", "example": "T-shirt" }, "500": { "description": "server error", "example": "T-shirt" } } }, "del": { "type": "object", "properties": { "Eid": { "type": "integer", "example": "T-shirt" }, "sid": { "type": "integer", "example": "T-shirt" } } } }, "securityDefinitions":{ "oauth_client_creds":{ "type":"oauth2", "description":"This is a client creds oauth2 security definition that's being used globally at the top.", "tokenUrl":"https://api2.ferguson.com/v1/oauth2/token", "flow":"application" } } }