Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Allow parsing RAML files with model extensions #88

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

oberlies
Copy link

The RAML parser project actually also includes a pretty cool model-based YAML parser. With that parser, it is pretty easy to create own models and call the YamlDocumentBuilder to parse them.

Now I don't want to use arbitrary models, but I want to parse a RAML model with a few extensions. So it would be nice if I could call the RamlDocumentBuilder and have it parse a model class which is a sub-class of Raml.

This is actually pretty easy to implement - it only requires changes in a few lines of code.

This pull request extends pull request #87

The validator already detects invalid keys, so the parser doesn't need
to report them by throwing an exception. This allows to read the valid
parts from an invalid RAML file.
Add constructor so that the RamlDocumentBuilder can also parse custom
sub-classes of Raml. In this way, the RAML model can be extended.
Use a LinkedHashMap to ensure that fields from model sub-classes are
preferred over fields from base classes.
@machaval machaval added the v1 label Jul 14, 2016
@svacas svacas closed this Aug 17, 2016
@oberlies
Copy link
Author

@svacas What does this mean that this pull request is "closed"? My changes haven't been merged yet.

@svacas
Copy link
Contributor

svacas commented Aug 17, 2016

it was a mistake when switching the master branch

@svacas svacas reopened this Aug 17, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants