The following part of my text file:
Chromista
(string) - The scientific nameKingdom
(string) - The taxonomic rank of the scientific namenoworms, 1603
(string) - Authorship information about the scientific name```
{
"nodes": [
{
"id": "1",
"sname": "Animalia",
"rank": "Kingdom",
"authorship": "noworms, 1603"
},
{
"id": "2",
"sname": "Archaea",
"rank": "Kingdom",
"authorship": "noworms, 1603"
},
{
"id": "3",
"sname": "Bacteria",
"rank": "Kingdom",
"authorship": "noworms, 1603"
},
{
"id": "4",
"sname": "Chromista",
"rank": "Kingdom",
"authorship": "noworms, 1603"
},
{
"id": "5",
"sname": "Fungi",
"rank": "Kingdom",
"authorship": "noworms, 1603"
}
],
"hasMore": 1
}
```
Produces this HTML:
The part of schema inside the ""nodes" is missing! Why?
I have also tried to use data structures but the schema remains incomplete.
@agougousis Can you try the following?
nodes (array[object], fixed)
Ok! Though I haven't found yet where this "fixed" world came from, now the schema is complete.
However, it seems that the produced schema is not right.
The schema produced is:
and the correct schema should be:
Am I wrong?
Can you try this?
+ nodes (array, fixed)
+ (object)
+ id: 4 (number)
Yeap! A lot better! I didn't think that "anonymous" objects can be defined!
I am not sure, but I think that the brackets marked in the following screenshot should not be there. What do you think?
@agougousis The brackets are correct as items is an array of possible types
I don't remember very well the rules, but in http://jsonschema.net/ (a quick and dirty solution that I use from time to time) when i give the json data as input it gives me the schema without these brackets.
@agougousis use a fixed-type
for this:
+ nodes (array, fixed-type)
+ (object)
+ id: 4 (number)
+1 for the fixed-type
fixed - instance of this type structure and values are fixed. This attribute propagates to Nested Member Types.
fixed-type - instance of this type structure is fixed, value is not. This attribute does not propagate to Nested Member Types.
https://apiblueprint.org/documentation/mson/specification.html#353-type-attribute
Most helpful comment
Can you try this?