-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
[REQ] Generated client library should hardcode parameters that are required and can have Only Single valid value #16547
Labels
Comments
prashant-pant
changed the title
[REQ] Generated client library should hardcode parameters that are required and can have single valid value
[REQ] Generated client library should hardcode parameters that are required and can have Only Single valid value
Sep 9, 2023
wing328
pushed a commit
that referenced
this issue
Sep 15, 2023
…va (OkHttp) Implementation of #16547 (#16550) * Autosets the parameters with the only value specified as enum if the parameter is also marked as required * Autosets the parameters with the only value specified as enum if the parameter is also marked as required * Autosets the parameters with the only value specified as enum if the parameter is also marked as required for Java default client. * Autosets the parameters with the only value specified as enum if the parameter is also marked as required for Java default client. * Autosets the parameters with the only value specified as enum if the parameter is also marked as required for Java default client. * Autosets the parameters with the only value specified as enum if the parameter is also marked as required for Java default client.
prashant-pant
added a commit
to prashant-pant/openapi-generator
that referenced
this issue
Oct 8, 2023
…thon Implementation of OpenAPITools#16547
AlanCitrix
pushed a commit
to AlanCitrix/openapi-generator
that referenced
this issue
Oct 26, 2023
…penAPITools#16761) * Autoset constants (Required fields having single valid enum value) Python Implementation of OpenAPITools#16547 * Fixing ``PythonClientCodegenTest.testHandleConstantParams`` for Windows platform.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
Consider below OpenAPI file
The header
X-CUSTOM_CONSTANT_HEADER
is marked as required that means that clients must pass this header and the value of header can only be "CONSTANT_VALUE".The code generated expects both
CUSTOM_CONSTANT_HEADER
andname
as argument.Describe the solution you'd like
The generated library code can hardcode the value of
X-CUSTOM_CONSTANT_HEADER
i.e.CONSTANT_VALUE
in all requests and should be able to function with onlyname
as argument.The default behavior of library generator can remain unchanged for now and This feature can be enabled conditionally if we introduce a new flag/property for eg.
autosetConstant
and this is explicitly enabled via CLI/Config.Describe alternatives you've considered
Below OpenAPI features are not useful in this case
Default : The OpenAPI Spec mentions that default value is the value which Server will use if client does not send any value. It does not describe default as the value which client will send if the value is not set by the caller.
Additional context
Stackoverflow Question asked
The text was updated successfully, but these errors were encountered: