Skip to content

Fix: path parameters must always be required per OpenAPI spec#82

Merged
renardeinside merged 1 commit intomainfrom
feat/fix-parameters-in-generator
Feb 17, 2026
Merged

Fix: path parameters must always be required per OpenAPI spec#82
renardeinside merged 1 commit intomainfrom
feat/fix-parameters-in-generator

Conversation

@renardeinside
Copy link
Copy Markdown
Collaborator

Summary

  • Enforce required: true for path parameters in normalize_param(), per the OpenAPI 3.0 spec which mandates path params are always required
  • Fixes issue where FastAPI-generated specs omit required for path params (since it's implied), causing generated TypeScript hooks to treat params as optional and producing tsc errors under strict: true
  • Add test verifying path params without explicit required field generate non-optional TypeScript params

Closes #79

Test plan

  • cargo test -p apx-core openapi — all 103 tests pass
  • just fmt — clean
  • just check — all checks pass
  • New test test_path_params_required_even_when_omitted validates fetch function and hook signatures

🤖 Generated with Claude Code

@renardeinside renardeinside merged commit b8f7105 into main Feb 17, 2026
3 checks passed
@renardeinside renardeinside deleted the feat/fix-parameters-in-generator branch February 17, 2026 11:11
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.

🐛 [BUG] Code generator doesn't mark path parameters as required, causing TypeScript errors

1 participant