aglio
aglio copied to clipboard
MSON Data structures are not working on v2.2.1
When I write mson data structures in my api.md like this:
## Data Structures
### serversNum (object)
- `ip`: `string` (string)
- `num`: `0` (number)
### onlineNum (object)
- `totalNum`: `0` (number)
- `serversNum` (array[serversNum])
the json scheam it parsed is
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"totalNum": {
"type": "number"
},
"serversNum": {
"type": "array"
}
}
}
the schema of serversNum is missing!
So How can I solve this problem??
Hi @wangyan-dlut I encountered this problem recently. I'm not sure if this is the correct fix, but try using the type attribute fixed-type. This should fill out the schema for serversNum
- `serversNum` (array[serversNum], fixed-type)
Makes sense to mark it with fixed-type, as arrays can contain multiple types. However, since the type is specified directly, it probably should be implied to be fixed-type.
In any case, I think this is an upstream issue with drafter/the spec it's self?