jdiegodcp / ramlfications

Python parser for RAML
https://ramlfications.readthedocs.org
Apache License 2.0
234 stars 50 forks source link

Add support for typed fragments. #133

Open econchick opened 7 years ago

econchick commented 7 years ago

RAML 1.0 introduces fragment identifiers that go in the header/first line of RAML files, e.g. #%RAML 1.0 ResourceType. These are (mostly? entirely?) used for !include files, and are optional.

sichvoge commented 7 years ago

Hi. Fragments are indeed mostly used with !include. The only exceptions (semantically) are:

You can include them via !include, but that would never really have a meaning and is invalid. But nothing should stop you to do it since it's just nature how !include works in general. Append all nodes from a file into this position.

What typed fragments introduce is for the parser to have a way to validate if a fragment, as it is, is valid or not.

econchick commented 7 years ago

@sichvoge that makes total sense, thank you!