Skip to content

struct spread skips unknown map keys - #92

Merged
kryptamine merged 4 commits into
masterfrom
spread-skips-extra
Nov 16, 2026
Merged

kryptamine merged 4 commits into
masterfrom
spread-skips-extra

Conversation

@kryptamine

Copy link
Copy Markdown
Owner

A map spread into a struct literal now skips keys that name no field, so User { ...json.parse(body) } takes what it needs from an API response. Fields without a default are still required.

… takes what it needs from a larger document; required fields are still checked
…m in a map, and throws a typed error on a 404
…r, PATCH a map of changes, DELETE into a struct
@kryptamine
kryptamine merged commit 6cd32eb into master Nov 16, 2026
3 checks passed
@kryptamine
kryptamine deleted the spread-skips-extra branch November 16, 2026 20:23
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