Documentation
¶
Overview ¶
Package jsonrpc reads a server's own description of its JSON-RPC methods into the document the importer takes, so that a server with no OpenAPI document (TrueNAS, whose REST API is going) gets the same generated package as one with.
The description is the answer to TrueNAS's core.get_methods: one object, method name to what the method takes (accepts, one JSON Schema per positional parameter in order), what it answers (returns, one schema), the roles that may call it and whether it runs as a job. Every schema is written out in full where it is used, so a record shared by many methods appears many times, under its class name as the schema's title where it has one and under the parameter's or property's name where it does not. Parse folds every record of one shape into one component: named by its class where any occurrence has one, by the one name its occurrences share where they have none (the query options of every query are QueryOptions), and otherwise each occurrence by the method and parameter or the record and property it sits in. An enum is a type named for the record and property it sits in. Each method becomes the Call operation of a path named for it, its parameters In "call" in order, its answer the 200 response, and its namespace (pool, pool.dataset) the tag it is grouped by.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Load ¶
Load reads a description from a file; title and version name the server in the document's info block.
Types ¶
This section is empty.