Skip to content

Instantly share code, notes, and snippets.

@meowsbits
Last active May 18, 2020 23:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meowsbits/986d6afdfb5c8ccb9f7afde80f8123cc to your computer and use it in GitHub Desktop.
Save meowsbits/986d6afdfb5c8ccb9f7afde80f8123cc to your computer and use it in GitHub Desktop.
Example OpenRPC document generated by https://github.com/etclabscore/go-openrpc-reflect.
{
"openrpc": "1.2.4",
"info": null,
"methods": [
{
"name": "MyCalculator.PlusOne",
"description": "```go\nfunc (c *MyCalculator) PlusOne(arg *PlusOneArg, reply *PlusOneReply) error {\n\tif arg == nil {\n\t\treturn errBadUse\n\t}\n\tanswer := *arg + 1\n\tc.history = append(c.history, int(answer))\n\t*reply = (PlusOneReply)(answer)\n\treturn nil\n}// PlusOne is deceivingly simple function that increments any value by 1.\n\n```",
"summary": "PlusOne is deceivingly simple function that increments any value by 1.\n",
"paramStructure": "by-position",
"params": [
{
"name": "arg",
"description": "*PlusOneArg",
"schema": {
"type": "integer"
},
"required": true
}
],
"result": {
"name": "reply",
"description": "*PlusOneReply",
"schema": {
"type": "integer"
},
"required": true
},
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/etclabscore/go-openrpc-reflect/blob/master/example1_test.go#L36"
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment