Prevent flattened additionalProperties keys from colliding with declared properties
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 48/100
Research direction
No file or test path is named. Start by tracing the generated representation and serialization/deserialization paths for declared properties and typed additionalProperties; compare the proposed map wrapper or newtype options. Done means declared names cannot be inserted as additional keys, and the requested construction, conflict-free serialization, key routing, and round-trip tests pass.
Written by the indexing model from the issue text.
Description
Problem
For an object schema with declared properties and typed additionalProperties, Typify generates a struct containing the declared fields plus a public flattened map. Callers can insert a declared property name into that map. For example, a map entry named id can conflict with the struct's declared id field and may produce duplicate or ambiguous serialized keys.
Deserialization routes declared names to their declared fields, so unrestricted construction of the flattened map does not preserve the same invariant in both directions.
Possible direction
Represent additional-property keys with a generated newtype or map wrapper that rejects names reserved by declared properties. The exact representation should preserve normal map ergonomics while preventing invalid construction and serialization.
Coverage
Add tests for:
- constructing the additional-properties map with a declared key;
- serialization without duplicate/conflicting keys;
- deserialization of declared and additional keys;
- serialize/deserialize round trips.
This was identified while reviewing #1039 and is intentionally kept separate from that PR's narrow invalid-Rust fix.
- Dominant language
- Rust
- Stars
- 905
- Forks
- 116
- Avg merge
- 13h 19m
- Merged PRs (30d)
- 16
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from oxidecomputer/typify
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
oxidecomputer/typify#1077 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
oxidecomputer/typify#1075 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 50/100
oxidecomputer/typify#1060 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
oxidecomputer/typify#1022 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
oxidecomputer/typify#1011 ·
Maintainers usually reply within 1 day
All issues in oxidecomputer/typify
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
rust-windowing/winit#4731 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
area:cli bug priority:high
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Anthropic streamed blocks without a content_block_stop are discardedPossibly taken @Frun1na claimed this today. Opencomponent:sight
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
agentic-os-org/ANOLISA#4622 · 1 comment ·
Maintainers usually reply within 1 day