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

Sync OpenAPI & template fix; Multiple parameter correctness changes #150

Merged
merged 2 commits into from
Jul 25, 2023
Merged

Sync OpenAPI & template fix; Multiple parameter correctness changes #150

merged 2 commits into from
Jul 25, 2023

Conversation

maxb
Copy link
Contributor

@maxb maxb commented Jul 25, 2023

This includes the results of:

The general direction of change is pretty positive, but in reviewing the
generated diffs, I have spotted an issue: we are now generating correct
parameters for query parameters... but those query parameters are being
handled as individual function parameters... which are generated in the
order listed in the OpenAPI spec... which is dependent on random Go hash
iteration ordering. Ugh.

Oh well, let's catch up with latest developments in the Vault repo for
now, and I'll go put in a new PR to at least sort the parameters
alphabetically.

Longer term, this is probably going to push us in the direction of
excluding the GET version of APIs with equivalent GET and POST versions
from the generated libraries.

Besides the OpenAPI sync, a small fix to the templates is included -
adding a missing using directive.

This includes the results of:
* hashicorp/vault#21949
* hashicorp/vault#21942
* hashicorp/vault#22027

The general direction of change is pretty positive, but in reviewing the
generated diffs, I have spotted an issue: we are now generating correct
parameters for query parameters... but those query parameters are being
handled as individual function parameters... which are generated in the
order listed in the OpenAPI spec... which is dependent on random Go hash
iteration ordering. Ugh.

Oh well, let's catch up with latest developments in the Vault repo for
now, and I'll go put in a new PR to at least sort the parameters
alphabetically.

Longer term, this is probably going to push us in the direction of
excluding the GET version of APIs with equivalent GET and POST versions
from the generated libraries.
@maxb maxb requested a review from a team July 25, 2023 04:12
@maxb
Copy link
Contributor Author

maxb commented Jul 25, 2023

Oh, interesting. It appears there is now a build failure. There must be a problem with the templates, causing them to generate uncompilable code. Fixed.

@maxb maxb changed the title Sync OpenAPI; Multiple parameter correctness changes Sync OpenAPI & template fix; Multiple parameter correctness changes Jul 25, 2023
Copy link
Collaborator

@averche averche left a comment

Choose a reason for hiding this comment

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

Thanks 🎉

@averche averche merged commit ce26ec2 into hashicorp:main Jul 25, 2023
@maxb maxb deleted the sync-openapi branch July 25, 2023 15:49
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.

2 participants