Skip to content

Websocket types - #601

Open
C0D3-M4513R wants to merge 47 commits into
vrchatapi:mainfrom
C0D3-M4513R:feature/websocket
Open

C0D3-M4513R wants to merge 47 commits into
vrchatapi:mainfrom
C0D3-M4513R:feature/websocket

Conversation

@C0D3-M4513R

@C0D3-M4513R C0D3-M4513R commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Adds a bunch of types used for receiving Websockets

Copilot AI lite review requested due to automatic review settings September 16, 2026 17:47
@C0D3-M4513R
C0D3-M4513R force-pushed the feature/websocket branch 2 times, most recently from 742b44e to 91b5283 Compare September 16, 2026 17:52

This comment was marked as resolved.

@C0D3-M4513R
C0D3-M4513R force-pushed the feature/websocket branch 3 times, most recently from 5b4cd87 to 87e2c20 Compare September 16, 2026 18:01
@pkg-pr-new

pkg-pr-new Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
pnpm add https://pkg.pr.new/vrchatapi/specification/vrchat@d710526

commit: d710526

@C0D3-M4513R
C0D3-M4513R requested review from ariesclark and a lite review from Copilot September 16, 2026 18:58
@C0D3-M4513R
C0D3-M4513R marked this pull request as ready for review September 16, 2026 18:59

This comment was marked as resolved.

@C0D3-M4513R

Copy link
Copy Markdown
Contributor Author

This approach does not work for actually deserializing the double-json encoded json, sadly.

Also the discriminator mappings do not work (at least in rust).

If possible I'd like someone more skilled at Openapi spec to look at this.

@C0D3-M4513R
C0D3-M4513R force-pushed the feature/websocket branch 2 times, most recently from 8a8e988 to 31dae62 Compare September 16, 2026 23:05
@C0D3-M4513R

Copy link
Copy Markdown
Contributor Author

So the descriminator mappings work now.
However json-encoded string deserialization doesn't seem to be supported.

Therefore, due to how at least Rust enums work, I had to create one type with the suffix "Encoded" for each Websocket double-encoded type.

@C0D3-M4513R
C0D3-M4513R marked this pull request as draft September 17, 2026 00:46
@C0D3-M4513R C0D3-M4513R mentioned this pull request Sep 22, 2026
@C0D3-M4513R
C0D3-M4513R force-pushed the feature/websocket branch 3 times, most recently from f517c46 to f47aa14 Compare September 22, 2026 19:48
C0D3-M4513R added a commit to vrchatapi/vrchatapi-rust that referenced this pull request Sep 23, 2026
#47)

* Template Changes for vrchatapi/specification#601

* Fix examples

* fmt

* More robust template

* Implement/Use C0D3-M4513R/specification@db4c9c3

* Fix examples

* Use openapi-3.1 spec

* Change vendor-specific namings
@C0D3-M4513R
C0D3-M4513R changed the base branch from main to redocly-plugin-downlevel September 23, 2026 18:55
Created using `for i in WebsocketNotification.yaml WebsocketResponseNotification.yaml WebsocketNotificationV2Update.yaml WebsocketNotificationV2Delete.yaml WebsocketFriendAdd.yaml WebsocketFriendDelete.yaml WebsocketFriendOnline.yaml WebsocketFriendActive.yaml WebsocketFriendOffline.yaml WebsocketFriendUpdate.yaml WebsocketFriendLocation.yaml WebsocketUserUpdate.yaml WebsocketUserLocation.yaml WebsocketUserBadgeAssigned.yaml WebsocketUserBadgeUnassigned.yaml WebsocketContentRefresh.yaml WebsocketInstanceQueueJoined.yaml WebsocketInstanceQueueReady.yaml WebsocketGroupJoined.yaml WebsocketGroupLeft.yaml WebsocketGroupMemberUpdated.yaml WebsocketGroupRoleUpdated.yaml; do echo -e "title: ${i%.*}Encoded\ntype: object\nproperties:\n  content:\n    type: string\n    contentMediaType: application/json\n    contentSchema:\n      \$ref: ./${i}\nrequired:\n  - content" > ${i%.*}Encoded.yaml; done`
generated using: `for i in NotificationDetailBoop NotificationDetailInvite NotificationDetailInviteResponse NotificationDetailRequestInvite NotificationDetailRequestInviteResponse NotificationDetailVoteToKick; do echo -e "title: Websocket$i\ntype: object\nproperties:\n  details:\n    \$ref: ./$i.yaml\nrequired:\n  - details" > Websocket$i.yaml; done`
Some files generated using: `for i in NotificationDetailBoop NotificationDetailInvite NotificationDetailInviteResponse NotificationDetailRequestInvite NotificationDetailRequestInviteResponse NotificationDetailMessage NotificationDetailFriendRequest NotificationDetailVoteToKick; do echo -e "title: ${i}Encoded\ntype: object\nproperties:\n  details:\n    type: string\n    contentMediaType: application/json\n    contentSchema:\n      \$ref: ./$i.yaml\n    x-vrchat-double-encoding-type: $i\nrequired:\n  - details\nx-vrchat-double-encoding: true" > ${i}Encoded.yaml; done`
@C0D3-M4513R
C0D3-M4513R marked this pull request as ready for review September 23, 2026 22:36
@C0D3-M4513R
C0D3-M4513R requested a lite review from Copilot September 23, 2026 22:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@C0D3-M4513R

Copy link
Copy Markdown
Contributor Author

I've fixed the the Rust CI-Error with a new commit in the rust repo.
The error should go away next CI-Run (reruns don't affect this, cause they run on the same commit)

@C0D3-M4513R C0D3-M4513R changed the title POC Websocket types Websocket types Sep 24, 2026
# Conflicts:
#	openapi/components/schemas/Notification.yaml
 # Conflicts:
 #	openapi/components/schemas/_index.yaml
 #

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants