appidea-restapi/swagger.yaml

124 lines
2.9 KiB
YAML

basePath: /api/v1/
consumes:
- application/json
info:
contact:
email: alex@roese.dev
name: Alex
description: |-
Example Swagger spec.
Schemes: [http, https]
title: App-Idea Rest-API Documentation
version: 0.0.1
paths:
/user:
get:
operationId: user
parameters:
- description: Example -> { "v"; ["name", "state", "language_id"] }
in: query
name: v
required: true
type: string
responses:
"200":
description: User informations
"400":
description: Values wrong format
summary: Informations about the user (except password)
tags:
- User
/user/activate/{id}:
post:
operationId: activation
parameters:
- description: activation id
in: query
name: id
required: true
type: string
responses:
"200":
description: User was activated
"401":
description: Activation Id is incorrect or expired
summary: Activate user
tags:
- User
/user/login:
post:
operationId: userLogin
parameters:
- description: username or email
in: query
name: username or email
required: true
type: string
- description: password (base64) of the user
in: query
name: password
required: true
type: string
produces:
- application/json
responses:
"200":
description: login success
"401":
description: login credentials not correct
summary: Login a user
tags:
- User
/users:
post:
operationId: user
parameters:
- description: username of the user (length 3-30)
in: query
name: username
required: true
type: string
- description: email of the user (length 3-255)
in: query
name: email
required: true
type: string
- description: password (base64) of the user (length 6-250)
in: query
name: password
required: true
type: string
- description: hashtag of the client (length 2-6, UPPERCASE (Letters, Numbers))
in: query
name: hashtag
type: string
- description: avatar url of the client
in: query
name: avatar_url
type: string
- description: location of the client (length 1-20) (for example Frankfurt)
in: query
name: location
type: string
produces:
- application/json
responses:
"201":
$ref: '#/definitions/User'
"400":
description: format is not correct
"422":
description: username, email or/and hashtag already assigned
summary: Create new user
tags:
- User
produces:
- application/json
securityDefinitions:
api_key:
in: header
name: Authorization
type: apiKey
swagger: "2.0"