jsonrpc

package
v0.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2026 License: GPL-3.0 Imports: 11 Imported by: 0

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

func Load(file, title, version string) (*openapi.Spec, []string, error)

Load reads a description from a file; title and version name the server in the document's info block.

func Parse

func Parse(data []byte, title, version string) (*openapi.Spec, []string, error)

Parse reads a description into a document, and says in notes what it could not fold: a name under which two records differ, which get numbered names, and a record named as the package names a method's answer.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL