Skip to content

Add type hints for router methods meta kwargs#18

Draft
flapili wants to merge 1 commit into
mr-fatalyst:masterfrom
flapili:feature/type-meta-kwargs
Draft

Add type hints for router methods meta kwargs#18
flapili wants to merge 1 commit into
mr-fatalyst:masterfrom
flapili:feature/type-meta-kwargs

Conversation

@flapili

@flapili flapili commented Jun 18, 2026

Copy link
Copy Markdown

Pull Request

Thanks for contributing to FastOpenAPI!
Before submitting, please make sure you've read CONTRIBUTING.md.


What’s Included?

  • New feature
  • Bug fix
  • Documentation improvement
  • Refactor / internal change

Describe your changes:
Adding type hint to document usage of router's methods like get/post/... to help autocompletion, does not change runtime behavior

For now the code is draft, contains TODOs and I was not sure where I should put the Meta class so in the meantime, I nested it in the router 👀


How Was It Tested?

For now only checking autocompletion & docstring work in editor (I noticed that Ty lsp does not handle fields docstrings in typedDict yet(?) but pylance do work)


Anything Else?

Optional:

  • Any TODOs or follow-up items?
  • Where Meta should be located?
  • check sys.version_info to import Unpack & NotRequired for 3.11 & 3.12 respectivly ?
  • Known limitations or trade-offs?
  • Anything you'd like reviewers to focus on?
  • I'm not sure about how to word docstrings properly

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.

1 participant