Skip to content

fix(examples): read profile fields through getPublicProfile - #42

Merged
binn merged 1 commit into
mainfrom
fix/examples-spec-1.21
Sep 16, 2026
Merged

binn merged 1 commit into
mainfrom
fix/examples-spec-1.21

Conversation

@binn

@binn binn commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

Every repository_dispatch build since specification v1.21.0 (twelve today) has failed with CS1061 in examples/VRChat.API.Examples.AspNetCore/Controllers/HomeController.cs.

Spec commit vrchatapi/specification@2a62f54 moved bio, bioLinks, badges and the currentAvatar* fields off CurrentUser and User (only CurrentUser keeps currentAvatar*). They now live behind getPublicProfile, which also gained asSelf for the owner's own view. The AspNetCore example still read them off the user objects.

This PR fetches the public profile alongside the user in both example endpoints:

  • /api/users/current uses GetPublicProfileAsync(user.Id, asSelf: true) for badges, bio and bio links, keeping CurrentAvatarImageUrl from CurrentUser.
  • /api/users/{id} uses GetPublicProfileAsync(id) for badges, bio, bio links and the current avatar image.

The example was the only code in examples/, wrapper/ or the docs that referenced any field removed or retyped in v1.21.0.

Verification

Regenerated locally from v1.21.0/openapi-legacy.yaml with generate.sh and openapi-generator 7.17.0, then dotnet build VRChat.API.sln -c Release: 0 warnings, 0 errors. The regenerated src/ is not part of this PR since CI regenerates it on every run.

馃 Generated with Claude Code

Specification v1.21.0 moved bio, bioLinks, badges and the current-avatar
fields off CurrentUser and User (only CurrentUser keeps currentAvatar*).
They are now served by getPublicProfile, which also gained asSelf for the
owner's own view. The AspNetCore example still read them off the user
objects, so every repository_dispatch build since that release failed
with CS1061 in HomeController.

Fetch the public profile alongside the user in both endpoints instead.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@binn
binn merged commit 63dd5ad into main Sep 16, 2026
6 checks passed
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.

1 participant