Skip to content

openapi_to_funcs / OpenApiFunc route arguments by place (#22) - #25

Merged
thorwhalen merged 2 commits into
masterfrom
openapifunc-by-place-22
Oct 13, 2026
Merged

thorwhalen merged 2 commits into
masterfrom
openapifunc-by-place-22

Conversation

@thorwhalen

@thorwhalen thorwhalen commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Closes #22.

  • add_property (shared with Route.params) keeps same-name parameters/body properties apart with x-oas-name/x-oas-in; openapi_to_funcs builds its param_schema with it, so path-item parameters (already merged by Route) 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 to get_response only when there are some), body (object properties, or the array body argument). Argument names that are not identifiers go through schema_param_names.
  • Not changed: the openapi-python-client based generator (generate_openapi_client path, merge_request_body_json_schema), and array bodies still flatten differently in Route.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-ROLE dropped, cookies, same name in two places). Fixed: the generated-client param_schema shape (parameters list, no properties) no longer crashes _places; a non-object body no longer sends {}. Behaviour changes, noted: a custom get_response must accept headers/cookies kwargs if the spec has header/cookie parameters (they were silently dropped before); a parameter with no in goes 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

thorwhalen and others added 2 commits October 13, 2026 12:14
…me) (#22)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…object bodies (#22)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@thorwhalen
thorwhalen merged commit 9d91946 into master Oct 13, 2026
8 checks passed
@thorwhalen
thorwhalen deleted the openapifunc-by-place-22 branch October 13, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenApiFunc (and openapi_to_funcs) still key parameters by name only

1 participant