You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was wondering if there is any interest in specifying the types of each response instead of just using Any. The types could be taken from the official API written in Typescript. I looked through #9 and so instead of using dataclasses, I'm proposing type hinting everything using TypedDict. This would make things quite easy for the users since they would get features like autocomplete and would be able run their code through a type checker. Essentially I'm suggesting something like the following:
However, one possible issue I'm seeing with this approach is that the return types of the endpoints currently are not suitable for this as far as I know. The SyncAsync[T] does not work well with type checkers so instead separate endpoints classes for synchronous and asynchronous endpoints would need to be maintained.
The text was updated successfully, but these errors were encountered:
Yupp I'm willing to add them and maintain them as well. I'll start working on it and hopefully if this makenotion/notion-sdk-js#294 gets resolved, then maintenance would be much easier.
I was wondering if there is any interest in specifying the types of each response instead of just using
Any
. The types could be taken from the official API written in Typescript. I looked through #9 and so instead of using dataclasses, I'm proposing type hinting everything usingTypedDict
. This would make things quite easy for the users since they would get features like autocomplete and would be able run their code through a type checker. Essentially I'm suggesting something like the following:However, one possible issue I'm seeing with this approach is that the return types of the endpoints currently are not suitable for this as far as I know. The
SyncAsync[T]
does not work well with type checkers so instead separate endpoints classes for synchronous and asynchronous endpoints would need to be maintained.The text was updated successfully, but these errors were encountered: