You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that the old version correctly generated schema information indicating that the contents of the field are an Object with uint32s as values. Without this, the generated schemas are missing that information, which ultimately (in our use case) leads to incorrectly generated TypeScript types.
The text was updated successfully, but these errors were encountered:
snoyberg
added a commit
to Levana-Protocol/cosmwasm
that referenced
this issue
Dec 10, 2024
That is.. an interesting effect of that visitor. It definitely shouldn't have that kind of effect. The reason for the visitor was to prevent the TypeScript type generator to add a field to capture potential additional properties that weren't covered by the schema without adding #[serde(deny_unknown_fields)] (which had undesired issues for users; see #2019)
This might be a weird interation between map types and the additional_properties field? Not sure. I'll check that..
I don't know much about the JSON schema standard, so I'm not sure of the right outcome here. I appreciate you looking into it. I'd be happy to test out any changes against our codebase if it would be helpful.
Sorry for the confusing title, allow me to demonstrate. I bisected this issue down to the commit:
e470075
You can see the issue with this code:
With cosmwasm-schema version 2.0.2, the output I receive is:
But with version 2.1.2, instead I get:
Since that's a lot of content, here's the diff between the two:
Note that the old version correctly generated schema information indicating that the contents of the field are an Object with
uint32
s as values. Without this, the generated schemas are missing that information, which ultimately (in our use case) leads to incorrectly generated TypeScript types.The text was updated successfully, but these errors were encountered: