-
Notifications
You must be signed in to change notification settings - Fork 51
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
Always send integer or boolean query parameters to the API server #160
Always send integer or boolean query parameters to the API server #160
Conversation
This PR changes code logic to always send integer or boolean query parameters (even if its value is I suggest introducing a flag: USE_DEFAULT_VALUE_IN_API_SERVER to handle this case: #define USE_DEFAULT_VALUE_IN_API_SERVER -9783 // a magic number
or
#define USE_DEFAULT_VALUE_IN_API_SERVER INT_MIN // INT_MIN is defined in <limits.h>
...
if (gracePeriodSeconds != USE_DEFAULT_VALUE_IN_API_SERVER) // the code in this PR is `if (1)`
{
keyQuery_gracePeriodSeconds = strdup("gracePeriodSeconds");
valueQuery_gracePeriodSeconds = calloc(1,MAX_NUMBER_LENGTH);
snprintf(valueQuery_gracePeriodSeconds, MAX_NUMBER_LENGTH, "%d", gracePeriodSeconds);
keyPairQuery_gracePeriodSeconds = keyValuePair_create(keyQuery_gracePeriodSeconds, valueQuery_gracePeriodSeconds);
list_addElement(localVarQueryParameters,keyPairQuery_gracePeriodSeconds);
}
... But this solution cannot handle the type of What do you think ? |
This is a tricky case. I don't really love the idea of having a magic number to get the defaults, but I also don't love the idea that someone wouldn't get the defaults when they expect to. Ideally we'd use I'm ok to merge this PR as is while we figure this out though. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: brendandburns, ityuhui The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Fixes #158
Regenerate this client code to merge OpenAPITools/openapi-generator#14019