Repository navigation
openapi_to_funcs / OpenApiFunc route arguments by place (#22) - #25
Merged
Merged
Conversation
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.
Closes #22.
add_property(shared withRoute.params) keeps same-name parameters/body properties apart withx-oas-name/x-oas-in;openapi_to_funcsbuilds itsparam_schemawith it, so path-item parameters (already merged byRoute) and same-name parameters both work.OpenApiFunc.__call__sends each argument by place under the spec's name: path, query, header and cookie (headers/cookies were sent as query before;headers=/cookies=are passed toget_responseonly when there are some), body (object properties, or the array body argument). Argument names that are not identifiers go throughschema_param_names.generate_openapi_clientpath,merge_request_body_json_schema), and array bodies still flatten differently inRoute.params(ho) vs here (single argument).Test: new end-to-end test with a fake
get_response. 95 passed.Adversarial review (fresh Opus): verdict fix-then-merge; the branch fixes many master bugs (camelCase/hyphenated path params,
$select/X-MS-API-ROLEdropped, cookies, same name in two places). Fixed: the generated-clientparam_schemashape (parameterslist, noproperties) no longer crashes_places; a non-object body no longer sends{}. Behaviour changes, noted: a customget_responsemust acceptheaders/cookieskwargs if the spec has header/cookie parameters (they were silently dropped before); a parameter with noingoes to the body when there is one (query before); an undeclared{id}in the URI is only sent in the path. 96 passed.🤖 Generated with Claude Code