Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backend Quarkus Migration: Database Migration Helper #101

Draft
wants to merge 2 commits into
base: v2
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
379 changes: 379 additions & 0 deletions openapi/openapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,379 @@
---
openapi: 3.0.2
info:
title: Giveback Ninja
version: 2.0.0
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0
paths:
/user:
post:
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/User'
examples:
new-ninja:
value:
username: new_ninja
displayName: New Ninja
githubUsername: new_ninja
required: true
responses:
"201":
content:
application/json:
schema:
$ref: '#/components/schemas/User'
examples:
created-user:
value:
username: new_ninja
displayName: New Ninja
githubUsername: new_ninja
region: NA
description: Creates a user within the system.
"404":
description: When the username was not found in the backend ldap service.
operationId: create-user
summary: Registers a new user in the system.
/scorecard:
get:
responses:
"200":
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Scorecard'
description: Returns a list of all user scorecards.
summary: Get all user scorecards.
/scorecard/{username}:
get:
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/Scorecard'
examples:
super_ninja:
value:
username: super_ninja
level: black
total: 248
pointsToNextLevel: 0
nextLevel: ""
pointMap:
githubReviewedPullRequests: 24
githubClosedIssues: 0
servicesSupportMergeRequests: 0
servicesSupportClosedIssues: 0
servicesSupportReviewedMergeRequests: 0
githubPullRequests: 34
gitlabMergeRequests: 43
trelloCardsClosed: 23
thoughtLeadershipCardsClosed: 1
servicesSupportCardsClosed: 10
description: Get Scorecard Info
summary: Gets Scorecard info for a specific user.
parameters:
- name: username
description: The unique name of a specific user.
schema:
type: string
in: path
required: true
/scorecard/{username}/{pool}:
post:
requestBody:
content:
text/plain:
schema:
type: integer
required: true
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/Scorecard'
description: Pool for provided username was incremented successfully.
summary: Increments a scorecard for provided username and pool.
description: ""
parameters:
- name: username
description: The unique name of the user.
schema:
type: string
in: path
required: true
- name: pool
description: The pool to increment. The pool will be created if not already
defined.
schema:
type: string
in: path
required: true
/level:
get:
responses:
"200":
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Level'
examples:
level-list:
value:
- minimumPoint: 0
name: ZERO
- minimumPoint: 5
name: BLUE
- minimumPoint: 20
name: GREY
- minimumPoint: 40
name: RED
- minimumPoint: 75
name: BLACK
description: All levels
summary: Obtains all available Levels
/history/{period}:
get:
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/Period'
examples:
fy20:
value:
cumulatedOn: 2021-01-11T08:08:56.5899687
records:
retired_ninja:
score: 120
level: BLACK
super_ninja:
score: 80
level: BLACK
modest_ninja:
score: 30
level: GREY
name: FY20
description: Period requested with path parameter
"404":
$ref: '#/components/responses/NotFoundResponse'
summary: Obtains history for requested period
post:
responses:
"201":
content:
application/json:
schema:
$ref: '#/components/schemas/Period'
examples:
fy20:
value:
cumulatedOn: 2021-06-11T08:08:56.5899687
records:
retired_ninja:
score: 120
level: BLACK
super_ninja:
score: 80
level: BLACK
modest_ninja:
score: 30
level: GREY
name: FY20
description: Created Period
summary: Generates a new Historic period and reset existing scores
parameters:
- examples:
fy20:
value: FY20
name: period
description: Period name
schema:
type: string
in: path
required: true
components:
schemas:
Event:
description: ""
required:
- timestamp
- type
type: object
properties:
username:
description: The user to which the event applied
type: string
type:
description: The type of event
type: string
timestamp:
format: date-time
description: The timestamp when the event occurred
type: string
description:
description: Describes the event.
type: string
example:
username: super_ninja
type: New User Registered
timestamp: 2020-03-03T17:17
description: A new user has been registered
Record:
description: ""
required:
- level
- score
type: object
properties:
level:
description: The level attained by the user for a period
type: string
score:
description: Points cumulated by a user during a period
type: integer
Period:
description: The period for which the history was computed. Usually Fiscal Year
required:
- name
- cumulatedOn
- records
type: object
properties:
name:
description: Unique name of the period
type: string
cumulatedOn:
format: date-time
description: When the period was computed
type: string
records:
description: The records for this period
type: object
additionalProperties:
$ref: '#/components/schemas/Record'
User:
title: User
description: ""
required:
- username
type: object
properties:
displayName:
description: The name displayed to all users of the system. Typically the
users first and last name.
type: string
username:
description: The user's Red Hat Kerberos ID.
type: string
githubUsername:
description: The user's Github username.
type: string
trelloUsername:
description: The user's Trello username.
type: string
email:
description: The Red Hat email associated with the user.
type: string
example:
displayName: Super Ninja
username: super_ninja
githubUsername: super_ninja
trelloUsername: super_ninja
email: [email protected]
Scorecard:
title: User Scorecard
description: All stats around a user that are used to calculate Ninja Belt level.
required:
- username
type: object
properties:
username:
description: The unique user id.
type: string
level:
description: The current level of the ninja
type: string
pointsToNextLevel:
description: |
The number of points needed to achieve the next level. 0 indicates
that there is no higher level.
type: integer
nextLevel:
description: "The level that can be reached next. An empty string indicates\
\ that \nthe current level is the highest.\n"
type: string
details:
description: Score for each pool
type: object
additionalProperties:
type: integer
score:
description: The current score
type: integer
example:
username: super_ninja
level: black
score: 248
pointsToNextLevel: 0
nextLevel: ""
pointMap:
githubReviewedPullRequests: 24
githubClosedIssues: 0
servicesSupportMergeRequests: 0
servicesSupportClosedIssues: 0
servicesSupportReviewedMergeRequests: 0
githubPullRequests: 34
gitlabMergeRequests: 43
trelloCardsClosed: 23
thoughtLeadershipCardsClosed: 1
servicesSupportCardsClosed: 10
ErrorResponse:
title: Root Type for ErrorResponse
description: An error response
type: object
properties:
message:
description: The error message
type: string
example:
message: Entity was not found
Level:
description: ""
required:
- name
- minimumScore
type: object
properties:
name:
description: The name of the level
type: string
minimumScore:
description: The minimum point needed to be at that level
type: integer
example:
name: BLACK
minimumScore: 75
responses:
NotFoundResponse:
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
entity-not-found:
value:
message: Entity was not found
description: ""
Loading