Skip to content

Commit

Permalink
Merge pull request #334 from jalpp/master
Browse files Browse the repository at this point in the history
add optional fields in properties
  • Loading branch information
fitztrev authored Apr 12, 2024
2 parents 9d7a58b + 2ccab0a commit 0d654ce
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doc/redocly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ theme:
htmlTemplate: ./template.hbs

extends:
- recommended
- recommended-strict

rules:
operation-4xx-response: off
Expand Down
2 changes: 2 additions & 0 deletions doc/specs/examples/user-georges-bot.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@
"fideRating": 1500,
"uscfRating": 1500,
"ecfRating": 1500,
"cfcRating": 1500,
"dsbRating": 1500,
"links": "github.com/ornicar\r\ntwitter.com/ornicar"
},
"seenAt": 1522636452014,
Expand Down
1 change: 1 addition & 0 deletions doc/specs/schemas/Perf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ properties:
example: -22
prov:
type: boolean
description: only appears if a user's perf rating are [provisional](https://lichess.org/faq#provisional)
11 changes: 11 additions & 0 deletions doc/specs/schemas/Profile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,23 @@ properties:
fideRating:
type: integer
example: 1500
description: only appears if a user has set them
uscfRating:
type: integer
example: 1500
description: only appears if a user has set them
ecfRating:
type: integer
example: 1500
description: only appears if a user has set them
cfcRating:
type: integer
example: 1500
description: only appears if a user has set them
dsbRating:
type: integer
example: 1500
description: only appears if a user has set them
links:
type: string
example: "github.com/ornicar\r\ntwitter.com/ornicar"
1 change: 1 addition & 0 deletions doc/specs/schemas/Title.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
type: string
enum: [GM, WGM, IM, WIM, FM, WFM, NM, CM, WCM, WNM, LM, BOT]
example: NM
description: only appears if the user is a titled player or a bot user
2 changes: 2 additions & 0 deletions doc/specs/schemas/User.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ properties:
disabled:
type: boolean
example: false
description: only appears if a user's account is closed
tosViolation:
type: boolean
example: false
description: only appears if a user's account is marked for the violation of [Lichess TOS](https://lichess.org/terms-of-service)
profile:
$ref: './Profile.yaml'
seenAt:
Expand Down
6 changes: 6 additions & 0 deletions doc/specs/schemas/UserExtended.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,18 @@ allOf:
followable:
type: boolean
example: true
description: only appears if the request is [authenticated with OAuth2](#section/Introduction/Authentication)
following:
type: boolean
example: false
description: only appears if the request is [authenticated with OAuth2](#section/Introduction/Authentication)
blocking:
type: boolean
example: false
description: only appears if the request is [authenticated with OAuth2](#section/Introduction/Authentication)
followsYou:
type: boolean
example: false
description: only appears if the request is [authenticated with OAuth2](#section/Introduction/Authentication)


4 changes: 2 additions & 2 deletions doc/specs/tags/users/api-user-username.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ get:
summary: Get user public data
description: |
Read public data of a user.
If the request is [authenticated with OAuth2](#section/Introduction/Authentication),
then extra fields might be present in the response: `followable`, `following`, `blocking`, `followsYou`.
tags:
- Users
security:
- OAuth2: []

parameters:
- in: path
name: username
Expand All @@ -21,6 +20,7 @@ get:
schema:
type: boolean
default: false

responses:
"200":
description: The information of the user.
Expand Down

0 comments on commit 0d654ce

Please sign in to comment.