openapi: 3.0.0 info: title: "Api Basic Demo" description: "Demo" version: "1.0.0" termsOfService: "" license: name: "Apache 2.0" url: "http://www.apache.org/licenses/LICENSE-2.0.html" security: - bearerAuth: [] servers: - url: "http://{host-port}/ili/" variables: host-port: enum: - localhost:8080 - staging:8000 - preprod default: localhost:8080 paths: /photos: get: summary: Get all photos tags: - Photo responses: 200: description: List of all photos content: application/json: schema: type: array items: $ref: '#/components/schemas/Photo' post: summary: Create a Photo tags: - Photo responses: requestBody: content: application/json: schema: $ref: '#/components/schemas/Photo' /photos/{id}: get: summary: Get the photo with the given id tags: - Photo responses: 200: description: The photo with the given id content: application/json: schema: $ref: '#/components/schemas/Photo' 404: $ref: '#/components/responses/EntityNotFound' put: summary: Update the photo with the given id tags: - Photo requestBody: content: application/json: schema: $ref: '#/components/schemas/Photo' responses: 200: description: The updated photo content: application/json: schema: $ref: '#/components/schemas/Photo' 400: description: Provided photo is invalid 403: $ref: '#/components/responses/NotAllowed' 500: description: The server is unable to update the profile delete: summary: Delete the photo with the given id tags: - Photo responses: 204: description: Photo successfully deleted 403: $ref: '#/components/responses/NotAllowed' 500: description: The server is unable to delete the photo parameters: - name: id in: path schema: type: integer description: login of photo to use required: true /publications: get: summary: Get all publication tags: - Publication responses: 200: description: List of all publications content: application/json: schema: type: array items: $ref: '#/components/schemas/Publication' post: summary: Create a Publication tags: - Publication responses: requestBody: content: application/json: schema: $ref: '#/components/schemas/Publication' /publications/{id}: get: summary: Get the publication with the given id tags: - Publication responses: 200: description: The publication with the given id content: application/json: schema: $ref: '#/components/schemas/Publication' 404: $ref: '#/components/responses/EntityNotFound' put: summary: Update the publication with the given id tags: - Publication requestBody: content: application/json: schema: $ref: '#/components/schemas/Publication' responses: 200: description: The publication profile content: application/json: schema: $ref: '#/components/schemas/Publication' 400: description: Provided publication is invalid 403: $ref: '#/components/responses/NotAllowed' 500: description: The server is unable to update the publication delete: summary: Delete the publication with the given id tags: - Publication responses: 204: description: Publication successfully deleted 403: $ref: '#/components/responses/NotAllowed' 500: description: The server is unable to delete the publication parameters: - name: id in: path schema: type: integer description: login of publication to use required: true /profiles: get: summary: Get all profiles tags: - Profile responses: 200: description: List of all profiles content: application/json: schema: type: array items: $ref: '#/components/schemas/Profile' post: summary: Create a Profile tags: - Profile requestBody: content: application/json: schema: $ref: '#/components/schemas/Profile' example: acc: {id: 1} name: "string" password: "string" type: 0 profileimage: 0 responses: 200: description: The profile newly created content: application/json: schema: $ref: '#/components/schemas/Profile' 500: description: The server is unable to create the Profile /profiles/{id}: get: summary: Get the profile with the given id tags: - Profile responses: 200: description: The profile with the given id content: application/json: schema: $ref: '#/components/schemas/Profile' 404: $ref: '#/components/responses/EntityNotFound' put: summary: Update the user with the given id tags: - Profile requestBody: content: application/json: schema: $ref: '#/components/schemas/Profile' responses: 200: description: The updated profile content: application/json: schema: $ref: '#/components/schemas/Profile' 400: description: Provided profile is invalid 403: $ref: '#/components/responses/NotAllowed' 500: description: The server is unable to update the profile delete: summary: Delete the profile with the given id tags: - Profile responses: 204: description: Profile successfully deleted 403: $ref: '#/components/responses/NotAllowed' 500: description: The server is unable to delete the profile parameters: - name: id in: path schema: type: integer description: login of profile to use required: true /accounts: get: summary: Get all accounts tags: - Account responses: 200: description: List of all accounts content: application/json: schema: type: array items: $ref: '#/components/schemas/Account' example: - name: alice email: alice@gmail.com password: Sli56@p status: 0 - name: bob email: Bob@outlook.fr password: Sli56@ppp status: 0 post: summary: Create a account tags: - Account requestBody: content: application/json: schema: $ref: '#/components/schemas/Account' example: name: alice email: alice@gmail.com password: Sli56@ppp status: 0 responses: 200: description: The account newly created content: application/json: schema: $ref: '#/components/schemas/Account' 500: description: The server is unable to create the account /accounts/{id}: get: summary: Get the account with the given id tags: - Account responses: 200: description: The account with the given id content: application/json: schema: $ref: '#/components/schemas/Account' 404: $ref: '#/components/responses/EntityNotFound' put: summary: Update the account with the given id tags: - Account requestBody: content: application/json: schema: $ref: '#/components/schemas/Account' responses: 200: description: The updated account content: application/json: schema: $ref: '#/components/schemas/Account' 400: description: Provided account is invalid 403: $ref: '#/components/responses/NotAllowed' 500: description: The server is unable to update the account delete: summary: Delete the account with the given id tags: - Account responses: 204: description: Account successfully deleted 403: $ref: '#/components/responses/NotAllowed' 500: description: The server is unable to delete the account parameters: - name: id in: path schema: type: integer description: login of account to use required: true # example: bob /accounts/{id}/profiles: get: summary: Get the profiles account tags: - Account responses: 200: description: The profiles with the given id content: application/json: schema: $ref: '#/components/schemas/Profiles' 404: $ref: '#/components/responses/EntityNotFound' parameters: - name: id in: path schema: type: integer description: login of account to use required: true components: securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: JWT schemas: Profile: type: object required: - name - type - acc_id properties: acc: $ref: '#/components/schemas/Account' name: type: string password: type: string type: type: integer profileImage: type: byte[] Account: type: object required: - name - email - password - status properties: name: type: string email: type: string password: type: string status: type: integer salt: type: byte[] example: name: alice email: alice@gmail.com password: Sli56@ppp status: 0 Photo: type: object required: - name - latitude - longitude - date properties: name: type: string latitude: type: number longitude: type: number date: type: string format: date-time Publication: type: object required: - description - latitude - longitude - profile properties: description: type: string latitude: type: number longitude: type: number publishDate: type: string format: date-time profile: $ref: '#/components/schemas/Profile' account: $ref: '#/components/schemas/Account' photos: type: array items: $ref: '#/components/schemas/Photo' responses: EntityNotFound: description: Requested entity not found NotAllowed: description: You are not allowed to perform this action