Skip to content

Fixes a bug that prevented using complex dictionaries within compositions #965

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

nikopavlica
Copy link
Contributor

Fixes #964.

In case of "simple" dictionary (Record<string, number> or Record<string,array<number>>, model.type was set to number in parser/getModel.ts function. But in case of composite, type was not explicitly set and defaulted to any.

I didn't want to change this type in the getModel function, as it might have some other implications, so I just added another check in when to ignore a model within composition.

Added 3 more test objects to the suite, so it covers all three cases.

@ferdikoomen
Copy link
Owner

@nikopavlica Nice work, will test the PR in some API's and let you know how it goes

@vyobukhov
Copy link
Contributor

@ferdikoomen any news about merging this one or maybe any help needed?

Really waiting for it to be merged, thx!

@ferdikoomen ferdikoomen merged commit 54d1bfe into ferdikoomen:master Feb 25, 2022
@ferdikoomen
Copy link
Owner

@vyobukhov @nikopavlica merged, will release a new version soon (0.20.0), fixing some other bugs as well

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.

Using complex dictionaries within compositions (oneOf, anyOf, allOf) generates wrong code
3 participants