From bd3de233dbaf7b0cfe8b97ed29ec4b207bcdc5dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Foorack=20/=20Max=20Fax=C3=A4lv?= Date: Sun, 21 Nov 2021 14:20:59 +0100 Subject: [PATCH] docs: flush out User and Avatar documentation --- openapi/components/requests/CreateAvatarRequest.yaml | 3 ++- openapi/components/requests/CreateFileRequest.yaml | 1 + openapi/components/requests/CreateWorldRequest.yaml | 1 + openapi/components/requests/UpdateAvatarRequest.yaml | 1 + openapi/components/requests/UpdateUserRequest.yaml | 1 + openapi/components/requests/UpdateWorldRequest.yaml | 1 + openapi/components/schemas/Avatar.yaml | 3 --- openapi/components/schemas/DeploymentGroup.yaml | 1 - openapi/components/schemas/FileData.yaml | 1 - openapi/components/schemas/InstanceID.yaml | 3 ++- openapi/components/schemas/User.yaml | 12 +++++++++--- openapi/components/schemas/UserID.yaml | 1 + openapi/components/schemas/WorldID.yaml | 1 + 13 files changed, 20 insertions(+), 10 deletions(-) diff --git a/openapi/components/requests/CreateAvatarRequest.yaml b/openapi/components/requests/CreateAvatarRequest.yaml index 4bd0a01c..3145484f 100644 --- a/openapi/components/requests/CreateAvatarRequest.yaml +++ b/openapi/components/requests/CreateAvatarRequest.yaml @@ -12,6 +12,7 @@ properties: type: string minLength: 1 tags: + description: ' ' type: array items: $ref: ../schemas/Tag.yaml @@ -32,4 +33,4 @@ properties: type: string required: - name - - imageUrl \ No newline at end of file + - imageUrl diff --git a/openapi/components/requests/CreateFileRequest.yaml b/openapi/components/requests/CreateFileRequest.yaml index 4e79730d..3e22a785 100644 --- a/openapi/components/requests/CreateFileRequest.yaml +++ b/openapi/components/requests/CreateFileRequest.yaml @@ -10,6 +10,7 @@ properties: type: string minLength: 1 tags: + description: ' ' type: array items: $ref: ../schemas/Tag.yaml diff --git a/openapi/components/requests/CreateWorldRequest.yaml b/openapi/components/requests/CreateWorldRequest.yaml index 54ddb9fc..388b1782 100644 --- a/openapi/components/requests/CreateWorldRequest.yaml +++ b/openapi/components/requests/CreateWorldRequest.yaml @@ -32,6 +32,7 @@ properties: releaseStatus: $ref: ../schemas/ReleaseStatus.yaml tags: + description: ' ' type: array items: $ref: ../schemas/Tag.yaml diff --git a/openapi/components/requests/UpdateAvatarRequest.yaml b/openapi/components/requests/UpdateAvatarRequest.yaml index 449c6099..07b650b3 100644 --- a/openapi/components/requests/UpdateAvatarRequest.yaml +++ b/openapi/components/requests/UpdateAvatarRequest.yaml @@ -12,6 +12,7 @@ properties: type: string minLength: 1 tags: + description: ' ' type: array items: $ref: ../schemas/Tag.yaml diff --git a/openapi/components/requests/UpdateUserRequest.yaml b/openapi/components/requests/UpdateUserRequest.yaml index 6bf4ea85..ff700d04 100644 --- a/openapi/components/requests/UpdateUserRequest.yaml +++ b/openapi/components/requests/UpdateUserRequest.yaml @@ -9,6 +9,7 @@ properties: acceptedTOSVersion: type: number tags: + description: ' ' type: array items: $ref: ../schemas/Tag.yaml diff --git a/openapi/components/requests/UpdateWorldRequest.yaml b/openapi/components/requests/UpdateWorldRequest.yaml index 78f3977c..37407820 100644 --- a/openapi/components/requests/UpdateWorldRequest.yaml +++ b/openapi/components/requests/UpdateWorldRequest.yaml @@ -30,6 +30,7 @@ properties: releaseStatus: $ref: ../schemas/ReleaseStatus.yaml tags: + description: ' ' type: array items: $ref: ../schemas/Tag.yaml diff --git a/openapi/components/schemas/Avatar.yaml b/openapi/components/schemas/Avatar.yaml index b3899abb..67d2ee73 100644 --- a/openapi/components/schemas/Avatar.yaml +++ b/openapi/components/schemas/Avatar.yaml @@ -13,11 +13,9 @@ properties: $ref: ./UserID.yaml authorName: minLength: 1 - readOnly: true type: string created_at: format: date-time - readOnly: true type: string description: minLength: 0 @@ -65,7 +63,6 @@ properties: default: 0 example: 68 minimum: 0 - readOnly: true type: integer required: - authorId diff --git a/openapi/components/schemas/DeploymentGroup.yaml b/openapi/components/schemas/DeploymentGroup.yaml index df6cbe28..50472bca 100644 --- a/openapi/components/schemas/DeploymentGroup.yaml +++ b/openapi/components/schemas/DeploymentGroup.yaml @@ -13,4 +13,3 @@ enum: - cherry title: DeploymentGroup default: blue -readOnly: true diff --git a/openapi/components/schemas/FileData.yaml b/openapi/components/schemas/FileData.yaml index 3b7654ad..19d5e9fb 100644 --- a/openapi/components/schemas/FileData.yaml +++ b/openapi/components/schemas/FileData.yaml @@ -10,7 +10,6 @@ properties: - simple minLength: 1 default: queued - readOnly: true fileName: minLength: 1 type: string diff --git a/openapi/components/schemas/InstanceID.yaml b/openapi/components/schemas/InstanceID.yaml index db9fb1fa..dabaf8e1 100644 --- a/openapi/components/schemas/InstanceID.yaml +++ b/openapi/components/schemas/InstanceID.yaml @@ -1,5 +1,6 @@ type: string example: 'wrld_ba913a96-fac4-4048-a062-9aa5db092812:12345~hidden(usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469)~region(eu)~nonce(27e8414a-59a0-4f3d-af1f-f27557eb49a2)' -pattern: '(wrld|wld)_[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}:(\d+)(~region\(([\w]+)\))?(~([\w]+)\(usr_([\w-]+)\)((\~canRequestInvite)?)(~region\(([\w].+)\))?~nonce\((.+)\))?' +pattern: '(offline|(wrld|wld)_[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}:(\d+)(~region\(([\w]+)\))?(~([\w]+)\(usr_([\w-]+)\)((\~canRequestInvite)?)(~region\(([\w].+)\))?~nonce\((.+)\))?)' title: InstanceID minLength: 41 +description: InstanceID be "offline" on User profiles if you are not friends with that user. diff --git a/openapi/components/schemas/User.yaml b/openapi/components/schemas/User.yaml index 0aeb152b..e500024d 100644 --- a/openapi/components/schemas/User.yaml +++ b/openapi/components/schemas/User.yaml @@ -3,8 +3,11 @@ type: object properties: allowAvatarCopying: type: boolean + default: true bio: type: string + maxLength: 512 + minLength: 0 bioLinks: type: array items: @@ -16,25 +19,27 @@ properties: date_joined: format: date type: string - readOnly: true developerType: $ref: ./DeveloperType.yaml displayName: type: string + description: 'A users visual display name. This is what shows up in-game, and can different from their `username`. Changing display name is restricted to a cooldown period.' friendKey: type: string id: $ref: ./UserID.yaml instanceId: - type: string + $ref: ./InstanceID.yaml isFriend: type: boolean + description: 'Either their `friendKey`, or empty string if you are not friends. Unknown usage.' last_login: type: string + description: Either a date-time or empty string. last_platform: $ref: ./Platform.yaml location: - type: string + $ref: ./WorldID.yaml profilePicOverride: type: string state: @@ -52,6 +57,7 @@ properties: type: string username: type: string + description: 'A users unique name, used during login. This is different from `displayName` which is what shows up in-game. A users `username` can never be changed.' worldId: $ref: ./WorldID.yaml required: diff --git a/openapi/components/schemas/UserID.yaml b/openapi/components/schemas/UserID.yaml index 49b83c04..7d629cec 100644 --- a/openapi/components/schemas/UserID.yaml +++ b/openapi/components/schemas/UserID.yaml @@ -1,3 +1,4 @@ example: usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469 title: UserID type: string +description: 'A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed.' diff --git a/openapi/components/schemas/WorldID.yaml b/openapi/components/schemas/WorldID.yaml index 4482d2e8..a19fa4ab 100644 --- a/openapi/components/schemas/WorldID.yaml +++ b/openapi/components/schemas/WorldID.yaml @@ -2,3 +2,4 @@ example: wrld_ba913a96-fac4-4048-a062-9aa5db092812 pattern: '(^$|offline|(wrld|wld)_[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12})' title: WorldID type: string +description: WorldID be "offline" on User profiles if you are not friends with that user.