159 lines
4.0 KiB
YAML
159 lines
4.0 KiB
YAML
openapi: 3.0.2
|
|
info:
|
|
title: Reflectoring
|
|
description: "Tutorials on Spring Boot and Java, thoughts about the Software Craft, and relevant book reviews. Because it's just as important to understand the Why as it is to understand the How. Have fun!"
|
|
termsOfService: http://swagger.io/terms/
|
|
contact:
|
|
email: petros.stergioulas94@gmail.com
|
|
license:
|
|
name: Apache 2.0
|
|
url: http://www.apache.org/licenses/LICENSE-2.0.html
|
|
version: 0.0.1-SNAPSHOT
|
|
externalDocs:
|
|
description: Find out more about Reflectoring
|
|
url: https://reflectoring.io/about/
|
|
servers:
|
|
- url: https://reflectoring.swagger.io/v2
|
|
tags:
|
|
- name: user
|
|
description: Operations about user
|
|
externalDocs:
|
|
description: Find out more about our store
|
|
url: http://swagger.io
|
|
paths:
|
|
/user:
|
|
post:
|
|
tags:
|
|
- user
|
|
summary: Create user
|
|
description: Create user functionality
|
|
operationId: createUser
|
|
requestBody:
|
|
description: Created user object
|
|
content:
|
|
'*/*':
|
|
schema:
|
|
$ref: '#/components/schemas/User'
|
|
required: true
|
|
responses:
|
|
default:
|
|
description: successful operation
|
|
content: {}
|
|
x-codegen-request-body-name: body
|
|
/user/{username}:
|
|
get:
|
|
tags:
|
|
- user
|
|
summary: Get user by user name
|
|
operationId: getUserByName
|
|
parameters:
|
|
- name: username
|
|
in: path
|
|
description: 'The name that needs to be fetched. Use user1 for testing. '
|
|
required: true
|
|
schema:
|
|
type: string
|
|
responses:
|
|
200:
|
|
description: successful operation
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/User'
|
|
404:
|
|
description: User not found
|
|
content: {}
|
|
put:
|
|
tags:
|
|
- user
|
|
summary: Updated user
|
|
description: This can only be done by the logged in user.
|
|
operationId: updateUser
|
|
parameters:
|
|
- name: username
|
|
in: path
|
|
description: name that need to be updated
|
|
required: true
|
|
schema:
|
|
type: string
|
|
requestBody:
|
|
description: Updated user object
|
|
content:
|
|
'*/*':
|
|
schema:
|
|
$ref: '#/components/schemas/User'
|
|
required: true
|
|
responses:
|
|
200:
|
|
description: successful operation
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/User'
|
|
400:
|
|
description: Invalid user supplied
|
|
content: {}
|
|
404:
|
|
description: User not found
|
|
content: {}
|
|
x-codegen-request-body-name: body
|
|
delete:
|
|
tags:
|
|
- user
|
|
summary: Delete user
|
|
description: This can only be done by the logged in user.
|
|
operationId: deleteUser
|
|
parameters:
|
|
- name: username
|
|
in: path
|
|
description: The name that needs to be deleted
|
|
required: true
|
|
schema:
|
|
type: string
|
|
responses:
|
|
201:
|
|
description: operation successful
|
|
content: {}
|
|
400:
|
|
description: Invalid username supplied
|
|
content: {}
|
|
404:
|
|
description: User not found
|
|
content: {}
|
|
components:
|
|
schemas:
|
|
User:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: integer
|
|
format: int64
|
|
username:
|
|
type: string
|
|
firstName:
|
|
type: string
|
|
lastName:
|
|
type: string
|
|
email:
|
|
type: string
|
|
password:
|
|
type: string
|
|
phone:
|
|
type: string
|
|
userStatus:
|
|
type: integer
|
|
description: User Status
|
|
format: int32
|
|
securitySchemes:
|
|
reflectoring_auth:
|
|
type: oauth2
|
|
flows:
|
|
implicit:
|
|
authorizationUrl: http://reflectoring.swagger.io/oauth/dialog
|
|
scopes:
|
|
write:users: modify users
|
|
read:users: read users
|
|
api_key:
|
|
type: apiKey
|
|
name: api_key
|
|
in: header |