Open obihann opened 9 years ago
@obihann is there anything specific you would like to see? I'm planning to show tables/trees of data structures and it would include information like whether a property is required or nullable.
As long as the output follows the specs I think were fine, since they are not yet merged into the official MSON spec, you can find the example here as well as rendering examples here.
The actual change to the spec will be:
3.5.3 Type Attribute
Defines extra attributes associated with the implementation of a type.
required
- instance of this type is requiredoptional
- instance of this type is optional (default)fixed
- instance of this type structure and values are fixednullable
- instance of this type Value MAY be unset (e.g.null
ornil
)sample
- Alternate way to indicate a [Value][] is a sample. See [Sample][].default
- Alternate way to indicate a [Value][] is a default. See [Default][].A
sample
Type Attribute is mutually exclusive withdefault
.
This is going to be merged to MSON master as soon as their is a new release of [drafter][https://github.com/apiaryio/drafter] which has a milestone so we can track when it is ready for release.
Thanks!
This milestone 1.1.0 is now closed.
@obihann @justinabrahms there is now some support of nullable properties in Aglio. The generated JSON schema will show that it allows a null type. For example:
+ field (nullable)
Generates
{
"type": ["string", "null"]
}
The attributes aren't shown in a nice table yet (that is underway at the moment but is quite a large task), so that's coming soon as part of #103.
+1
MSON is being updated to include support for null values using a 'nullable' attribute. Aglio should support this.