If I define a resource type with sample values, how can I override them for specific examples?
I tried this, but the rendered output ignores the Body and uses the global Sample instead.
### Read item [GET]
+ Response 200
+ Attributes (A, fixed-type)
+ Body
{ "name": "Hello", "bs": [{ "key": "value" }]}
# Data Structures
## A
+ name: foo(string, required)
+ bs (array[B], optional, fixed-type)
+ Sample
+ key: baz
+ key: bat
## B
+ key (string, optional)
Bizarrely, if you remove the sample values from the schema it correctly uses the Body for Request but for Response it has every string parameter as "Hello, world!"
, every number as 1
, etc.
I know this is an old thread, but just came across this issue and wanted to elaborate on the above answer. In order to get this working, I had to set
DRAFTER_EXAMPLES
in the environment, and then execute the aglio command; for example: