-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
enhancementNew feature or requestNew feature or request
Description
When directly using methods decorated with @endpoint, IDEs won't read and recommend arguments:
@endpoint('/v2/delegates')
async def get_delegates(self, query_params: V2DelegatesFilter) -> SafeDelegateResponse:
...This makes it difficult to remember what params are used. (I don't mind instantiating the Pydantic Filter since it autocompletes, but the IDE won't even tell me that this method requires V2DelegatesFilter)
The workarounds to this all require duplication:
- Rename decorated method to be internal and add a public one with the
- Duplicate the Filter as a
TypedDictand usetyping.Union(which might work with meatie if it handles TypedDicts, but foregoes the Pydantic-specific methods my BaseFilter has, including the customunwrap()) - Define stubs in a
.pyifile.
My (very rudimentary) understanding is that the decorator needs to do something with the function signature, but I was personally unable to work out how to make that happen.
Unsure if this is feasible to do, but any 'auto-magic' ways to interact with the endpoints in my IDE would be really helpful!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request