In API blueprint I am looking to specify an optional json element for a POST message. Example for;
### Add a new User [POST]
To add a User send a JSON .....
+ Request (application/json)
{
"name": "A name",
"age": 30
}
How do I indicate to reader of API that age is optional in API call but still show that it's an integer?
~Colin
I recommend table of document fields like this one.
### Source Fields
| field | required | type | example | description |
|------------|:-:|-------------|----------------------------------------|-------------|
| name | * | string | `average-lead-time-frontend` | Unique name for machines, used as reference key and for url usage. |
| title | * | string | `Average Lead Time Frontend` | Title for humans. |
| sourcetype | * | string | `team-avgLeadTime` | Source type identificator. |
| groups | | list | `["engagement-analytics", "builder"]` | List of groups where entity is member. |
| options | | object | `{ "team": 21926 }` | Addition options for sourcetype. |
| data | | list | `[70.3, 31.8]` | Actual data held by Source. |
Generated table of fields: http://i.stack.imgur.com/cxocx.png
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With