feature #11: describe login in openAPI
This commit is contained in:
@@ -13,7 +13,7 @@ paths:
|
|||||||
post:
|
post:
|
||||||
summary: Create account
|
summary: Create account
|
||||||
tags:
|
tags:
|
||||||
- login
|
- authentification
|
||||||
operationId: register
|
operationId: register
|
||||||
requestBody:
|
requestBody:
|
||||||
$ref: '#/components/requestBodies/RegisterRequest'
|
$ref: '#/components/requestBodies/RegisterRequest'
|
||||||
@@ -26,6 +26,22 @@ paths:
|
|||||||
example:
|
example:
|
||||||
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJBdXRoZW50aWNhdGlvbiIsImlzcyI6ImRjLXByb2plY3QuZnIiLCJpZCI6ImQ1NDRhNmE4LWJhYjgtNDU2MC05NWIxLThhZjAyMDNkOTEwNCIsImV4cCI6MTU2NzA3Mzc0Mn0.0VTetv8fZFjVgpJ-bwJpidGNHJUOmgj8vuZcZXzwnLa7TtFwcXWvh3bDPYHqB66nmOfXyM57XnHDbmRwtipCag
|
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:
|
components:
|
||||||
schemas:
|
schemas:
|
||||||
UUID:
|
UUID:
|
||||||
@@ -61,7 +77,7 @@ components:
|
|||||||
example:
|
example:
|
||||||
azerty
|
azerty
|
||||||
|
|
||||||
CitizenRespose:
|
CitizenResponse:
|
||||||
allOf:
|
allOf:
|
||||||
- $ref: '#/components/schemas/CitizenBase'
|
- $ref: '#/components/schemas/CitizenBase'
|
||||||
- type: object
|
- type: object
|
||||||
@@ -70,7 +86,6 @@ components:
|
|||||||
$ref: '#/components/schemas/UUID'
|
$ref: '#/components/schemas/UUID'
|
||||||
user:
|
user:
|
||||||
$ref: '#/components/schemas/UserResponse'
|
$ref: '#/components/schemas/UserResponse'
|
||||||
|
|
||||||
CitizenBase:
|
CitizenBase:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
@@ -102,6 +117,21 @@ components:
|
|||||||
RegisterRequest:
|
RegisterRequest:
|
||||||
$ref: '#/components/schemas/CitizenRequest'
|
$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:
|
requestBodies:
|
||||||
RegisterRequest:
|
RegisterRequest:
|
||||||
content:
|
content:
|
||||||
@@ -114,6 +144,17 @@ components:
|
|||||||
description: Register
|
description: Register
|
||||||
required: true
|
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
|
# Added by API Auto Mocking Plugin
|
||||||
servers:
|
servers:
|
||||||
- description: localhost
|
- description: localhost
|
||||||
|
|||||||
Reference in New Issue
Block a user