Skip to content

doc: update swagger for app-version header #698

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

Merged
merged 2 commits into from
Nov 16, 2023
Merged
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
84 changes: 84 additions & 0 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ paths:
produces:
- application/json
parameters:
- $ref: "#/parameters/app-version"
- $ref: "#/parameters/page"
- $ref: "#/parameters/perPage"
- name: id
Expand Down Expand Up @@ -472,6 +473,7 @@ paths:
produces:
- application/json
parameters:
- $ref: "#/parameters/app-version"
- in: body
name: body
required: true
Expand Down Expand Up @@ -512,6 +514,7 @@ paths:
produces:
- application/json
parameters:
- $ref: "#/parameters/app-version"
- name: challengeId
in: path
required: true
Expand Down Expand Up @@ -548,6 +551,7 @@ paths:
produces:
- application/json
parameters:
- $ref: "#/parameters/app-version"
- name: challengeId
in: path
required: true
Expand Down Expand Up @@ -593,6 +597,7 @@ paths:
produces:
- application/json
parameters:
- $ref: "#/parameters/app-version"
- name: challengeId
in: path
required: true
Expand Down Expand Up @@ -2398,6 +2403,19 @@ parameters:
minimum: 1
default: 100
maximum: 100
app-version:
name: app-version
in: header
description: >
The app version:

- 1.1.0: With 1.1.0 or later version, challenge-api supports create/update challenge with "skills" data in request payload,
and with "skills" data in response body when get/search/create/update challenges.

- 2.0.0: With 2.0.0 or later version, challenge-api supports "payments" data in response body when get/search/create/update challenges for admin/m2m user.
required: false
type: string
default: 1.0.0
definitions:
Challenge:
type: object
Expand Down Expand Up @@ -2643,6 +2661,39 @@ definitions:
type: string
description: Auto-generated
example: Development
payments:
type: array
description: The payments of the challenge, only applicable when "app-version" header >= 2.0.0 for admin/m2m user
items:
type: object
properties:
handle:
type: string
type:
type: string
amount:
type: number
userId:
type: number
skills:
type: array
description: The skills of the challenge, only applicable when "app-version" header >= 1.1.0
items:
type: object
properties:
id:
type: string
format: UUID
name:
type: string
category:
type: object
properties:
id:
type: string
format: UUID
name:
type: string
required:
- typeId
- trackId
Expand Down Expand Up @@ -2792,6 +2843,17 @@ definitions:
required:
- id
- roleId
skills:
type: array
description: The ids of the skills to add for the challenge, only applicable when "app-version" header >= 1.1.0
items:
type: object
properties:
id:
type: string
format: UUID
required:
- id
required:
- typeId
- trackId
Expand Down Expand Up @@ -2975,6 +3037,17 @@ definitions:
required:
- id
- roleId
skills:
type: array
description: The ids of the skills to add for the challenge, only applicable when "app-version" header >= 1.1.0
items:
type: object
properties:
id:
type: string
format: UUID
required:
- id
required:
- typeId
- trackId
Expand Down Expand Up @@ -3159,6 +3232,17 @@ definitions:
required:
- id
- roleId
skills:
type: array
description: The ids of the skills to add for the challenge, only applicable when "app-version" header >= 1.1.0
items:
type: object
properties:
id:
type: string
format: UUID
required:
- id
SearchChallengeRequestBody:
type: object
properties:
Expand Down