Example JSON API description

Request for path /hello

Used to obtain greetings for the given name.

Input (helloInput)

JSON object with the following fields:

Key name Value type Description
"test" string Name to be used in greetings
"A" int Some numeric parameter
"B" int Some numeric parameter
"size" size

Type size

JSON object with the following fields:

Key name Value type Description
"length" float64 length of the object
"width" float64 width of the object
"height" float64 height of the object

Output (helloOutput)

JSON object with the following fields:

Key name Value type Description
"msg" string Greetings message for the provided name

Request for path /item/get

Used to obtain information about the given product.

Input (itemGetInput)

JSON object with the following fields:

Key name Value type Description
"id" int64 ID of the requested item
"a" string A represents something
"b" array of string
"C" type of "C"

Type of "C"

JSON object with the following fields:

Key name Value type Description
"D" int
"E" int
"f" array of "f"-element
"g" array of arrays of "g"-element

Type "f"-element

JSON object with the following fields:

Key name Value type Description
"A" int
"B" int

Type "g"-element

JSON object with the following fields:

Key name Value type Description
"A" int
"B" int
"C" int

Output (itemGetOutput)

JSON object with the following fields:

Key name Value type Description
"request_id" string request ID assigned by the server
"error" (optional) string only present if there was an error
"name" string
"size" size
"info" info type with anonymous field
"C" type of "C"
"f" array of "f"-element

Type info

JSON object with the following fields:

Key name Value type Description
"length" float64 length of the object
"width" float64 width of the object
"height" float64 height of the object
"weight" float64 weight of the object

Type of "C"

JSON object with the following fields:

Key name Value type Description
"A" string
"B" string

Type "f"-element

JSON object with the following fields:

Key name Value type Description
"A" int
"B" int
"C" int

Request with no fields

Input (empty)

JSON object with no fields.

Input (emptyA)

JSON array of objects with no fields.

Input (emptyAA)

JSON array of arrays of objects with no fields.

Input (emptyO)

JSON object of objects with no fields.

Input (emptyOO)

JSON object of objects of objects with no fields.

Input (emptyAO)

JSON array of objects of objects with no fields.

Input (emptyOA)

JSON object of arrays of objects with no fields.

Request with maps

Input (mapInput)

Output (mapOutput)

JSON object of objects with the following fields:

Key name Value type Description
"I" int
"OI" object of "OI"-element
"OOAI" object of objects of arrays of "OOAI"-element

Type "OI"-element

JSON object with the following fields:

Key name Value type Description
"I" int

Type "OOAI"-element

JSON object with the following fields:

Key name Value type Description
"I" int

Request with arrays

Input (arrayInput)

JSON array of arrays of objects with the following fields:

Key name Value type Description
"AS" array of string
"AAI" array of arrays of int

Request with data from another package

Input (withAnother)

JSON object with the following fields:

Key name Value type Description
"A" Another
"A1" Another
"A11" Another

Type Another

JSON object with the following fields:

Key name Value type Description
"A" int
"S" string

Output (Another)

JSON object with the following fields:

Key name Value type Description
"A" int
"S" string