Skip to content
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

ResolverFully doesn't resolve arrays recursively #994

Open
exlevan opened this issue Jan 21, 2019 · 1 comment
Open

ResolverFully doesn't resolve arrays recursively #994

exlevan opened this issue Jan 21, 2019 · 1 comment

Comments

@exlevan
Copy link

exlevan commented Jan 21, 2019

The logic in ResolverFully seems to be flawed:

if(arrayModel.getItems().get$ref() != null) {
arrayModel.setItems(resolveSchema(arrayModel.getItems()));
} else {
arrayModel.setItems(arrayModel.getItems());
}

If array's items schema is a reference, it's resolved. If it isn't, then nothing is done (we're getting items from the array, then setting them back. Hmm…)
But the case when array's items schema is an array, object or a composed schema, which contain references, is unhandled; those references are never resolved.
I propose removing this check and replacing it with arrayModel.setItems(resolveSchema(arrayModel.getItems())), which will take care of resolving the references.

@gracekarina
Copy link
Contributor

Hi, @exlevan can you please send us a PR with a test case where you show us how resolverFully it's failing now, and how it can be improved? Thanks.

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

No branches or pull requests

2 participants