Files
backend/docs/swagger.yaml
2026-04-06 22:57:57 +02:00

153 lines
3.5 KiB
YAML

basePath: /api/v0
definitions:
controllers.EmptyResponse:
type: object
controllers.LoginRequest:
properties:
email:
type: string
password:
type: string
required:
- email
- password
type: object
controllers.RegisterRequest:
properties:
email:
type: string
name:
type: string
password:
type: string
required:
- email
- name
- password
type: object
httputil.HTTPError:
properties:
code:
example: 400
type: integer
message:
example: status bad request
type: string
type: object
externalDocs:
description: OpenAPI
url: https://swagger.io/resources/open-api/
host: localhost:8080
info:
contact:
email: TODO
name: TODO
url: TODO
description: This is harakat backend server.
license:
name: TODO
url: TODO
termsOfService: TODO
title: Harakat Rest-API
version: "0.1"
paths:
/user/login:
post:
consumes:
- application/json
description: Login user
parameters:
- description: user data
in: body
name: user
required: true
schema:
$ref: '#/definitions/controllers.LoginRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/controllers.EmptyResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/httputil.HTTPError'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/httputil.HTTPError'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/httputil.HTTPError'
summary: Login user
tags:
- user
/user/register/{token}:
post:
consumes:
- application/json
description: register user with invite token
parameters:
- description: invite token
in: path
name: token
type: string
- description: user data
in: body
name: user
required: true
schema:
$ref: '#/definitions/controllers.RegisterRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/controllers.EmptyResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/httputil.HTTPError'
"404":
description: Not Found
schema:
$ref: '#/definitions/httputil.HTTPError'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/httputil.HTTPError'
summary: Register user with invite token
tags:
- user
/user/status:
get:
consumes:
- application/json
description: Get user status of current session
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/controllers.EmptyResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/httputil.HTTPError'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/httputil.HTTPError'
summary: User Status
tags:
- user
securityDefinitions:
BasicAuth:
type: basic
swagger: "2.0"