This repository has been archived by the owner on Mar 5, 2020. It is now read-only.
Add singleton file_path method to contents resolved by include #12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have my RAML splitted into multiple files and my schemas also using the $ref to be able to re-use and share JSON schemas across different endpoints. An example of these would be:
The relative referenced file "model.json" is currently used in other schemas. This is something that I think happens too with the raml-js-parser. The issue comes up when the RAML parser resolves the !include reference to the schema. The "relativeness" of the internal "./model.json" path is lost when this happens, because there is no way to know where the schema was living before it was read.
This topic has a few threads open, but I haven't been able to yet find a clear solution for the implementation.
This is definitely not ideal, but the solution I have found, is to add an instance method to the eigen class of the value that holds the schema. This way the location from where it was included can be recovered.
If you have any other ideas on how to approach this I'm more than happy to give it a shot.