Files
goaresv3/docs/swagger.yaml
Beyhan Oğur b6e74bd024 first commit
2026-04-26 21:41:46 +03:00

2286 lines
53 KiB
YAML

basePath: /
definitions:
controllers.LoginRequest:
properties:
email:
type: string
password:
type: string
required:
- email
- password
type: object
controllers.RefreshRequest:
properties:
refresh_token:
type: string
required:
- refresh_token
type: object
controllers.RegisterRequest:
properties:
confirm_password:
minLength: 8
type: string
email:
type: string
password:
minLength: 8
type: string
username:
maxLength: 50
minLength: 3
type: string
required:
- confirm_password
- email
- password
- username
type: object
controllers.UpsertCartItemRequest:
properties:
product_id:
type: integer
quantity:
minimum: 1
type: integer
required:
- product_id
- quantity
type: object
controllers.UpsertCategoryRequest:
properties:
description:
type: string
parent_id:
type: integer
slug:
maxLength: 254
type: string
title:
maxLength: 254
type: string
required:
- slug
- title
type: object
controllers.UpsertCorsBlacklistRequest:
properties:
created_by:
maxLength: 255
type: string
is_active:
type: boolean
origin:
maxLength: 255
type: string
reason:
maxLength: 255
type: string
required:
- origin
type: object
controllers.UpsertCorsWhitelistRequest:
properties:
created_by:
maxLength: 255
type: string
description:
maxLength: 255
type: string
is_active:
type: boolean
origin:
maxLength: 255
type: string
required:
- origin
type: object
controllers.UpsertHeroRequest:
properties:
color:
maxLength: 32
type: string
format:
maxLength: 10
type: string
height:
type: integer
image:
maxLength: 254
type: string
is_active:
type: boolean
quality:
type: integer
text1:
maxLength: 254
type: string
text2:
maxLength: 254
type: string
text4:
maxLength: 254
type: string
text5:
maxLength: 254
type: string
title:
maxLength: 254
type: string
width:
type: integer
required:
- color
type: object
controllers.UpsertPostRequest:
properties:
category_ids:
items:
type: integer
type: array
content:
type: string
format:
maxLength: 10
type: string
height:
type: integer
images:
type: string
images_mid:
type: string
images_min:
type: string
quality:
type: integer
slug:
maxLength: 254
type: string
tag_ids:
items:
type: integer
type: array
title:
maxLength: 254
type: string
width:
type: integer
required:
- images
- images_mid
- images_min
- slug
- title
type: object
controllers.UpsertProductCategoryRequest:
properties:
description:
type: string
keywords:
type: string
parent_id:
type: integer
slug:
maxLength: 254
type: string
title:
maxLength: 254
type: string
required:
- slug
- title
type: object
controllers.UpsertProductRequest:
properties:
category_ids:
items:
type: integer
type: array
content:
type: string
format:
maxLength: 10
type: string
height:
type: integer
images:
type: string
price:
type: number
quality:
type: integer
slug:
maxLength: 254
type: string
tag_ids:
items:
type: integer
type: array
title:
maxLength: 254
type: string
width:
type: integer
required:
- images
- slug
- title
type: object
controllers.UpsertProductTagRequest:
properties:
name:
maxLength: 254
type: string
required:
- name
type: object
controllers.UpsertRateLimitRequest:
properties:
description:
maxLength: 255
type: string
is_active:
type: boolean
max_requests:
minimum: 1
type: integer
name:
maxLength: 100
type: string
updated_by:
maxLength: 255
type: string
window_seconds:
minimum: 1
type: integer
required:
- max_requests
- name
- window_seconds
type: object
controllers.UpsertSettingRequest:
properties:
address:
type: string
b_format:
maxLength: 10
type: string
b_height:
type: integer
b_logo:
type: string
b_quality:
type: integer
b_width:
type: integer
copyright:
maxLength: 254
type: string
email:
maxLength: 254
type: string
facebook:
maxLength: 254
type: string
instagram:
maxLength: 254
type: string
is_active:
type: boolean
linkedin:
maxLength: 254
type: string
map_embed:
type: string
meta_description:
maxLength: 254
type: string
meta_title:
maxLength: 254
type: string
phone:
maxLength: 254
type: string
pinterest:
maxLength: 254
type: string
slogan:
maxLength: 254
type: string
title:
maxLength: 254
type: string
url:
maxLength: 254
type: string
w_format:
maxLength: 10
type: string
w_height:
type: integer
w_logo:
type: string
w_quality:
type: integer
w_width:
type: integer
whatsapp:
maxLength: 254
type: string
x:
maxLength: 254
type: string
required:
- email
- meta_description
- meta_title
- phone
- title
- url
type: object
controllers.UpsertTagRequest:
properties:
name:
maxLength: 254
type: string
required:
- name
type: object
info:
contact: {}
description: Authentication API for goaresv3.
title: goaresv3 API
version: "1.0"
paths:
/api/v1/auth/github/callback:
get:
description: Exchanges GitHub code and returns local access/refresh tokens.
parameters:
- description: oauth state
in: query
name: state
required: true
type: string
- description: authorization code
in: query
name: code
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"401":
description: Unauthorized
schema:
additionalProperties:
type: string
type: object
"503":
description: Service Unavailable
schema:
additionalProperties:
type: string
type: object
summary: GitHub OAuth callback
tags:
- Auth
/api/v1/auth/github/login:
get:
description: Returns GitHub authorization URL and sets state cookie for CSRF
protection.
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
"503":
description: Service Unavailable
schema:
additionalProperties:
type: string
type: object
summary: Start GitHub OAuth login
tags:
- Auth
/api/v1/auth/google/callback:
get:
description: Exchanges Google code and returns local access/refresh tokens.
parameters:
- description: oauth state
in: query
name: state
required: true
type: string
- description: authorization code
in: query
name: code
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"401":
description: Unauthorized
schema:
additionalProperties:
type: string
type: object
"503":
description: Service Unavailable
schema:
additionalProperties:
type: string
type: object
summary: Google OAuth callback
tags:
- Auth
/api/v1/auth/google/login:
get:
description: Returns Google authorization URL and sets state cookie for CSRF
protection.
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
"503":
description: Service Unavailable
schema:
additionalProperties:
type: string
type: object
summary: Start Google OAuth login
tags:
- Auth
/api/v1/auth/login:
post:
consumes:
- application/json
description: Returns access and refresh tokens.
parameters:
- description: login payload
in: body
name: request
required: true
schema:
$ref: '#/definitions/controllers.LoginRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"401":
description: Unauthorized
schema:
additionalProperties:
type: string
type: object
summary: Login with email/password
tags:
- Auth
/api/v1/auth/refresh:
post:
consumes:
- application/json
description: Exchanges a valid refresh token for a new access token.
parameters:
- description: refresh payload
in: body
name: request
required: true
schema:
$ref: '#/definitions/controllers.RefreshRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"401":
description: Unauthorized
schema:
additionalProperties:
type: string
type: object
summary: Refresh access token
tags:
- Auth
/api/v1/auth/register:
post:
consumes:
- application/json
description: Creates a user and sends an email verification link.
parameters:
- description: register payload
in: body
name: request
required: true
schema:
$ref: '#/definitions/controllers.RegisterRequest'
produces:
- application/json
responses:
"201":
description: Created
schema:
additionalProperties: true
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"409":
description: Conflict
schema:
additionalProperties:
type: string
type: object
summary: Register a new user
tags:
- Auth
/api/v1/auth/verify-email:
get:
description: Activates account using email verification token.
parameters:
- description: email verification token
in: query
name: token
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
summary: Verify email address
tags:
- Auth
/api/v1/blog/categories:
get:
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
additionalProperties: true
type: object
type: array
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
summary: List blog categories
tags:
- Blog
post:
consumes:
- application/json
parameters:
- description: category payload
in: body
name: request
required: true
schema:
$ref: '#/definitions/controllers.UpsertCategoryRequest'
produces:
- application/json
responses:
"201":
description: Created
schema:
additionalProperties: true
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"409":
description: Conflict
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Create blog category
tags:
- Blog
/api/v1/blog/categories/{id}:
delete:
parameters:
- description: category id
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"404":
description: Not Found
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Delete blog category
tags:
- Blog
put:
consumes:
- application/json
parameters:
- description: category id
in: path
name: id
required: true
type: integer
- description: category payload
in: body
name: request
required: true
schema:
$ref: '#/definitions/controllers.UpsertCategoryRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"404":
description: Not Found
schema:
additionalProperties:
type: string
type: object
"409":
description: Conflict
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Update blog category
tags:
- Blog
/api/v1/blog/posts:
get:
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
additionalProperties: true
type: object
type: array
summary: List blog posts
tags:
- Blog
post:
consumes:
- application/json
parameters:
- description: post payload
in: body
name: request
required: true
schema:
$ref: '#/definitions/controllers.UpsertPostRequest'
produces:
- application/json
responses:
"201":
description: Created
schema:
additionalProperties: true
type: object
security:
- BearerAuth: []
summary: Create blog post
tags:
- Blog
/api/v1/blog/posts/{id}:
delete:
parameters:
- description: post id
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Delete blog post
tags:
- Blog
get:
parameters:
- description: post id
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
"404":
description: Not Found
schema:
additionalProperties:
type: string
type: object
summary: Get blog post
tags:
- Blog
put:
consumes:
- application/json
parameters:
- description: post id
in: path
name: id
required: true
type: integer
- description: post payload
in: body
name: request
required: true
schema:
$ref: '#/definitions/controllers.UpsertPostRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
security:
- BearerAuth: []
summary: Update blog post
tags:
- Blog
/api/v1/blog/tags:
get:
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
additionalProperties: true
type: object
type: array
summary: List blog tags
tags:
- Blog
post:
consumes:
- application/json
parameters:
- description: tag payload
in: body
name: request
required: true
schema:
$ref: '#/definitions/controllers.UpsertTagRequest'
produces:
- application/json
responses:
"201":
description: Created
schema:
additionalProperties: true
type: object
security:
- BearerAuth: []
summary: Create blog tag
tags:
- Blog
/api/v1/blog/tags/{id}:
delete:
parameters:
- description: tag id
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Delete blog tag
tags:
- Blog
put:
consumes:
- application/json
parameters:
- description: tag id
in: path
name: id
required: true
type: integer
- description: tag payload
in: body
name: request
required: true
schema:
$ref: '#/definitions/controllers.UpsertTagRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
security:
- BearerAuth: []
summary: Update blog tag
tags:
- Blog
/api/v1/me:
get:
description: Returns user_id, email and username from the authenticated user.
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
"401":
description: Unauthorized
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Get current user info
tags:
- User
/api/v1/settings:
get:
description: Returns the latest settings record.
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
"404":
description: Not Found
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
summary: Get global setting
tags:
- Settings
put:
consumes:
- application/json
description: Creates the first setting record if none exists, otherwise updates
the latest one.
parameters:
- description: setting payload
in: body
name: request
required: true
schema:
$ref: '#/definitions/controllers.UpsertSettingRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
"201":
description: Created
schema:
additionalProperties: true
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Create or update global setting
tags:
- Settings
/api/v1/settings/cors/blacklist:
get:
description: Returns all CORS blacklist records.
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
additionalProperties: true
type: object
type: array
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: List CORS blacklist items
tags:
- Settings
post:
consumes:
- application/json
description: Creates a new blacklist origin.
parameters:
- description: cors blacklist payload
in: body
name: request
required: true
schema:
$ref: '#/definitions/controllers.UpsertCorsBlacklistRequest'
produces:
- application/json
responses:
"201":
description: Created
schema:
additionalProperties: true
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"409":
description: Conflict
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Create CORS blacklist item
tags:
- Settings
/api/v1/settings/cors/blacklist/{id}:
delete:
description: Deletes a blacklist origin by id.
parameters:
- description: blacklist id
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"404":
description: Not Found
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Delete CORS blacklist item
tags:
- Settings
put:
consumes:
- application/json
description: Updates a blacklist origin by id.
parameters:
- description: blacklist id
in: path
name: id
required: true
type: integer
- description: cors blacklist payload
in: body
name: request
required: true
schema:
$ref: '#/definitions/controllers.UpsertCorsBlacklistRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"404":
description: Not Found
schema:
additionalProperties:
type: string
type: object
"409":
description: Conflict
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Update CORS blacklist item
tags:
- Settings
/api/v1/settings/cors/whitelist:
get:
description: Returns all CORS whitelist records.
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
additionalProperties: true
type: object
type: array
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: List CORS whitelist items
tags:
- Settings
post:
consumes:
- application/json
description: Creates a new whitelist origin.
parameters:
- description: cors whitelist payload
in: body
name: request
required: true
schema:
$ref: '#/definitions/controllers.UpsertCorsWhitelistRequest'
produces:
- application/json
responses:
"201":
description: Created
schema:
additionalProperties: true
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"409":
description: Conflict
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Create CORS whitelist item
tags:
- Settings
/api/v1/settings/cors/whitelist/{id}:
delete:
description: Deletes a whitelist origin by id.
parameters:
- description: whitelist id
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"404":
description: Not Found
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Delete CORS whitelist item
tags:
- Settings
put:
consumes:
- application/json
description: Updates a whitelist origin by id.
parameters:
- description: whitelist id
in: path
name: id
required: true
type: integer
- description: cors whitelist payload
in: body
name: request
required: true
schema:
$ref: '#/definitions/controllers.UpsertCorsWhitelistRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"404":
description: Not Found
schema:
additionalProperties:
type: string
type: object
"409":
description: Conflict
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Update CORS whitelist item
tags:
- Settings
/api/v1/settings/heroes:
get:
description: Returns all hero records ordered by id desc.
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
additionalProperties: true
type: object
type: array
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
summary: List heroes
tags:
- Settings
post:
consumes:
- application/json
description: Creates a new hero record.
parameters:
- description: hero payload
in: body
name: request
required: true
schema:
$ref: '#/definitions/controllers.UpsertHeroRequest'
produces:
- application/json
responses:
"201":
description: Created
schema:
additionalProperties: true
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Create hero
tags:
- Settings
/api/v1/settings/heroes/{id}:
delete:
description: Deletes a hero by id.
parameters:
- description: hero id
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"404":
description: Not Found
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Delete hero
tags:
- Settings
put:
consumes:
- application/json
description: Updates a hero by id.
parameters:
- description: hero id
in: path
name: id
required: true
type: integer
- description: hero payload
in: body
name: request
required: true
schema:
$ref: '#/definitions/controllers.UpsertHeroRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"404":
description: Not Found
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Update hero
tags:
- Settings
/api/v1/settings/rate-limits:
get:
description: Returns all rate-limit settings.
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
additionalProperties: true
type: object
type: array
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: List rate limits
tags:
- Settings
post:
consumes:
- application/json
description: Creates a new rate-limit setting.
parameters:
- description: rate limit payload
in: body
name: request
required: true
schema:
$ref: '#/definitions/controllers.UpsertRateLimitRequest'
produces:
- application/json
responses:
"201":
description: Created
schema:
additionalProperties: true
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"409":
description: Conflict
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Create rate limit
tags:
- Settings
/api/v1/settings/rate-limits/{id}:
delete:
description: Deletes a rate-limit setting by id.
parameters:
- description: rate limit id
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"404":
description: Not Found
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Delete rate limit
tags:
- Settings
put:
consumes:
- application/json
description: Updates a rate-limit setting by id.
parameters:
- description: rate limit id
in: path
name: id
required: true
type: integer
- description: rate limit payload
in: body
name: request
required: true
schema:
$ref: '#/definitions/controllers.UpsertRateLimitRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"404":
description: Not Found
schema:
additionalProperties:
type: string
type: object
"409":
description: Conflict
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Update rate limit
tags:
- Settings
/api/v1/shop/cart:
get:
description: Returns the authenticated user's cart with items.
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Get my cart
tags:
- Shop
/api/v1/shop/cart/items:
post:
consumes:
- application/json
description: Creates or increments a cart item for authenticated user.
parameters:
- description: cart item payload
in: body
name: request
required: true
schema:
$ref: '#/definitions/controllers.UpsertCartItemRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
"201":
description: Created
schema:
additionalProperties: true
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Add item to my cart
tags:
- Shop
/api/v1/shop/cart/items/{itemId}:
delete:
description: Deletes a cart item owned by authenticated user.
parameters:
- description: cart item id
in: path
name: itemId
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"404":
description: Not Found
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Delete item from my cart
tags:
- Shop
put:
consumes:
- application/json
description: Updates a cart item owned by authenticated user.
parameters:
- description: cart item id
in: path
name: itemId
required: true
type: integer
- description: cart item payload
in: body
name: request
required: true
schema:
$ref: '#/definitions/controllers.UpsertCartItemRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"404":
description: Not Found
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Update my cart item
tags:
- Shop
/api/v1/shop/categories:
get:
description: Returns all categories with children.
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
additionalProperties: true
type: object
type: array
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
summary: List product categories
tags:
- Shop
post:
consumes:
- application/json
description: Creates a new shop category.
parameters:
- description: category payload
in: body
name: request
required: true
schema:
$ref: '#/definitions/controllers.UpsertProductCategoryRequest'
produces:
- application/json
responses:
"201":
description: Created
schema:
additionalProperties: true
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"409":
description: Conflict
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Create product category
tags:
- Shop
/api/v1/shop/categories/{id}:
delete:
description: Deletes a category by id.
parameters:
- description: category id
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"404":
description: Not Found
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Delete product category
tags:
- Shop
put:
consumes:
- application/json
description: Updates a category by id.
parameters:
- description: category id
in: path
name: id
required: true
type: integer
- description: category payload
in: body
name: request
required: true
schema:
$ref: '#/definitions/controllers.UpsertProductCategoryRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"404":
description: Not Found
schema:
additionalProperties:
type: string
type: object
"409":
description: Conflict
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Update product category
tags:
- Shop
/api/v1/shop/products:
get:
description: Returns all products with categories and tags.
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
additionalProperties: true
type: object
type: array
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
summary: List products
tags:
- Shop
post:
consumes:
- application/json
description: Creates a new product and assigns category/tag relations.
parameters:
- description: product payload
in: body
name: request
required: true
schema:
$ref: '#/definitions/controllers.UpsertProductRequest'
produces:
- application/json
responses:
"201":
description: Created
schema:
additionalProperties: true
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"409":
description: Conflict
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Create product
tags:
- Shop
/api/v1/shop/products/{id}:
delete:
description: Deletes a product by id.
parameters:
- description: product id
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"404":
description: Not Found
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Delete product
tags:
- Shop
get:
description: Returns product details by id.
parameters:
- description: product id
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"404":
description: Not Found
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
summary: Get product
tags:
- Shop
put:
consumes:
- application/json
description: Updates a product and reassigns category/tag relations.
parameters:
- description: product id
in: path
name: id
required: true
type: integer
- description: product payload
in: body
name: request
required: true
schema:
$ref: '#/definitions/controllers.UpsertProductRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"404":
description: Not Found
schema:
additionalProperties:
type: string
type: object
"409":
description: Conflict
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Update product
tags:
- Shop
/api/v1/shop/tags:
get:
description: Returns all product tags.
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
additionalProperties: true
type: object
type: array
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
summary: List product tags
tags:
- Shop
post:
consumes:
- application/json
description: Creates a new product tag.
parameters:
- description: tag payload
in: body
name: request
required: true
schema:
$ref: '#/definitions/controllers.UpsertProductTagRequest'
produces:
- application/json
responses:
"201":
description: Created
schema:
additionalProperties: true
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"409":
description: Conflict
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Create product tag
tags:
- Shop
/api/v1/shop/tags/{id}:
delete:
description: Deletes a tag by id.
parameters:
- description: tag id
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"404":
description: Not Found
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Delete product tag
tags:
- Shop
put:
consumes:
- application/json
description: Updates a tag by id.
parameters:
- description: tag id
in: path
name: id
required: true
type: integer
- description: tag payload
in: body
name: request
required: true
schema:
$ref: '#/definitions/controllers.UpsertProductTagRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"404":
description: Not Found
schema:
additionalProperties:
type: string
type: object
"409":
description: Conflict
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Update product tag
tags:
- Shop
schemes:
- http
- https
securityDefinitions:
BearerAuth:
description: 'Paste the access token. Swagger UI sends it as: Bearer <token>'
in: header
name: Authorization
type: apiKey
swagger: "2.0"