Skip to content

Commit

Permalink
use oneOf instead of nullable to make linter happy
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasf committed Dec 1, 2024
1 parent 12db0f9 commit 1566f1a
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 29 deletions.
15 changes: 9 additions & 6 deletions doc/specs/schemas/OpeningExplorerLichess.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
type: object
properties:
opening:
$ref: './OpeningExplorerOpening.yaml'
nullable: true
oneOf:
- $ref: './OpeningExplorerOpening.yaml'
- type: 'null'
white:
type: number
draws:
Expand All @@ -27,11 +28,13 @@ properties:
black:
type: number
game:
$ref: './OpeningExplorerLichessGame.yaml'
nullable: true
oneOf:
- $ref: './OpeningExplorerLichessGame.yaml'
- type: 'null'
opening:
$ref: './OpeningExplorerOpening.yaml'
nullable: true
oneOf:
- $ref: './OpeningExplorerOpening.yaml'
- type: 'null'
required:
- uci
- san
Expand Down
3 changes: 1 addition & 2 deletions doc/specs/schemas/OpeningExplorerLichessGame.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ properties:
id:
type: string
winner:
type: string
type: [string, 'null']
enum:
- white
- black
nullable: true
speed:
$ref: './Speed.yaml'
white:
Expand Down
15 changes: 9 additions & 6 deletions doc/specs/schemas/OpeningExplorerMasters.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
type: object
properties:
opening:
$ref: './OpeningExplorerOpening.yaml'
nullable: true
oneOf:
- $ref: './OpeningExplorerOpening.yaml'
- type: 'null'
white:
type: number
draws:
Expand All @@ -26,11 +27,13 @@ properties:
black:
type: number
game:
$ref: './OpeningExplorerMastersGame.yaml'
nullable: true
oneOf:
- $ref: './OpeningExplorerMastersGame.yaml'
- type: 'null'
opening:
$ref: './OpeningExplorerOpening.yaml'
nullable: true
oneOf:
- $ref: './OpeningExplorerOpening.yaml'
- type: 'null'
required:
- uci
- san
Expand Down
13 changes: 6 additions & 7 deletions doc/specs/schemas/OpeningExplorerMastersGame.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,22 @@ type: object
properties:
id:
type: string
white:
$ref: './OpeningExplorerGamePlayer.yaml'
black:
$ref: './OpeningExplorerGamePlayer.yaml'
winner:
type: string
type: [string, 'null']
enum:
- white
- black
nullable: true
white:
$ref: './OpeningExplorerGamePlayer.yaml'
black:
$ref: './OpeningExplorerGamePlayer.yaml'
year:
type: number
month:
type: string
required:
- id
- winner
- white
- black
- winner
- year
15 changes: 9 additions & 6 deletions doc/specs/schemas/OpeningExplorerPlayer.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
type: object
properties:
opening:
$ref: './OpeningExplorerOpening.yaml'
nullable: true
oneOf:
- $ref: './OpeningExplorerOpening.yaml'
- type: 'null'
queuePosition:
type: number
white:
Expand Down Expand Up @@ -31,11 +32,13 @@ properties:
black:
type: number
game:
$ref: './OpeningExplorerPlayerGame.yaml'
nullable: true
oneOf:
- $ref: './OpeningExplorerPlayerGame.yaml'
- type: 'null'
opening:
$ref: './OpeningExplorerOpening.yaml'
nullable: true
oneOf:
- $ref: './OpeningExplorerOpening.yaml'
- type: 'null'
required:
- uci
- san
Expand Down
3 changes: 1 addition & 2 deletions doc/specs/schemas/OpeningExplorerPlayerGame.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ properties:
id:
type: string
winner:
type: string
type: [string, 'null']
enum:
- white
- black
nullable: true
speed:
$ref: './Speed.yaml'
mode:
Expand Down

0 comments on commit 1566f1a

Please sign in to comment.