v2.0.0: doc: add swagger from code
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
da4f296b5e
commit
ee4e2e3e31
8 changed files with 502 additions and 3 deletions
75
cmd/docs/swagger.yaml
Normal file
75
cmd/docs/swagger.yaml
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
definitions:
|
||||
logins.RequestLogin:
|
||||
properties:
|
||||
password:
|
||||
type: string
|
||||
username:
|
||||
type: string
|
||||
type: object
|
||||
logins.ResponseLogin:
|
||||
properties:
|
||||
publickey:
|
||||
type: string
|
||||
token:
|
||||
type: string
|
||||
type: object
|
||||
info:
|
||||
contact:
|
||||
email: support@swagger.io
|
||||
name: API Support
|
||||
url: http://www.swagger.io/support
|
||||
license:
|
||||
name: Apache 2.0
|
||||
url: http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
termsOfService: http://swagger.io/terms/
|
||||
title: Users
|
||||
version: "1.0"
|
||||
paths:
|
||||
/:
|
||||
delete:
|
||||
description: Cette route permet de revoker sont token
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
type: string
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
tags:
|
||||
- auth
|
||||
get:
|
||||
description: Cette route de verifier que le token est toujours valide
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
type: string
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
tags:
|
||||
- auth
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Cette route permet d'obtenir un token user
|
||||
parameters:
|
||||
- description: request body
|
||||
in: body
|
||||
name: request
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/logins.RequestLogin'
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/logins.ResponseLogin'
|
||||
tags:
|
||||
- auth
|
||||
securityDefinitions:
|
||||
ApiKeyAuth:
|
||||
description: 'Enter the token with the `Bearer: ` prefix, e.g. "Bearer abcde12345".'
|
||||
in: header
|
||||
name: Authorization
|
||||
type: apiKey
|
||||
swagger: "2.0"
|
||||
Loading…
Add table
Add a link
Reference in a new issue