251 lines
6 KiB
YAML
251 lines
6 KiB
YAML
basePath: /api/v2
|
|
definitions:
|
|
merch.deleteOriginDTO:
|
|
properties:
|
|
name:
|
|
type: string
|
|
type: object
|
|
merch.merchDTO:
|
|
properties:
|
|
created_at:
|
|
type: string
|
|
merch_uuid:
|
|
type: string
|
|
name:
|
|
type: string
|
|
updated_at:
|
|
type: string
|
|
type: object
|
|
merch.newMerchDTO:
|
|
properties:
|
|
links:
|
|
items:
|
|
$ref: '#/definitions/merch.originLink'
|
|
type: array
|
|
name:
|
|
type: string
|
|
type: object
|
|
merch.newOriginDTO:
|
|
properties:
|
|
name:
|
|
type: string
|
|
type: object
|
|
merch.originItem:
|
|
properties:
|
|
id:
|
|
type: integer
|
|
name:
|
|
type: string
|
|
type: object
|
|
merch.originLink:
|
|
properties:
|
|
origin_link:
|
|
type: string
|
|
origin_name:
|
|
type: string
|
|
type: object
|
|
merch.originsDTO:
|
|
properties:
|
|
origins:
|
|
items:
|
|
$ref: '#/definitions/merch.originItem'
|
|
type: array
|
|
type: object
|
|
responses.BadRequest:
|
|
properties:
|
|
error:
|
|
example: error
|
|
type: string
|
|
type: object
|
|
responses.InternalServerError:
|
|
properties:
|
|
error:
|
|
example: error
|
|
type: string
|
|
type: object
|
|
responses.Unauthorized:
|
|
properties:
|
|
error:
|
|
example: error
|
|
type: string
|
|
type: object
|
|
info:
|
|
contact: {}
|
|
description: Stores data about merch and prices
|
|
title: Merch API
|
|
version: "2.3"
|
|
paths:
|
|
/merch/{uuid}:
|
|
delete:
|
|
consumes:
|
|
- application/json
|
|
description: Marks merch and all its extra data as deleted by uuid.
|
|
parameters:
|
|
- description: merch uuid
|
|
in: path
|
|
name: uuid
|
|
required: true
|
|
type: string
|
|
responses:
|
|
"204":
|
|
description: No Content
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/responses.BadRequest'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/responses.Unauthorized'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/responses.InternalServerError'
|
|
summary: Delete merch
|
|
tags:
|
|
- Merch
|
|
/merch/create:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Create new merch
|
|
parameters:
|
|
- description: merch body
|
|
in: body
|
|
name: merch
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/merch.newMerchDTO'
|
|
responses:
|
|
"201":
|
|
description: Created
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/responses.BadRequest'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/responses.Unauthorized'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/responses.InternalServerError'
|
|
summary: Create new merch
|
|
tags:
|
|
- Merch
|
|
/merch/list:
|
|
get:
|
|
description: Get all merch without origins
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
items:
|
|
$ref: '#/definitions/merch.merchDTO'
|
|
type: array
|
|
"204":
|
|
description: No Content
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/responses.BadRequest'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/responses.Unauthorized'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/responses.InternalServerError'
|
|
summary: Get all merch
|
|
tags:
|
|
- Merch
|
|
/merch/origins:
|
|
delete:
|
|
consumes:
|
|
- application/json
|
|
description: Marks origin as deleted by name.
|
|
parameters:
|
|
- description: origin body
|
|
in: body
|
|
name: origin
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/merch.deleteOriginDTO'
|
|
responses:
|
|
"204":
|
|
description: No Content
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/responses.BadRequest'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/responses.Unauthorized'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/responses.InternalServerError'
|
|
summary: Delete origin
|
|
tags:
|
|
- Origins
|
|
get:
|
|
description: Get all origins
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/merch.originsDTO'
|
|
"204":
|
|
description: No Content
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/responses.BadRequest'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/responses.Unauthorized'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/responses.InternalServerError'
|
|
summary: Get all origins
|
|
tags:
|
|
- Origins
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Create new origin with name
|
|
parameters:
|
|
- description: origin body
|
|
in: body
|
|
name: origin
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/merch.newOriginDTO'
|
|
responses:
|
|
"201":
|
|
description: Created
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/responses.BadRequest'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/responses.Unauthorized'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/responses.InternalServerError'
|
|
summary: Create new origin
|
|
tags:
|
|
- Origins
|
|
swagger: "2.0"
|