/category/{storeid}:
  get:
    tags:
    - category
    description: Return all the customers belong to given store
    operationId: listCategories
    security:
    - bearerAuth: []
    parameters:
    - $ref#storeid: './parameters/storeid.yaml'
    responses:
      $ref#4xx: './responses/4xx.yaml'
      200:
        description: list of category
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/Category'
  post:
    tags:
    - category
    description: Update/Create category
    operationId: saveCategory
    security:
    - bearerAuth: []
    parameters:
    - $ref#storeid: './parameters/storeid.yaml'
    requestBody:
      required: true
      content:
        application/json: 
          schema: 
            $ref: '#/components/schemas/Category'
    responses:
      $ref#4xx: './responses/4xx.yaml'
      $ref#upsert: './responses/20x-upsert.yaml'

/category/{storeid}/itemcount:
  get:
    tags:
    - category
    description: Return the category with id, name and items count
    operationId: listWithItemCount
    security:
    - bearerAuth: []
    parameters:
    - $ref#storeid: './parameters/storeid.yaml'
    responses:
      $ref#4xx: './responses/4xx.yaml'
      200:
        description: all categories with its item count name and id 
        content:
          application/json:
            schema:
              type: array
              items: 
                $ref: '#/components/schemas/CategorySummary'

/category/{storeid}/{id}:
  get:
    tags:
    - category
    description: Return the category with given id
    operationId: loadCategory
    security:
    - bearerAuth: []
    parameters:
    - $ref#storeid: './parameters/storeid.yaml'
    - $ref#id: './parameters/objectid.yaml'
    responses:
      $ref#4xx: './responses/4xx.yaml'
      200:
        description: category detail
        content:
          application/json:
            schema:
              type: object
              properties: 
                value:
                  $ref: '#/components/schemas/Category'
  delete:
    tags:
    - category
    description: Delete a category with given id
    operationId: deleteCategory
    security:
    - bearerAuth: []
    parameters:
    - $ref#storeid: './parameters/storeid.yaml'
    - $ref#id: './parameters/objectid.yaml'
    responses:
      $ref#4xx: './responses/4xx.yaml'
      $ref#204: './responses/204.yaml'

/category/{storeid}/alltypes:
  get:
    tags:
    - category
    description: Return all the category types belong to given store
    operationId: listCategoryTypes
    security:
    - bearerAuth: []
    parameters:
    - $ref#storeid: './parameters/storeid.yaml'
    responses:
      $ref#4xx: './responses/4xx.yaml'
      200:
        description: list of category types
        content:
          application/json:
            schema:
              type: array
              items:
                type: string


/category/{storeid}/allbuckets:
  get:
    tags:
    - category
    description: Return all the category buckets belong to given store
    operationId: listCategoryBuckets
    security:
    - bearerAuth: []
    parameters:
    - $ref#storeid: './parameters/storeid.yaml'
    responses:
      $ref#4xx: './responses/4xx.yaml'
      200:
        description: list of category buckets
        content:
          application/json:
            schema:
              type: array
              items:
                type: string