123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341 |
- ---
- # this is an API for ditup.org/api
- # the repository https://github.com/ditup/ditapi
- swagger: "2.0"
- info:
- title: ditup API
- description: the REST JSON API for ditup.org online platform for real-world collaboration
- version: "1.0.0"
- # the domain of the service
- host: ditup.org
- # array of all schemes that your API supports
- schemes:
- - http
- - https
- # will be prefixed to all paths
- basePath: /api
- securityDefinitions:
- basicAuth:
- type: basic
- description: HTTP Basic Authentication
- consumes:
- - application/vnd.api+json
- produces:
- - application/vnd.api+json
- paths:
- # CRUD users
- /users:
- get:
- tags:
- - users
- summary: users
- description: The users collection
- security:
- - basicAuth: []
- responses:
- 200:
- description: An array of users
- schema:
- type: array
- items:
- $ref: '#/definitions/User'
- default:
- description: Unexpected error
- schema:
- $ref: '#/definitions/Error'
- post:
- tags:
- - users
- description: Create a new user
- security:
- - basicAuth: []
- parameters:
- - in: body
- name: body
- description:
- required: true
- schema:
- $ref: '#/definitions/NewUser'
- responses:
- 201:
- description: A new user
- schema:
- $ref: '#/definitions/User'
- /users/{username}:
- get:
- tags:
- - users
- description: get user by username
- security:
- - basicAuth: []
- parameters:
- - in: path
- name: username
- description: The username of the user we want to GET. Use user1 for testing.
- required: true
- type: string
- responses:
- 200:
- description: OK
- patch:
- tags:
- - users
- description: update the user data
- security:
- - basicAuth: []
- parameters:
- - in: path
- name: username
- description: The username of the user we want to GET. Use user1 for testing.
- required: true
- type: string
- - in: body
- name: body
- description: profile or settings parameter(s) to update. Must update only profile XOR settings XOR email
- required: true
- schema:
- $ref: '#/definitions/User'
- responses:
- 200:
- description: OK
- schema:
- $ref: '#/definitions/User'
- delete:
- tags:
- - users
- description: delete user by username
- security:
- - basicAuth: []
- parameters:
- - in: path
- name: username
- description: The username of the user we want to DELETE
- required: true
- type: string
- responses:
- 204:
- description: No Content
- # CRUD tags
- /tags:
- get:
- tags:
- - tags
- description: get list of tags (should be filtered by parameters)
- security:
- - basicAuth: []
- responses:
- 200:
- description: OK
- post:
- tags:
- - tags
- description: create a new tag
- security:
- - basicAuth: []
- parameters:
- - in: body
- name: body
- description: data for creating a new tag
- required: true
- schema:
- $ref: '#/definitions/NewTag'
- responses:
- 201:
- description: Created
- schema:
- $ref: '#/definitions/Tag'
- /tags/{tagname}:
- get:
- tags:
- - tags
- description: get a tag by tagname
- security:
- - basicAuth: []
- parameters:
- - in: path
- name: tagname
- description: The tagname of the tag to get
- required: true
- type: string
- responses:
- 200:
- description: OK
- schema:
- $ref: '#/definitions/Tag'
- 404:
- description: Not Found
- patch:
- tags:
- - tags
- description: update a tag
- parameters:
- - in: body
- name: body
- description: tag object with attributes to update
- required: true
- schema:
- $ref: '#/definitions/Tag'
- - in: path
- name: tagname
- description: The tagname of the tag to update
- required: true
- type: string
- responses:
- 200:
- description: OK
- schema:
- $ref: '#/definitions/Tag'
- 403:
- description: Not Authorized
- 404:
- description: Not Found
- delete:
- tags:
- - tags
- description: delete tag by tagname
- security:
- - basicAuth: []
- parameters:
- - in: path
- name: tagname
- description: The tagname of the tag we want to DELETE
- required: true
- type: string
- responses:
- 204:
- description: No Content
- 403:
- description: Not Authorized
- 404:
- description: Not Found
- definitions:
- User:
- type: object
- required:
- - data
- properties:
- data:
- type: object
- required:
- - id
- - type
- - attributes
- properties:
- id:
- type: string
- description: the username
- type:
- type: string
- enum:
- - users
- attributes:
- type: object
- required:
- - username
- properties:
- username:
- type: string
- description: description
- email:
- type: string
- description: description
- givenName:
- type: string
- description: description
- familyName:
- type: string
- description: description
- description:
- type: string
- description: description
- NewUser:
- type: object
- required:
- - data
- properties:
- data:
- type: object
- required:
- - type
- - attributes
- properties:
- type:
- type: string
- enum:
- - users
- attributes:
- type: object
- required:
- - username
- - email
- - password
- properties:
- username:
- type: string
- email:
- type: string
- password:
- type: string
- Tag:
- type: object
- required:
- - data
- properties:
- data:
- type: object
- required:
- - id
- - type
- - attributes
- properties:
- id:
- type: string
- description: a unique tagname of the tag
- type:
- type: string
- enum:
- - tags
- attributes:
- type: object
- required:
- - tagname
- - description
- properties:
- tagname:
- type: string
- description:
- type: string
- description: description of the tag
- NewTag:
- type: object
- required:
- - data
- properties:
- data:
- type: object
- required:
- - type
- - attributes
- properties:
- type:
- type: string
- enum:
- - tags
- attributes:
- type: object
- required:
- - tagname
- properties:
- tagname:
- type: string
- description:
- type: string
- Error:
- properties:
- code:
- type: integer
- format: int32
- message:
- type: string
- fields:
- type: string
|