openapi: 3.0.3
info:
  title: Swagger real-estate-ads - OpenAPI 3.0
  description: |-
    Bienvenue sur notre plateforme d'annonces immobilières, basée sur la spécification OpenAPI 3.0. Vous trouverez ici une variété d'annonces pour des propriétés immobilières, qu'il s'agisse de ventes ou de locations. Notre API est conçue pour faciliter la recherche, la publication et la gestion d'annonces de biens immobiliers.
    Que vous soyez un utilisateur en quête de la maison de vos rêves ou un annonceur cherchant à promouvoir votre propriété, notre API vous offre des fonctionnalités avancées pour simplifier le processus. Vous pouvez contribuer à l'amélioration de notre API en proposant des modifications à la définition ou au code, ce qui nous permettra de continuer à améliorer l'expérience des utilisateurs et d'intégrer de nouvelles fonctionnalités liées à l'immobilier.
    Explorez notre API pour découvrir comment elle peut répondre à vos besoins en matière d'annonces immobilières. Que vous cherchiez à acheter, vendre ou louer une propriété, nous sommes là pour vous simplifier la tâche et rendre votre expérience aussi fluide que possible.
  termsOfService: http://swagger.io/terms/
  contact:
    email: apiteam@swagger.io
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: 1.0.11
externalDocs:
  description: Find out more about Swagger
  url: http://swagger.io
servers:
  - url: http://localhost:8080
tags:
  - name: ad
    description: Everything about your ads
    externalDocs:
      description: Find out more
      url: http://swagger.io
  - name: user
    description: Operations about user
paths:
  /ad:
    post:
      tags:
        - ad
      summary: Add a new ad
      description: Add a new ad to the list
      operationId: addAd
      requestBody:
        description: Create a new ad in the
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Ad'
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Ad'
        "405":
          description: Invalid input
      security:
        - real-estate-ads_auth:
            - write:ads
            - read:ads
      x-swagger-router-controller: Ad
  /user:
    post:
      tags:
        - user
      summary: Create user
      description: This can only be done by the logged in user.
      operationId: createUser
      requestBody:
        description: Created user object
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/User'
          application/xml:
            schema:
              $ref: '#/components/schemas/User'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/User'
      responses:
        default:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
          application/xml:
            schema:
              $ref: '#/components/schemas/User'
      x-swagger-router-controller: User
  /user/login:
    get:
      tags:
        - user
      summary: Logs user into the system
      description: ""
      operationId: loginUser
      parameters:
      - name: username
        in: query
        description: The user name for login
        required: true
        style: form
        explode: true
        schema:
          type: string
      - name: password
        in: query
        description: The password for login in clear text
        required: true
        style: form
        explode: true
        schema:
          type: string
      responses:
        "200":
          description: successful operation
          headers:
            X-Rate-Limit:
              description: calls per hour allowed by the user
              style: simple
              explode: false
              schema:
                type: integer
                format: int32
            X-Expires-After:
              description: date in UTC when token expires
              style: simple
              explode: false
              schema:
                type: string
                format: date-time
          content:
            application/xml:
              schema:
                type: string
                x-content-type: application/xml
          application/json:
            schema:
              type: string
        "400":
          description: Invalid username/password supplied
      x-swagger-router-controller: User
  /user/logout:
    get:
      tags:
        - user
      summary: Logs out current logged in user session
      description: ""
      operationId: logoutUser
      parameters: []
      responses:
        default:
          description: successful operation
      x-swagger-router-controller: User
components:
  schemas:
    Ad:
      type: object
      properties:
        title:
          type: string
        propertyType:
          type: string
          enum:
            - À la vente
            - À la location
        publicationStatus:
          type: string
          enum:
            - Publiée
            - Non publiée
        propertyStatus:
          type: string
          enum:
            - Disponible
            - Loué
            - Vendu
        description:
          type: string
        price:
          type: number
          minimum: 0
        availabilityDate:
          type: string
          format: date-time
        photos:
          type: array
          items:
            type: string
        userName:
          type: string
        questions:
          type: array
          items:
            type: object
            properties:
              user:
                type: string
              question:
                type: string
              answers:
                type: array
                items:
                  type: object
                  properties:
                    answer:
                      type: string
                    date:
                      type: string
                      format: date-time
      required:
        - title
        - propertyType
        - publicationStatus
        - propertyStatus
        - description
        - price
        - availabilityDate
        - userName
    User:
      type: object
      properties:
        username:
          type: string
          example: theUser
        password:
          type: string
          example: "12345"
        isAgent:
          type: boolean
          example: true
      required:
        - username
        - password
        - isAgent
      example:
        password: "12345"
        username: theUser
        isAgent: true
      xml:
        name: user
    Tag:
      type: object
      properties:
        id:
          type: integer
          format: int64
        name:
          type: string
      example:
        name: name
        id: 0
      xml:
        name: tag
    Pet:
      required:
      - name
      - photoUrls
      type: object
      properties:
        id:
          type: integer
          format: int64
          example: 10
        name:
          type: string
          example: doggie
        category:
          $ref: '#/components/schemas/Category'
        photoUrls:
          type: array
          xml:
            wrapped: true
          items:
            type: string
            xml:
              name: photoUrl
        tags:
          type: array
          xml:
            wrapped: true
          items:
            $ref: '#/components/schemas/Tag'
        status:
          type: string
          description: pet status in the store
          enum:
          - available
          - pending
          - sold
      example:
        photoUrls:
        - photoUrls
        - photoUrls
        name: doggie
        id: 10
        category:
          name: Dogs
          id: 1
        tags:
        - name: name
          id: 0
        - name: name
          id: 0
        status: available
      xml:
        name: pet
    ApiResponse:
      type: object
      properties:
        code:
          type: integer
          format: int32
        type:
          type: string
        message:
          type: string
      example:
        code: 0
        type: type
        message: message
      xml:
        name: '##default'
  requestBodies:
    UserArray:
      description: List of user object
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/User'
  securitySchemes:
    real-estate-ads_auth:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://real-estate-ads3.swagger.io/oauth/authorize
          scopes:
            write:pets: modify pets in your account
            read:pets: read your pets
    api_key:
      type: apiKey
      name: api_key
      in: header
