add few more routes
This commit is contained in:
parent
9638619fe2
commit
b2ad00dcca
119
docs/swagger.yml
119
docs/swagger.yml
|
@ -3,12 +3,12 @@ info:
|
||||||
title: Pairent main backend
|
title: Pairent main backend
|
||||||
description: |-
|
description: |-
|
||||||
This is basic Pairent API specs
|
This is basic Pairent API specs
|
||||||
termsOfService: http://pairent.io/tos
|
termsOfService: http://swagger.io/terms/
|
||||||
contact:
|
contact:
|
||||||
email: devs@pairent.io
|
email: devs@pairent.io
|
||||||
license:
|
license:
|
||||||
name: PSCL # Pairent Source Code License
|
name: MIT
|
||||||
url: https://pairent.io/license
|
url: http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
version: INDEV
|
version: INDEV
|
||||||
servers:
|
servers:
|
||||||
- url: https://pairent.io/api/v3
|
- url: https://pairent.io/api/v3
|
||||||
|
@ -31,7 +31,7 @@ paths:
|
||||||
description: Get offer data according to access permissions
|
description: Get offer data according to access permissions
|
||||||
operationId: fetchOffer
|
operationId: fetchOffer
|
||||||
requestBody:
|
requestBody:
|
||||||
description: Update an existent pet in the store
|
description: Authentication data
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
|
@ -71,6 +71,64 @@ paths:
|
||||||
security:
|
security:
|
||||||
- user_auth:
|
- user_auth:
|
||||||
- read:offer
|
- read:offer
|
||||||
|
/offer/edit_offer:
|
||||||
|
post:
|
||||||
|
tags:
|
||||||
|
- Offers
|
||||||
|
requestBody:
|
||||||
|
description: |-
|
||||||
|
Not all fields are required.
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/EditRequest'
|
||||||
|
application/xml:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/EditRequest'
|
||||||
|
application/x-www-form-urlencoded:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/EditRequest'
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: 'Old offer data'
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Offer'
|
||||||
|
application/xml:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Offer'
|
||||||
|
application/x-www-form-urlencoded:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Offer'
|
||||||
|
/users/get_profile_data:
|
||||||
|
post:
|
||||||
|
tags:
|
||||||
|
- Users
|
||||||
|
requestBody:
|
||||||
|
description: |-
|
||||||
|
A simple fetch request, gets someone's profile data according to privacy settings.
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/FetchRequest'
|
||||||
|
parameters:
|
||||||
|
- name: id
|
||||||
|
in: query
|
||||||
|
description: ID of user
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
example: 42
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: 'A user object'
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/User'
|
||||||
|
|
||||||
components:
|
components:
|
||||||
schemas:
|
schemas:
|
||||||
FetchRequest:
|
FetchRequest:
|
||||||
|
@ -157,6 +215,59 @@ components:
|
||||||
type: object
|
type: object
|
||||||
format: object
|
format: object
|
||||||
example: {}
|
example: {}
|
||||||
|
User:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
name:
|
||||||
|
type: object
|
||||||
|
format: object
|
||||||
|
example:
|
||||||
|
properties:
|
||||||
|
firstName: 'Константин'
|
||||||
|
lastName: 'Константинов'
|
||||||
|
middleName: 'Константинович'
|
||||||
|
gender:
|
||||||
|
type: 'string'
|
||||||
|
format: 'string'
|
||||||
|
example: 'M'
|
||||||
|
personality:
|
||||||
|
$ref: '#/components/schemas/Personality'
|
||||||
|
profilePic:
|
||||||
|
type: 'string'
|
||||||
|
format: 'string'
|
||||||
|
example: 'https://cdn.pairent.io/usercontent/USER_ID_HERE/pfp'
|
||||||
|
description:
|
||||||
|
type: 'object'
|
||||||
|
format: 'object'
|
||||||
|
example:
|
||||||
|
userDescription: 'Боюсь WSL и не хочу использовать докеры'
|
||||||
|
Personality:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
TODO:
|
||||||
|
type: string
|
||||||
|
format: string
|
||||||
|
example: 'Make a personality image object'
|
||||||
|
EditRequest:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
api_auth_token:
|
||||||
|
type: string
|
||||||
|
format: string
|
||||||
|
example: Z29ubmEgZ28ga2lsbCBteXNlbGYgVXdV
|
||||||
|
csrf:
|
||||||
|
type: string
|
||||||
|
format: string
|
||||||
|
example: DVMXSNWQmijGiExuOFYQsViJOwpBDnPodLWqGGJCnjTQHGRpxolPDKdtwiGjXDrt
|
||||||
|
new_data:
|
||||||
|
type: object
|
||||||
|
format: object
|
||||||
|
example:
|
||||||
|
fill_this: according to obj_type
|
||||||
|
obj_type:
|
||||||
|
type: string
|
||||||
|
format: string
|
||||||
|
example: "A schema name ('Offer', for example)"
|
||||||
|
|
||||||
requestBodies:
|
requestBodies:
|
||||||
FetchRequest:
|
FetchRequest:
|
||||||
|
|
Loading…
Reference in New Issue