-
Notifications
You must be signed in to change notification settings - Fork 53
Feature/expandable schemas #176
Feature/expandable schemas #176
Conversation
return true | ||
|
||
if fileInfo.parentNode | ||
schemasSeqNode = loader.findSchemasSequenceNode(node) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if you have this RAML:
#%RAML 0.8
/foo:
post:
body:
schema: !include someFastFile.json
schemas: !include someSlowFile.yaml
You should defer all schema reading and processing, until all !included files have been loaded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dmartinezg got it. thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is a sample test, with random response times for includes:
https://github.com/raml-org/raml-js-parser/blob/master/test/specs/regressions.js#L960
@dmartinezg I implemented support for all As for inline-specified schemes, that have $refs (see below), I need this issue to be fixed. After i will get some response from maintainers i will add support for such schemas too. ... raml definition ...
responses:
200:
body:
application/json:
schema: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"items": {
"$ref": "./schemas/collections/items.json"
}
}
} |
@dmartinezg please check code & tests, all cases should be covered now. |
@alvassin, apologies for reviewing late, I've had a big mail backlog for the past few days. I think it is ready to merge, have you signed this?: https://api-notebook.anypoint.mulesoft.com/notebooks#bc1cf75a0284268407e4 After you do that, I can merge, tag and deploy to npm |
@dmartinezg you've got nice automation. Signed. |
Oh, please, squash commits |
@dmartinezg done. |
@alvassin, thanks! |
Added flag
dereferenceSchemas
, that allows to preprocess json-schemas and provide resolved $refs. Fixes #140