feature #11: describe login in openAPI
This commit is contained in:
@@ -13,7 +13,7 @@ paths:
|
||||
post:
|
||||
summary: Create account
|
||||
tags:
|
||||
- login
|
||||
- authentification
|
||||
operationId: register
|
||||
requestBody:
|
||||
$ref: '#/components/requestBodies/RegisterRequest'
|
||||
@@ -26,6 +26,22 @@ paths:
|
||||
example:
|
||||
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJBdXRoZW50aWNhdGlvbiIsImlzcyI6ImRjLXByb2plY3QuZnIiLCJpZCI6ImQ1NDRhNmE4LWJhYjgtNDU2MC05NWIxLThhZjAyMDNkOTEwNCIsImV4cCI6MTU2NzA3Mzc0Mn0.0VTetv8fZFjVgpJ-bwJpidGNHJUOmgj8vuZcZXzwnLa7TtFwcXWvh3bDPYHqB66nmOfXyM57XnHDbmRwtipCag
|
||||
|
||||
/login:
|
||||
post:
|
||||
summary: sign in
|
||||
tags:
|
||||
- authentification
|
||||
operationId: login
|
||||
requestBody:
|
||||
$ref: '#/components/requestBodies/LoginRequest'
|
||||
responses:
|
||||
200:
|
||||
description: return JWT
|
||||
content:
|
||||
text/plain:
|
||||
example:
|
||||
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJBdXRoZW50aWNhdGlvbiIsImlzcyI6ImRjLXByb2plY3QuZnIiLCJpZCI6ImQ1NDRhNmE4LWJhYjgtNDU2MC05NWIxLThhZjAyMDNkOTEwNCIsImV4cCI6MTU2NzA3Mzc0Mn0.0VTetv8fZFjVgpJ-bwJpidGNHJUOmgj8vuZcZXzwnLa7TtFwcXWvh3bDPYHqB66nmOfXyM57XnHDbmRwtipCag
|
||||
|
||||
components:
|
||||
schemas:
|
||||
UUID:
|
||||
@@ -61,7 +77,7 @@ components:
|
||||
example:
|
||||
azerty
|
||||
|
||||
CitizenRespose:
|
||||
CitizenResponse:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/CitizenBase'
|
||||
- type: object
|
||||
@@ -70,7 +86,6 @@ components:
|
||||
$ref: '#/components/schemas/UUID'
|
||||
user:
|
||||
$ref: '#/components/schemas/UserResponse'
|
||||
|
||||
CitizenBase:
|
||||
type: object
|
||||
properties:
|
||||
@@ -102,6 +117,21 @@ components:
|
||||
RegisterRequest:
|
||||
$ref: '#/components/schemas/CitizenRequest'
|
||||
|
||||
LoginRequest:
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
description: username
|
||||
required: true
|
||||
example:
|
||||
john-doe
|
||||
password:
|
||||
type: string
|
||||
description: Pasword
|
||||
required: true
|
||||
example:
|
||||
azerty
|
||||
|
||||
requestBodies:
|
||||
RegisterRequest:
|
||||
content:
|
||||
@@ -114,6 +144,17 @@ components:
|
||||
description: Register
|
||||
required: true
|
||||
|
||||
LoginRequest:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/LoginRequest'
|
||||
application/xml:
|
||||
schema:
|
||||
$ref: '#/components/schemas/LoginRequest'
|
||||
description: Login
|
||||
required: true
|
||||
|
||||
# Added by API Auto Mocking Plugin
|
||||
servers:
|
||||
- description: localhost
|
||||
|
||||
Reference in New Issue
Block a user