Fix a few issues with the C generator (part 3)#20269
Merged
wing328 merged 6 commits intoOpenAPITools:masterfrom Dec 10, 2024
Merged
Fix a few issues with the C generator (part 3)#20269wing328 merged 6 commits intoOpenAPITools:masterfrom
wing328 merged 6 commits intoOpenAPITools:masterfrom
Conversation
Before making an api call, reset apiClient->response_code to zero. That will protect us from checking stale values if the curl request fails.
Check early on that the arguments are not null, to prevent crashes on strdup() calls.
Check if the api call returned an error before attempting to parse the reply as the expected type.
Member
|
thanks for the PR if no feedback from anyone, i'll merge it next week |
jorgeferdz
pushed a commit
to jorgeferdz/openapi-generator
that referenced
this pull request
Dec 10, 2024
* [C] Clear the response code from previous api calls Before making an api call, reset apiClient->response_code to zero. That will protect us from checking stale values if the curl request fails. * [C] Check that string arguments are not null Check early on that the arguments are not null, to prevent crashes on strdup() calls. * [C] Don't attempt to fill in a type with error info Check if the api call returned an error before attempting to parse the reply as the expected type. * [C] Handle binary and integer return types * [C] Update test schemas with binary and integer return types * Update samples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four more patches from the original pull request at #14379. The first three patches are for runtime issues; they are already covered by the current test schemas, but the tests pass anyway. I do include updated schemas for the fourth patch, which allows api calls to return integers and binary strings.
@wing328 @ityuhui @zhemant @michelealbano
As usual, thank you for taking the trouble of dealing with my patches, and I'll be happy to make any changes you require.