Skip to content

Commit c64bc26

Browse files
author
liuliquan
committed
doc: update swagger
1 parent b58ec4d commit c64bc26

File tree

1 file changed

+84
-0
lines changed

1 file changed

+84
-0
lines changed

docs/swagger.yaml

+84
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ paths:
5858
produces:
5959
- application/json
6060
parameters:
61+
- $ref: "#/parameters/app-version"
6162
- $ref: "#/parameters/page"
6263
- $ref: "#/parameters/perPage"
6364
- name: id
@@ -472,6 +473,7 @@ paths:
472473
produces:
473474
- application/json
474475
parameters:
476+
- $ref: "#/parameters/app-version"
475477
- in: body
476478
name: body
477479
required: true
@@ -512,6 +514,7 @@ paths:
512514
produces:
513515
- application/json
514516
parameters:
517+
- $ref: "#/parameters/app-version"
515518
- name: challengeId
516519
in: path
517520
required: true
@@ -548,6 +551,7 @@ paths:
548551
produces:
549552
- application/json
550553
parameters:
554+
- $ref: "#/parameters/app-version"
551555
- name: challengeId
552556
in: path
553557
required: true
@@ -593,6 +597,7 @@ paths:
593597
produces:
594598
- application/json
595599
parameters:
600+
- $ref: "#/parameters/app-version"
596601
- name: challengeId
597602
in: path
598603
required: true
@@ -2398,6 +2403,19 @@ parameters:
23982403
minimum: 1
23992404
default: 100
24002405
maximum: 100
2406+
app-version:
2407+
name: app-version
2408+
in: header
2409+
description: >
2410+
The app version:
2411+
2412+
- 1.1.0: With 1.1.0 or later version, challenge-api supports create/update challenge with "skills" data in request payload,
2413+
and with "skills" data in response body when get/search/create/update challenges.
2414+
2415+
- 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.
2416+
required: false
2417+
type: string
2418+
default: 1.0.0
24012419
definitions:
24022420
Challenge:
24032421
type: object
@@ -2643,6 +2661,39 @@ definitions:
26432661
type: string
26442662
description: Auto-generated
26452663
example: Development
2664+
payments:
2665+
type: array
2666+
description: The payments of the challenge, only applicable when "app-version" header >= 2.0.0 for admin/m2m user
2667+
items:
2668+
type: object
2669+
properties:
2670+
handle:
2671+
type: string
2672+
type:
2673+
type: string
2674+
amount:
2675+
type: number
2676+
userId:
2677+
type: number
2678+
skills:
2679+
type: array
2680+
description: The skills of the challenge, only applicable when "app-version" header >= 1.1.0
2681+
items:
2682+
type: object
2683+
properties:
2684+
id:
2685+
type: string
2686+
format: UUID
2687+
name:
2688+
type: string
2689+
category:
2690+
type: object
2691+
properties:
2692+
id:
2693+
type: string
2694+
format: UUID
2695+
name:
2696+
type: string
26462697
required:
26472698
- typeId
26482699
- trackId
@@ -2792,6 +2843,17 @@ definitions:
27922843
required:
27932844
- id
27942845
- roleId
2846+
skills:
2847+
type: array
2848+
description: The ids of the skills to add for the challenge, only applicable when "app-version" header >= 1.1.0
2849+
items:
2850+
type: object
2851+
properties:
2852+
id:
2853+
type: string
2854+
format: UUID
2855+
required:
2856+
- id
27952857
required:
27962858
- typeId
27972859
- trackId
@@ -2975,6 +3037,17 @@ definitions:
29753037
required:
29763038
- id
29773039
- roleId
3040+
skills:
3041+
type: array
3042+
description: The ids of the skills to add for the challenge, only applicable when "app-version" header >= 1.1.0
3043+
items:
3044+
type: object
3045+
properties:
3046+
id:
3047+
type: string
3048+
format: UUID
3049+
required:
3050+
- id
29783051
required:
29793052
- typeId
29803053
- trackId
@@ -3159,6 +3232,17 @@ definitions:
31593232
required:
31603233
- id
31613234
- roleId
3235+
skills:
3236+
type: array
3237+
description: The ids of the skills to add for the challenge, only applicable when "app-version" header >= 1.1.0
3238+
items:
3239+
type: object
3240+
properties:
3241+
id:
3242+
type: string
3243+
format: UUID
3244+
required:
3245+
- id
31623246
SearchChallengeRequestBody:
31633247
type: object
31643248
properties:

0 commit comments

Comments
 (0)