-
Notifications
You must be signed in to change notification settings - Fork 685
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
Draft PR to enable JsonSchema for RPC endpoints #12961
base: master
Are you sure you want to change the base?
Conversation
Example of JsonSchema for `near_primitives::views::BlockView`
Schema for RpcTransactionResponse
|
This looks really promising in general, but I spotted a few obvious problems with custom serialization types: CryptoHash is serialized as base58 string value (not an array of numbers), PublicKey is serialized as : string (not enum) @PolyProgrammist lets fix these with annotations and try to do the following exercise manually:
|
…ith=dec_format for all
current typify output for transaction
for block
|
@PolyProgrammist The fact that we can deserialize the pretty complex structure is amazing! Let's go ahead and apply schemars to all JSONRPC-involved structs and move on to generating the OpenAPI spec as per our discussion |
temporary repo for typify https://github.com/PolyProgrammist/thetypify |
…_serializing_if="vec::is_empty" ensures schema is valid
No description provided.