openapi: 3.0.0
info:
  title: 'Wishlist API'
  version: 1.0.0
paths:
  /api/catalogs:
    post:
      tags:
        - catalogs
      description: 'Create a new catalog.'
      operationId: 352e7ffbd7b255e4031608d28812038d
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StoreCatalogRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CatalogResource'
  '/api/catalogs/{catalog}':
    get:
      tags:
        - catalogs
      description: 'Show catalog.'
      operationId: d35d30131418d088b1af7ae4813def3b
      parameters:
        -
          name: catalog
          in: path
          description: 'Catalog ID'
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: 'Got it'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CatalogResource'
    put:
      tags:
        - catalogs
      description: 'Update catalog.'
      operationId: f3a71425034fd5d4caae9af99ddf276c
      parameters:
        -
          name: catalog
          in: path
          description: 'Catalog ID'
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCatalogRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CatalogResource'
    delete:
      tags:
        - catalogs
      description: 'Delete catalog.'
      operationId: 67f6f70bd088a42421a2e4b61c06375b
      parameters:
        -
          name: catalog
          in: path
          description: 'Catalog ID'
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Deleted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleResponseResource'
  '/api/guest/wishlists/{wishlist}':
    get:
      tags:
        - guest
      description: 'Get wishlist for guest.'
      operationId: 26a013c40a82f5cf9717cb1b34e1deb6
      parameters:
        -
          name: wishlist
          in: path
          description: 'Wishlist UUID'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 'Got it'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GuestWishlistResource'
  /api:
    get:
      tags:
        - index
      description: 'Get everything.'
      operationId: d48eaaf85369e7fe40800f6d881be65c
      responses:
        '200':
          description: 'Got it'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexResource'
  /api/wishes:
    post:
      tags:
        - wish
      description: 'Create a new wish.'
      operationId: 3d94fa76491e5b29624d29c863f1a643
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StoreWishRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WishResource'
  '/api/wishes/{wish}':
    put:
      tags:
        - wish
      description: 'Update a wish.'
      operationId: 79d1d79860a371f1dfcb797ad50f9783
      parameters:
        -
          name: wish
          in: path
          description: 'Wish ID'
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWishRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WishResource'
    delete:
      tags:
        - wish
      description: 'Delete a wish.'
      operationId: ebc4f193237e5097eb1d9aa22f99b69c
      parameters:
        -
          name: wish
          in: path
          description: 'Wish ID'
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Deleted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleResponseResource'
  /api/wishlists:
    post:
      tags:
        - wishlist
      description: 'Create a new wishlist.'
      operationId: 4bdf63de7775026077073b1069c45f64
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StoreWishlistRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WishlistResource'
  '/api/wishlists/{wishlist}':
    get:
      tags:
        - wishlist
      description: 'Get wishlist.'
      operationId: fad3324b0a554660e4ad61f05d44e9c2
      parameters:
        -
          name: wishlist
          in: path
          description: 'Wishlist ID'
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: 'Got it'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WishlistResource'
    put:
      tags:
        - wishlist
      description: 'Update wishlist.'
      operationId: be08db7856a5eceb38e46d018be5fbe8
      parameters:
        -
          name: wishlist
          in: path
          description: 'Wishlist ID'
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWishlistRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WishlistResource'
    delete:
      tags:
        - wishlist
      description: 'Delete wishlist.'
      operationId: c410f4970c2245247cb42f7aa2f64e9f
      parameters:
        -
          name: wishlist
          in: path
          description: 'Wish ID'
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Deleted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleResponseResource'
  '/api/wishlists/{wishlist}/qr':
    get:
      tags:
        - wishlist
      description: 'Get wishlist as qr.'
      operationId: 5e556affca8ba842ef6d04e9937643c0
      parameters:
        -
          name: wishlist
          in: path
          description: 'Wish ID'
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: File
          content:
            image/svg+xml:
              schema:
                type: string
components:
  schemas:
    StoreCatalogRequest:
      properties:
        name:
          description: 'The name of a catalog.'
          type: string
      type: object
    UpdateCatalogRequest:
      properties:
        name:
          description: 'The name of a catalog.'
          type: string
      type: object
    StoreWishRequest:
      properties:
        name:
          description: 'The name of a wish.'
          type: string
        link:
          description: 'Optional link for a wish.'
          type: string
        wishlist_id:
          type: integer
      type: object
    UpdateWishRequest:
      properties:
        name:
          description: 'The name of a wish.'
          type: string
        link:
          description: 'Optional link for a wish.'
          type: string
        wishlist_id:
          type: integer
      type: object
    StoreWishlistRequest:
      properties:
        name:
          description: 'The name of a wishlist.'
          type: string
        wishlist_id:
          type: integer
          nullable: true
      type: object
    UpdateWishlistRequest:
      properties:
        name:
          description: 'The name of a wishlist.'
          type: string
        wishlist_id:
          type: integer
          nullable: true
      type: object
    CatalogResource:
      properties:
        id:
          type: integer
        name:
          description: 'The name of a wishlist.'
          type: string
        wishlists:
          type: array
          items:
            $ref: '#/components/schemas/WishlistResource'
      type: object
    GuestWishResource:
      properties:
        name:
          description: 'The name of a wish.'
          type: string
        link:
          description: 'Optional link for a wish.'
          type: string
      type: object
    GuestWishlistResource:
      properties:
        name:
          description: 'The name of a wishlist.'
          type: string
        uuid:
          type: string
        wishes:
          type: array
          items:
            $ref: '#/components/schemas/GuestWishResource'
      type: object
    IndexResource:
      properties:
        wishlists:
          type: array
          items:
            $ref: '#/components/schemas/WishlistResource'
        catalogs:
          type: array
          items:
            $ref: '#/components/schemas/CatalogResource'
      type: object
    SimpleResponseResource:
      properties:
        success:
          type: boolean
        message:
          type: string
      type: object
    WishResource:
      properties:
        id:
          type: integer
        name:
          description: 'The name of a wish.'
          type: string
        link:
          description: 'Optional link for a wish.'
          type: string
        wishlist_id:
          type: integer
      type: object
    WishlistResource:
      properties:
        id:
          type: integer
        name:
          description: 'The name of a wishlist.'
          type: string
        catalog_id:
          type: integer
        uuid:
          type: string
        wishes:
          type: array
          items:
            $ref: '#/components/schemas/WishResource'
      type: object
tags:
  -
    name: catalogs
    description: catalogs
  -
    name: guest
    description: guest
  -
    name: index
    description: index
  -
    name: wish
    description: wish
  -
    name: wishlist
    description: wishlist
