Closed dmartinezg closed 8 years ago
I guess this place suites well for a name of the root node. Which can be api, library, or any other type of a fragment. Overlays and extensions too.
That is actually a good point Denis. @svacas and @dmartinezg please bear in mind that RAML 1.0 defines fragments that could be either an API
, Library
, or others. How would you describe that? Should we have the fragment name as root element or the root element is fragment
and then metadata about the type of this fragment?
We don't have this restriction on 0.8 though. Do we have another root element for 0.8, or do we design it to be similar?
Aggree with @ddenisenko.
document suits well for a DOM, but not for serializers/converters, which may not treat a document at all, only a data structure.
@dmartinezg can you elaborate your last comment a bit more; my guess is that document
was introduced since we always/usually talking about RAML document.
@KonstantinSviridov can you explain what the rationality was to call it document
?
@dmartinezg @blakeembrey what about over fragments? does the root element name mandate what fragment you just parsed? are we only considering Api
fragments?
@sichvoge No rationality. As the TCK JSON has two root nodes: one for errors and one for content, we needed some name for the one with content, and I decided to tace "docoument". I think, Denis is right: it must be api
, extension
, overlay
, library
or fragment
depending on sort of content.
or maybe we stick with one and have additional metadata that identifies the object? i think it will be very hard to not have a consistent root element in terms of navigating through the object, but I can be wrong here. Just want to discuss possible downsides :)
The top level object describing a RAML should not be a
document
, maybe aspecification
orapi
.Reference: https://github.com/mulesoft-labs/raml-tck/blob/master/Examples/RAML10/Annotations%20002/api-tck.json#L2