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

Generating path for client is transforming all relevant types to string first. #977

Merged
merged 3 commits into from Dec 16, 2016

Conversation

Projects
None yet
2 participants
@rootpd
Contributor

rootpd commented Dec 15, 2016

I have a feeling that it could be done with a bit less duplicity within initParams. Opened to any ideas (or just push a change) :).

PR is fixing issue #961, which was partially fixed yesterday.

@rootpd

This comment has been minimized.

Show comment
Hide comment
@rootpd

rootpd Dec 15, 2016

Contributor

I see the failing Travis. Going for christmas party, will take care tomorrow (central europe time). :)

Contributor

rootpd commented Dec 15, 2016

I see the failing Travis. Going for christmas party, will take care tomorrow (central europe time). :)

Show outdated Hide outdated goagen/gen_client/generator.go Outdated
Show outdated Hide outdated goagen/gen_client/generator.go Outdated
@raphael

This comment has been minimized.

Show comment
Hide comment
@raphael

raphael Dec 15, 2016

Member

Thank you for doing this! looks great. I suggested a couple of tweaks in the comments. Have fun at the party :)

Member

raphael commented Dec 15, 2016

Thank you for doing this! looks great. I suggested a couple of tweaks in the comments. Have fun at the party :)

@rootpd

This comment has been minimized.

Show comment
Hide comment
@rootpd

rootpd Dec 16, 2016

Contributor

Thanks for the hints and patience! This time it even looks greener than the last time :).

Contributor

rootpd commented Dec 16, 2016

Thanks for the hints and patience! This time it even looks greener than the last time :).

@rootpd

This comment has been minimized.

Show comment
Hide comment
@rootpd

rootpd Dec 16, 2016

Contributor

Found one more bug with the order of generated params, expect one more commit. I've realized that initParams is iterating Object which is a randomized-order map. That means that also generated params are being generated in random order.

Contributor

rootpd commented Dec 16, 2016

Found one more bug with the order of generated params, expect one more commit. I've realized that initParams is iterating Object which is a randomized-order map. That means that also generated params are being generated in random order.

Route params cannot be generated by iterating map.
Route params need to be generated and used in Sprintf
in a correct order. As the AttributeDefinition.Type is always
a map, for route params we need to maintain this order by
other means. In this case by manufacturing AttributeDefinition
separately for each route param.
@raphael

This comment has been minimized.

Show comment
Hide comment
@raphael

raphael Dec 16, 2016

Member

Thank you for the great PR!

Member

raphael commented Dec 16, 2016

Thank you for the great PR!

@raphael raphael merged commit c8c5ad7 into goadesign:v1 Dec 16, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment