openapi: 3.0.1 info: title: API Gateway service API endpoints description: API Gateway from Message in a Bottle with Microservices version: "0.1" servers: - url: / paths: /: get: tags: [ Home ] summary: Return the home page of the web app responses: 200: description: Renders the index.html template /login: tags: [ Authentication ] get: summary: Shows the login page and its form responses: 200: description: Renders the login.html template post: summary: Handles the login of the user requestBody: required: true content: application/json: schema: type: object properties: email: type: string password: type: string required: - email - password responses: 200: description: Reloads the login.html page with a warning, in case the user credentials were invalid 302: description: Redirects to the correct profile page, depending on the type of the user /relogin: get: tags: [ Authentication ] summary: Utility route used to handle the user's session expiration responses: 200: description: Calls the login method /user/{id}: get: tags: [ Profile ] summary: Shows the profile page of the customer specified by the id parameters: - name: id in: path description: Customer's unique identifier required: true schema: type: integer responses: 200: description: Renders the customer_profile template, filled with the ssn form and the user's reservations 302: description: Redirects to the homepage, in case the user accessing the profile is not its owner put: summary: Updates the fields for the customer depending on its id tags: - Users parameters: - name: id description: User Unique ID in: path required: true schema: type: integer format: int64 requestBody: required: true content: application/json: schema: type: object properties: email: type: string description: the email field for the user password: type: string description: the password field for the user phone: type: string description: the phone field for the user required: - email - password - phone responses: 200: description: Renders the update_customer template, to allow the customer to modify its data 302: description: Redirects to the customer profile page /logout: get: tags: [ Authentication ] summary: Logs out the logged user responses: 302: description: Redirects to the homepage /user/: get: tags: [ User ] summary: This method allows to retrieve the sign up page for a new user parameters: - name: type_ description: type of the user in: path required: true schema: type: string responses: 200: description: Renders the create_user template, filled with the fiels for the user's data post: summary: Add a new customer tags: [ User ] parameters: - name: type_ description: type of the user in: path required: true schema: type: string requestBody: required: true content: application/json: schema: type: object properties: email: type: string description: the email field for the user password: type: string description: the password field for the user social_number: type: string description: the social number field for the user firstname: type: string description: the firstname field for the user lastname: type: string description: the lastname field for the user birthdate: type: string description: the birthday field for the user phone: type: string description: the phone field for the user required: - email - password responses: 302: description: Redirects to the correct profile page, depending on the type of the user /user/{user_id}: delete: tags: [ User ] description: Delete a user by its id parameters: - name: user_id description: User Unique ID in: path required: true schema: type: integer format: int64 responses: 302: description: User deleted, it redirects to the index page