swagger: '2.0'
info:
  title: Thingies API
  description: This is a demo API
  contact:
    name: Patrice Krakow
    email: patrice.krakow@gmail.com
  version: 0.1.0
host: api.thingies.io
basePath: /
schemes:
  - https
consumes:
  - application/json
produces:
  - application/json
paths:
  '/thingies':
    post:
      summary: Create a `thingy`
      description: This API endpoint allows you to create a `thingy`.
      parameters:
        - name: Thingy
          in: body
          description: The definition of a `thingy` without the `id` field.
          required: true
          schema:
            $ref: '#/definitions/Thingy'
      responses:
        '201':
          description: The `thingy' has been successfully created.
          schema:
            $ref: '#/definitions/Thingy'
    get:
      summary: List all `thingies`
      description: This API endpoint gives you the list of all `thingies`, without pagination :-|
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/ListOfThingies'
        '404':
          description: There are no `thingies`.
  '/thingies/{thingyId}':
    get:
      summary: Get the details of a specific `thingy`
      description: This API endpoint gives you the details of a specific `thingy`.
      parameters:
        - name: thingyId
          in: path
          description: The identifier of a specific `thingy`.
          required: true
          type: string
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/Thingy'
        '404':
          description: The specified `thingy` does not exist.
    delete:
      summary: Delete a specific `thingy`
      description: This API endpoint allows you to delete a specific `thingy`.
      parameters:
        - name: thingyId
          in: path
          description: The identifier of a specific `thingy`.
          required: true
          type: string
      responses:
        '204':
          description: The specified `thingy`, if it existed, has been deleted.
definitions:
  Thingy:
    type: object
    properties:
      id:
        type: string
      name:
        type: string
      value:
        type: string
    required:
      - name
  ListOfThingies:
    type: array
    items:
      $ref: '#/definitions/Thingy'