-
Notifications
You must be signed in to change notification settings - Fork 218
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
api surface revamp for query parameters #1494
Comments
In TypeScript, the convention is to use an interface for config options and the config option could go in abstractions. Example:
|
@nikithauc I think both can be achieved, I'll start by restructuring things to a single parameter using a class with properties like described above. And through your work in #1013 you can replace that class by an interface in a refiner to provide a better experience to end users. |
Curious on what is the purpose of using a class here? |
Because most languages do not allow object notation to infer to a type instance and/or require a class to implement the interface. The only exception to date being typescript and maybe ruby/Python |
I would create another issue separate from the models interface work so that this is tracked. The scopes for the issues vary. |
sure, go ahead! |
The current generation process results in the following request executor methods. (this is an exhaustive sample)
Except for Go which uses a wrapper class because the language doesn't support overloads any other way than through naming conventions.
This solution is a problem as query parameters are not always described, which means the parameter is not always added. If a parameter is described in a later generation, and if consumers don't/can't use named parameters, this will end-up as a breaking change. And we don't want to have to major rev for such minor changes.
This issue proposes to use a configuration wrapper object for: query parameters, requestHeaders, and requestOptions. And leave the body and the response handler outside of that wrapper object. This would have the following advantage:
Example usage:
We have considered this alternative (removing the action) but it was ruled out so the generation can pre-populate some values in the future if required.
The text was updated successfully, but these errors were encountered: