Skip to content

fix(sputnik): support Vec<T> and Option<Vec<T>> in JsonData nested conversion#2814

Merged
peterpeterparker merged 1 commit into
mainfrom
fix/vec-macros
Jun 6, 2026
Merged

fix(sputnik): support Vec<T> and Option<Vec<T>> in JsonData nested conversion#2814
peterpeterparker merged 1 commit into
mainfrom
fix/vec-macros

Conversation

@peterpeterparker

Copy link
Copy Markdown
Contributor

Motivation

Includes junobuild/juno-js#895 and extend macros to support nested JsonData in Vec.

@peterpeterparker peterpeterparker merged commit 23bf20f into main Jun 6, 2026
28 checks passed
@peterpeterparker peterpeterparker deleted the fix/vec-macros branch June 6, 2026 06:53
AntonioVentilii added a commit to AntonioVentilii/vici-app that referenced this pull request Jun 6, 2026
…ises camelCase) (#581)

## What

Removes the snake_case wire-format workaround across the satellite + FE
now that Juno serialises `Vec<NestedStruct>` in camelCase (like
`Option`).

- `src/satellite/utils/wire-format.utils.ts`: every wire schema +
`toWire…` converter is camelCase; one schema per type for both
`j.array(...)` and `j.optional(...)` results (no more parallel snake
schemas)
- `leagues` / `tournament` / `worlds` FE services: projectors read
camelCase; the duplicate league projector (`projectLeagueWire` vs
`projectLeagueOptionWire`) is collapsed into one
- regenerated `satellite.api.ts` with CLI 0.15.6 (Candid `.did`/factory
are unchanged — Candid is always snake_case; only the FE schema flips)
- CI: bumped the pinned juno CLI `0.15.4 → 0.15.6` in `checks.yml` and
`e2e.yml`

## Why

Upstream fixes (verified released): junobuild/juno-js#895 (codegen emits
`#[json_data(nested)]` for `Vec`, in `@junobuild/functions-tools@0.6.9`)
+ junobuild/juno#2814 (the `JsonData` macro handles nested `Vec`, in
juno `v0.0.78`). Built our satellite with 0.15.6: the Vec fields flip to
nested (27 → 57 attrs) and compile, so the snake_case layer is now
obsolete and actively wrong (the wire is camelCase but `toWire` emitted
snake → vec endpoints would trap).

## Requires

juno CLI ≥ 0.15.6 to build and deploy. This is breaking on older
toolchains, and the satellite must be redeployed on 0.15.6.

## Notes

- Builds on #512 (the league invite-lookup fix) and supersedes it — that
bug is fixed here the camelCase way. Merge/close coordination is up to
you.
- Minor leftover: the satellite still defines a redundant
`LeagueOptionWireSchema` / `toOptionWireLeague` (now identical to the
base league schema/converter). Harmless; can be collapsed in a
follow-up.

## Checks

`npm run check` (0 errors / 0 warnings) and `npm run quality` (prettier
+ eslint + i18n) pass locally.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant