.. -*-coding: utf-8-*- .. rest2web header restindex page-title: simple is better - JSON-RPC 2.0 DRAFT: Simple Method Description crumb: JSON-RPC 2.0 DRAFT: Simple Method Description page-description: JSON-RPC 2.0 DRAFT: Simple Method Description /description tags: simple RPC, JSON, json-rpc, JSON-RPC 2.0, Method Description initialheaderlevel: 2 format: rest encoding: utf-8 output-encoding: None /restindex uservalues blockquote: linksource: site_copyright: webmaster(at)simple-is-better(dot)org /uservalues ============================================= DRAFT: Simple Method Description For JSON-RPC ============================================= :Author: \? Example:: //SMD for a JSON-RPC service example { transport: "RAW_POST", envelope: "JSON-RPC", serviceUrl: "/service", methods: { add: { parameters: [ // an array indicates that positional parameters should be used for this method {type: "integer", default: 0}, {type: "integer", default: 0}, ], returns:"integer" }, divide: { description:"Do division", parameters: { // an object indicates that named parameters should be used for this method divisor:{type:"integer"}, dividend:{type:"integer"} }, returns:"float" }, simple: {},// no requirements on parameters or return type getAddress : { description : "Takes a person and returns an address", parameters : { person : {type: // for the type we use a schema {firstName:{type:"string"},lastName:{type:"string"}} }, }, returns : // use a schema for the return type {street:{type:"string"},zip:{type:"string"},state:{type:"string"},town:{type:"string"}} } } }