Skip to content

Commit c7b819b

Browse files
authored
feat: migrate openapi definitions to 3.1 (#1)
1 parent 46013e2 commit c7b819b

File tree

5 files changed

+12
-23
lines changed

5 files changed

+12
-23
lines changed

openapi/components/schemas/AuthoredChallenge.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@ properties:
1616
type: string
1717
description: Description of the kata in Markdown.
1818
rank:
19-
type: integer
19+
type: [ integer, "null" ]
2020
description: Rank of the kata if approved.
21-
nullable: true
2221
rankName:
23-
type: string
22+
type: [ string, "null" ]
2423
description: Rank name of the kata if approved.
25-
nullable: true
2624
tags:
2725
type: array
2826
description: Array of tags associated with the kata.

openapi/components/schemas/CodeChallenge.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,14 @@ properties:
5353
type: string
5454
description: Date and time when the kata was created.
5555
publishedAt:
56-
type: string
57-
nullable: true
56+
type: [ string, "null" ]
5857
description: Date and time when the kata was first published.
5958
approvedBy:
6059
# nullable: true
6160
# description: The approver of the kata.
6261
$ref: ./CodeChallengeContributor.yaml
6362
approvedAt:
64-
type: string
65-
nullable: true
63+
type: [ string, "null" ]
6664
description: Date and time when the kata was approved.
6765
totalCompleted:
6866
type: integer

openapi/components/schemas/CodeChallengeRank.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,13 @@ type: object
22
description: Object describing the rank of the kata if approved.
33
properties:
44
id:
5-
type: integer
6-
nullable: true
5+
type: [ integer, "null" ]
76
description: Rank in integer. [-8, -1] maps to kyu, [1, 8] maps to dan.
87
name:
9-
type: string
10-
nullable: true
8+
type: [ string, "null" ]
119
description: Either {-rank} kyu or {rank} dan.
1210
color:
13-
type: string
14-
nullable: true
11+
type: [ string, "null" ]
1512
description: |
1613
The color of the rank. Possible colors are white (7-8 kyu), yellow (5-6 kyu),
1714
blue (3-4 kyu), purple (1-2 kyu), black (1-4 dan), and red (5-8 dan).

openapi/components/schemas/User.yaml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,19 @@ properties:
1313
type: string
1414
description: Username of the user.
1515
name:
16-
type: string
17-
nullable: true
16+
type: [ string, "null" ]
1817
description: Name of the user.
1918
honor:
2019
type: integer
2120
description: Total honor points earned by the user.
2221
clan:
23-
type: string
24-
nullable: true
22+
type: [ string, "null" ]
2523
description: Name of the clan.
2624
leaderboardPosition:
27-
type: integer
28-
nullable: true
25+
type: [ integer, "null" ]
2926
description: The user's position on the overall leaderboard.
3027
skills:
31-
type: array
32-
nullable: true
28+
type: [ array, "null" ]
3329
description: Array of skills entered by the user.
3430
items:
3531
type: string

openapi/openapi.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
openapi: 3.0.3
1+
openapi: 3.1.0
22
info:
33
version: 0.2.0
44
title: Codewars API

0 commit comments

Comments
 (0)