openapi: 3.0.0 servers: # Added by API Auto Mocking Plugin - description: SwaggerHub API Auto Mocking url: https://virtserver.swaggerhub.com/biharck/hands-on/1.0.0 - description: The server description url: https://localhost:3000/hands-on-store/1.0.0 info: description: | This is a sample store server. You can find out more about Swagger at [http://Swagger.io](http://Swagger.io) version: "1.0.0" title: Swagger store termsOfService: "http://Swagger.io/terms/" contact: email: biharck@gmail.com license: name: Apache 2.0 url: "http://www.apache.org/licenses/LICENSE-2.0.html" tags: - name: store description: Access to store orders - name: user description: Operations about user externalDocs: description: Find out more about our store url: "http://Swagger.io" paths: /store/inventory: get: tags: - store summary: Returns user inventories from the store description: Returns a map of status codes to quantities operationId: getInventory responses: "200": description: successful operation content: application/json: schema: type: object additionalProperties: type: integer format: int32 "401": $ref: "#/components/responses/UnauthorizedError" security: - bearerAuth: [] /store/orders: post: tags: - store summary: Place an order for a user operationId: placeOrder responses: "201": description: successful operation content: application/json: schema: $ref: "#/components/schemas/Order" application/xml: schema: $ref: "#/components/schemas/Order" "400": description: Invalid Order "401": $ref: "#/components/responses/UnauthorizedError" security: - bearerAuth: [] requestBody: content: application/json: schema: $ref: "#/components/schemas/Order" description: order placed for purchasing the user required: true "/store/orders/{orderId}": get: tags: - store summary: Find purchase order by ID description: >- For valid response try integer IDs with value >= 1 and <= 10.\ \ Other values will generated exceptions operationId: getOrderById parameters: - name: orderId in: path description: ID of user that needs to be fetched required: true schema: type: integer format: int64 minimum: 1 maximum: 10 responses: "200": description: successful operation content: application/json: schema: $ref: "#/components/schemas/Order" application/xml: schema: $ref: "#/components/schemas/Order" "400": description: Invalid ID supplied "401": $ref: "#/components/responses/UnauthorizedError" "404": description: Order not found security: - bearerAuth: [] delete: tags: - store summary: Delete purchase order by ID description: >- For valid response try integer IDs with positive integer value.\ \ Negative or non-integer values will generate API errors operationId: deleteOrder parameters: - name: orderId in: path description: ID of the order that needs to be deleted required: true schema: type: integer format: int64 minimum: 1 responses: "400": description: Invalid ID supplied "401": $ref: "#/components/responses/UnauthorizedError" "404": description: Order not found security: - bearerAuth: [] /users: post: tags: - user summary: Create user description: This can only be done by the logged in user. operationId: createUser responses: "201": description: successful operation content: application/json: schema: $ref: "#/components/schemas/User" application/xml: schema: $ref: "#/components/schemas/User" "401": $ref: "#/components/responses/UnauthorizedError" security: - bearerAuth: [] requestBody: content: application/json: schema: $ref: "#/components/schemas/User" description: Created user object required: true /users/login: get: tags: - user summary: Logs user into the system operationId: loginUser parameters: - name: username in: query description: The user name for login required: true schema: type: string - name: password in: query description: The password for login in clear text required: true schema: type: string responses: "200": description: successful operation headers: X-Rate-Limit: description: calls per hour allowed by the user schema: type: integer format: int32 X-Expires-After: description: date in UTC when token expires schema: type: string format: date-time content: application/json: schema: type: string application/xml: schema: type: string "400": description: Invalid username/password supplied /users/logout: get: tags: - user summary: Logs out current logged in user session operationId: logoutUser responses: default: description: successful operation "/users/{username}": get: tags: - user summary: Get user by user name operationId: getUserByName parameters: - name: username in: path description: The name that needs to be fetched. Use user1 for testing. required: true schema: type: string responses: "200": description: successful operation content: application/json: schema: $ref: "#/components/schemas/User" application/xml: schema: $ref: "#/components/schemas/User" "400": description: Invalid username supplied "401": $ref: "#/components/responses/UnauthorizedError" "404": description: User not found security: - bearerAuth: [] patch: tags: - user summary: Updated user description: This can only be done by the logged in user. operationId: updateUser parameters: - name: username in: path description: name that need to be updated required: true schema: type: string responses: "204": description: successful operation "400": description: Invalid user supplied "401": $ref: "#/components/responses/UnauthorizedError" "404": description: User not found security: - bearerAuth: [] requestBody: content: application/json: schema: $ref: "#/components/schemas/User" description: Updated user object required: true delete: tags: - user summary: Delete user description: This can only be done by the logged in user. operationId: deleteUser parameters: - name: username in: path description: The name that needs to be deleted required: true schema: type: string responses: "204": description: successful operation "400": description: Invalid username supplied "401": $ref: "#/components/responses/UnauthorizedError" "404": description: User not found security: - bearerAuth: [] externalDocs: description: Find out more about Swagger url: "http://Swagger.io" components: responses: UnauthorizedError: description: Access token is missing or invalid schemas: Order: type: object properties: id: type: integer format: int64 userId: type: integer format: int64 quantity: type: integer format: int32 shipDate: type: string format: date-time status: type: string description: Order Status enum: - placed - approved - delivered complete: type: boolean default: false xml: name: Order User: type: object properties: id: type: integer format: int64 username: type: string firstName: type: string lastName: type: string email: type: string password: type: string phone: type: string userStatus: type: integer format: int32 description: User Status xml: name: User securitySchemes: bearerAuth: # arbitrary name for the security scheme type: http scheme: bearer bearerFormat: JWT # optional, arbitrary value for documentation purposes