diff --git a/docs/swagger.yml b/docs/swagger.yml index 44637da..3ee0f46 100644 --- a/docs/swagger.yml +++ b/docs/swagger.yml @@ -3,12 +3,12 @@ info: title: Pairent main backend description: |- This is basic Pairent API specs - termsOfService: http://pairent.io/tos + termsOfService: http://swagger.io/terms/ contact: email: devs@pairent.io license: - name: PSCL # Pairent Source Code License - url: https://pairent.io/license + name: MIT + url: http://www.apache.org/licenses/LICENSE-2.0.html version: INDEV servers: - url: https://pairent.io/api/v3 @@ -31,7 +31,7 @@ paths: description: Get offer data according to access permissions operationId: fetchOffer requestBody: - description: Update an existent pet in the store + description: Authentication data content: application/json: schema: @@ -71,6 +71,64 @@ paths: security: - user_auth: - 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: schemas: FetchRequest: @@ -157,6 +215,59 @@ components: type: object format: object 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: FetchRequest: