drafter
drafter copied to clipboard
MSON: Complex samples are parsed as distinct values
@honzajavorek opened apiaryio/snowcrash#286
Protagonist version
"protagonist-experimental": "0.18.2"
MSON Specs
https://github.com/apiaryio/mson/blob/master/MSON%20Specification.md#44-sample
Example MSON (copy pasted from specs)
- list: *3, 4* (enum)
Result of parsing
{
"name": {
"literal": "...",
"variable": false
},
"sections": [
{
"class": "memberType",
"content": [
{
"class": "property",
"content": {
"name": {
"literal": "list"
},
"valueDefinition": {
"values": [
{
"literal": "*3",
"variable": false
},
{
"literal": "4*",
"variable": false
}
],
"typeDefinition": {
"typeSpecification": {
"name": "enum"
}
}
}
}
}
]
}
]
}
Expected
Probably sth like
{
"literal": "3",
"variable": true
},
{
"literal": "4",
"variable": true
}
Other possible option: the spec is wrong.
@pksunkara commented
@honzajavorek But the expected output should be the following:
{
"literal": "3, 4",
"variable": true
}
@honzajavorek commented
@pksunkara That would be imho very difficult to process by subsequent tooling (aka boutique).