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

Auto-generated code for main #2636

Merged
merged 1 commit into from
Feb 26, 2025
Merged

Auto-generated code for main #2636

merged 1 commit into from
Feb 26, 2025

Conversation

elasticmachine
Copy link
Collaborator

@elasticmachine elasticmachine commented Feb 26, 2025

This codegen PR applies new logic to how each API function determines where to put passed parameters.

Up to now the logic has been as follows:

  1. if recognized as a body param from the spec, put it in the JSON body
  2. if recognized as a path param, put it in the URL path
  3. otherwise, put it in the querystring

For 9.x and from this PR forward, the logic changes to:

  1. if recognized as a body param from the spec, put it in the JSON body
  2. if recognized as a path param, put it in the URL path
  3. if recognized as a query param or a "common" query param (e.g. pretty, error_trace), put it in the querystring
  4. if not recognized and this API accepts a JSON body, put it in the JSON body
  5. if not recognized and this API does not accept a JSON body, put it in the querystring

This change also updates each API function to only instantiate its arrays of accepted body/path/query param names once per client instance rather than during every function call, by moving the array values up to the constructor or module, depending on which is available.

This change is being made as part of the solution to #2584.

@JoshMock JoshMock merged commit 6f9e106 into main Feb 26, 2025
21 of 22 checks passed
@JoshMock JoshMock deleted the generates_main_code branch February 26, 2025 18:31
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