Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- swagger: '2.0'
- info:
- description: >-
- This is a sample server Petstore server. You can find out more about
- Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net,
- #swagger](http://swagger.io/irc/). For this sample, you can use the api
- key `special-key` to test the authorization filters.
- version: 1.0.0
- title: Swagger Petstore
- termsOfService: 'http://swagger.io/terms/'
- contact:
- email: apiteam@swagger.io
- license:
- name: Apache 2.0
- url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
- host: petstore.swagger.io
- basePath: /v2
- tags:
- - name: medication
- description: Operations about medication
- - name: user
- description: Operations about user
- externalDocs:
- description: Find out more about our store
- url: 'http://swagger.io'
- schemes:
- - http
- paths:
- /medication:
- post:
- tags:
- - medication
- summary: Create medication
- description: Create medication
- operationId: createMedication
- produces:
- - application/json
- parameters:
- - in: body
- name: body
- description: Medication object
- required: true
- schema:
- $ref: '#/definitions/CreateMedicationModel'
- responses:
- default:
- description: successful operation
- /medications:
- get:
- tags:
- - medication
- summary: Get user's medications
- description: Get user's meeications
- operationId: getMedications
- produces:
- - application/json
- responses:
- '200':
- description: successful operation
- schema:
- type: array
- items:
- $ref: '#/definitions/MedicationModel'
- '400':
- description: Invalid status value
- /orders:
- get:
- tags:
- - order
- summary: Get user's orders
- description: Get user's orders
- operationId: getOrders
- produces:
- - application/json
- responses:
- '200':
- description: successful operation
- schema:
- type: array
- items:
- $ref: '#/definitions/OrderModel'
- '400':
- description: Invalid status value
- /user:
- post:
- security: []
- tags:
- - user
- summary: Create user
- description: Register
- operationId: createUser
- produces:
- - application/xml
- - application/json
- parameters:
- - in: body
- name: body
- description: User object
- required: true
- schema:
- $ref: '#/definitions/CreateUserModel'
- responses:
- default:
- description: successful operation
- put:
- tags:
- - user
- summary: Updated user
- description: This can only be done by the logged in user.
- operationId: updateUser
- produces:
- - application/xml
- - application/json
- parameters:
- - in: body
- name: body
- description: Updated user object
- required: true
- schema:
- $ref: '#/definitions/CreateUserModel'
- responses:
- '400':
- description: Invalid user supplied
- '404':
- description: User not found
- get:
- tags:
- - user
- summary: Gets current user
- description: ""
- produces:
- - application/xml
- - application/json
- responses:
- default:
- description: successful operation
- schema:
- $ref: '#/definitions/User'
- /user/sessions:
- post:
- security: []
- tags:
- - user
- summary: Logs user into the system
- description: Login
- operationId: loginUser
- produces:
- - application/xml
- - application/json
- parameters:
- - in: body
- name: body
- description: User object
- required: true
- schema:
- $ref: '#/definitions/LoginUserModel'
- responses:
- '200':
- description: successful operation
- schema:
- $ref: '#/definitions/SessionTokenModel'
- '400':
- description: Invalid username/password supplied
- /user/validateAccount: # Every field of the user's model should be validated and return what is missing
- put:
- security: []
- tags:
- - user
- summary: Checks users information
- operationId: validateAccount
- produces:
- - application/json
- parameters:
- - in: body
- name: body
- description: Updated user object
- required: false
- schema:
- $ref: '#/definitions/CreateUserModel'
- responses:
- '200':
- description: successful operation
- /services:
- get:
- tags:
- - service
- summary: Gets all services
- operationId: getServices
- produces:
- - application/json
- responses:
- default:
- description: successful operation
- schema:
- $ref: '#/definitions/ServiceModel'
- /services/{id}:
- get:
- tags:
- - service
- summary: Represents a service model
- description: Represents a single service model
- operationId: getServiceById
- produces:
- - application/json
- parameters:
- - in: path
- name: id
- description: Service ID
- required: true
- schema:
- type: integer
- format: int64
- responses:
- default:
- description: successful operation
- schema:
- $ref: '#/definitions/SingleServiceModel'
- /pharmacies:
- get:
- tags:
- - pharmacies
- summary: Get all pharmacies
- description: Get all pharmacies
- operationId: getPharmacies
- produces:
- - application/json
- responses:
- default:
- description: successful operation
- schema:
- $ref: '#/definitions/PharmacyModel'
- /contact:
- get:
- tags:
- - contact
- summary: Get user's current pharmacy
- description: Get user's current pharmacy
- operationId: getPharmacy
- produces:
- - application/json
- responses:
- default:
- description: successful operation
- schema:
- $ref: '#/definitions/PharmacyModel'
- components:
- securitySchemes:
- bearerAuth:
- type: http
- scheme: bearer
- bearerFormat: JWT
- security:
- - bearerAuth: []
- definitions:
- CreateMedicationModel:
- type: object
- properties:
- name:
- type: string
- reminder:
- type: string
- description: Reminder Status
- enum:
- - morning
- - noon
- - evening
- - night
- quantity:
- type: string
- MedicationModel:
- type: object
- properties:
- id:
- type: integer
- name:
- type: string
- reminder:
- type: string
- description: Reminder Status
- enum:
- - morning
- - noon
- - evening
- - night
- quantity:
- type: string
- AddressModel:
- type: object
- properties:
- latitude:
- type: number
- longitude:
- type: number
- name:
- type: string
- ContactModel:
- type: object
- properties:
- address:
- $ref: '#/definitions/AddressModel'
- phone:
- type: string
- email:
- type: string
- SessionTokenModel:
- type: object
- properties:
- sessionToken:
- type: string
- LoginUserModel:
- type: object
- properties:
- username:
- type: string
- password:
- type: string
- CreateUserModel:
- type: object
- properties:
- phapharmacyId:
- type: integer
- format: int64
- name:
- type: string
- password:
- type: string
- dateOfBirth:
- type: string
- phone:
- type: string
- email:
- type: string
- address:
- $ref: '#/definitions/AddressModel'
- insuranceCardNumber:
- type: integer
- format: int64
- xml:
- name: User
- PriceModel:
- type: object
- properties:
- currency:
- type: string
- value:
- type: number
- OrderModel:
- type: object
- properties:
- id:
- type: integer
- format: int64
- status:
- type: string
- enum:
- - active
- - on-hold
- - cancelled
- - completed
- - entered-in-error
- - stopped
- - draft
- - unknown
- images:
- items:
- type: string
- date:
- type: string
- pharmacy:
- $ref: '#/definitions/PharmacyModel'
- price:
- $ref: '#/definitions/PriceModel'
- ServiceModel:
- type: object
- properties:
- id:
- type: integer
- format: int64
- title:
- type: string
- format: int64
- SingleServiceModel:
- type: object
- properties:
- id:
- type: integer
- format: int64
- imageURL:
- type: string
- title:
- type: string
- description:
- type: string
- linkURL:
- type: string
- PharmacyModel:
- type: object
- properties:
- id:
- type: integer
- format: int64
- name:
- type: string
- addresses:
- items:
- $ref: '#/definitions/AddressModel'
- contacts:
- items:
- $ref: '#/definitions/ContactModel'
- User:
- type: object
- properties:
- id:
- type: integer
- format: int64
- phapharmacy:
- $ref: '#/definitions/PharmacyModel'
- name:
- type: string
- dateOfBirth:
- type: string
- address:
- $ref: '#/definitions/AddressModel'
- phone:
- type: string
- email:
- type: string
- insuranceCardNumber:
- type: integer
- format: int64
- xml:
- name: User
- externalDocs:
- description: Find out more about Swagger
- url: 'http://swagger.io'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement