paths:
  /cars:
    get:
      tags:
        - Cars
      summary: Get all cars
      parameters:
        - in: query
          name: brand
          schema:
            type: string
          description: Filter by brand
      responses:
        200:
          description: A list of cars
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Car'

    post:
      tags:
        - Cars
      summary: Create a new car
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Car'
      responses:
        201:
          description: Car created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Car'

  /cars/{id}:
    get:
      tags:
        - Cars
      summary: Get a car by ID
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        200:
          description: A car object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Car'
        404:
          description: Car not found

    put:
      tags:
        - Cars
      summary: Update a car
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Car'
      responses:
        200:
          description: Car updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Car'

    delete:
      tags:
        - Cars
      summary: Delete a car
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        204:
          description: Car deleted successfully