openapi: "3.0.2"
info:
  title: Chasseur de bières
  version: "1.0"
servers:
  - url: http://localhost:80/chasseurdebieres/public/index.php

paths:
  /API/test_connection/{version}:
    get:
      summary: test connexion
      description: Permet de tester la connexion au site
      tags:
        - Services
      parameters:
        - name: version
          in: path
          required: true
  /R_Beer/getBeer/{id}:
    get:
      summary: getBeer
      description: Récupérer les informations d'une bière
      tags:
        - Beer
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
          example: 500
      security:
        - basicAuth: []
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Beer"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
  /R_Beer/create: 
    post:
      summary: create
      description: Création d'une bière
      tags:
        - Beer
      parameters:
        - in: path
          schema:
            $ref: "#/components/schemas/Beer"

      
  /SAS/upload_picture_volley:
    post:
      summary: Importer une image
      tags:
        - Service SAS
    parameters:
      - name: image
        in: path
        required: true
        schema:
          type: string
        description: Image encoder au format teste 64 > Voir application Android
        example: "500"
security:
  - basicAuth: []

components:
  schemas:
    #Object Biere
    Beer:
      type: object
      properties:
        id_beer:
          type: integer
          example: 500
        nom:
          type: string
        description:
          type: string
        id_type:
          type: integer
        brasserie:
          type: string
        pays:
          type: string
        degres:
          type: number
          format: float
        id_user:
          type: integer
        date_cre:
          type: string
        date_upd:
          type: string
        id_picture:
          type: integer
        actif:
          type: integer
        type:
          type: string
        note:
          type: number
          format: float
        tabassage:
          type: integer
        name_picture:
          type: string
        urlPicture:
          type: integer
        pseudo_crea:
          type: string
        urlPicture_crea:
          type: string
        Rates:
          $ref: "#/components/schemas/Rates"

    #Objet AVIS
    Rates:
      type: object
      properties:
        id_user:
          type: integer
        pseudo":
          type: string
        name_p":
          type: string
        tabassage":
          type: integer
        note":
          type: number
          format: float
        commentaire":
          type: string
        tags":
          type: string
        date_r":
          type: string
        date_upd":
          type: string

  securitySchemes:
    basicAuth: # <-- arbitrary name for the security scheme
      type: http
      scheme: basic

  responses:
    UnauthorizedError:
      description: Authentication information is missing or invalid
      headers:
        WWW_Authenticate:
          schema:
            type: string
