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

[fix] Aliases are now allowed in path and query parameters #80

Merged
merged 17 commits into from
Aug 30, 2018

Conversation

dansanduleac
Copy link
Contributor

@dansanduleac dansanduleac commented Aug 29, 2018

This fixes a regression introduced in #37 (release 4.0.1)

Fixes #61

Implementation

Add ConjureContextualValidator concept - when validating, it's also given a DealiasingTypeVisitor that can be used to find the de-aliased Type (it's traversed through the object definitions until you find a type that's not a reference type).

The DealiasingTypeVisitor takes the parsed version of the conjure yml types block, in the form of a Map<TypeName, TypeDefinition>, in order to resolve references.

@dansanduleac dansanduleac requested a review from a team as a code owner August 29, 2018 17:45
Copy link
Contributor

@ferozco ferozco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add some tests that would have previously failed

.map(entry -> entry.getValue().visit(
new TypeDefinitionParserVisitor(entry.getKey().name(), defaultPackage, typeResolver)))
.collect(Collectors.toList()))
.build();
.collect(toImmutableMap(td -> td.accept(TypeDefinitionVisitor.TYPE_NAME), td -> td));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why can't we just use the regular collector

@dansanduleac dansanduleac requested review from ferozco and a team August 29, 2018 18:29
@dansanduleac
Copy link
Contributor Author

ferozco
ferozco previously approved these changes Aug 29, 2018
@iamdanfox iamdanfox dismissed ferozco’s stale review August 30, 2018 13:37

Have done more changes

@dansanduleac dansanduleac changed the title [fix] Contextual validators [fix] Aliases now allowed in path and query parameters Aug 30, 2018
@dansanduleac dansanduleac changed the title [fix] Aliases now allowed in path and query parameters [fix] Aliases are now allowed in path and query parameters Aug 30, 2018
@iamdanfox iamdanfox merged commit 891b64d into develop Aug 30, 2018
@iamdanfox iamdanfox deleted the ds/contextual-validators branch August 30, 2018 13:53
@tusharnarayan
Copy link

tusharnarayan commented Sep 4, 2018

hey folks, can we please get a release with this? blocking /f/comments/pull/427 / /f/comments/pull/396

@ferozco
Copy link
Contributor

ferozco commented Sep 4, 2018

Happy to release but please try to avoid adding internal links to external github

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.

4 participants