-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rfc: generate client stubs from openrpc definitions #4295
Conversation
…ions | datamodel-codegen --input-file-type jsonschema --output-model-type pydantic_v2.BaseModel > out.py
Love this idea, |
@@ -0,0 +1,265 @@ | |||
from .definitions import * |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shall we include the requirements.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question - added packaging/shipping as a TODO
I like it. Can we test it the same way we currently test |
I'm okay with that, provided it's outside of the Forest repository. That way, it can live its own life, have possibly different owners and priorities when it comes to maintenance. What do you think @aatifsyed? |
I meant this PR as a sustainable transition away from From discussion here and offline, I think you're saying:
In which case, we should
|
To my knowledge, nobody will miss this feature, yes. It's been now quite some time since it was introduced, and I don't recall anyone using it. I'm not saying we should completely drop this, but this should be a carefully considered decision. It does seem like an interesting thing to introduce to the ecosystem that may encourage people to tinker around more and prototype stuff. If we are okay with maintenance, let's do it, actively with all the best practices in mind. This means:
Otherwise, it's going to live in its own little directory, and folks will never hear about it. That is, let's do it right, or not at all. Naturally, it's my subjective standpoint and shouldn't be considered a blocker. |
forest-cli attach
, which is the integrated Javascript shell where users can make callstrait RpcMethod
inforest-cli attach
#4141 tracks defining a pattern for calling each of those methodsHowever, there are some downsides to that approach:
I propose we generate stubs from our OpenRPC definitions, and ship a client-as-a-library for users who want it. We delete forest-cli attach.
This PR demonstrates
datamodel-codegen
to create types for python, with full auto-complete support in interpreters or your IDE:Outstanding questions
forest-cli attach
?