---
openapi: "3.0.0"
info:
  version: 1.0.0
  title: Boxes API
  description: Home inventory system
  termsOfService: https://phrye.com
  contact:
    name: Kevin Lyda
    email: kevin@lyda.ie
    url: https://git.lyda.ie/kevin/boxes/
  license:
    name: MIT
servers:
  - url: https://localhost:8080/
paths:

  /locations:
    get:
      summary: Locations
      description: Get a list of locations.
      operationId: GetLocations
      responses:
        '200':
          $ref: '#/components/responses/Locations'
        '403':
          $ref: '#/components/responses/Error'

components:
  schemas:
    Location:
      type: object
      properties:
        id:
          type: string
        description:
          type: string

  responses:
    Locations:
      description: List of locations.
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/Location'

    Error:
      description: Error message.
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: integer
              message:
                type: string
