Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling inline references in the main schema even when subSchemas are provided #6

Merged
merged 1 commit into from
Mar 18, 2015

Conversation

bardzusny
Copy link
Contributor

Right now, if subSchemas are provided, it prevents inline references in the main schema from being resolved.

javascript
var schema = Enjoi({
'title': 'Example Schema',
'type': 'object',
'properties': {
'firstname': {
'$ref': '#/definitions/firstname'
},
'surname': {
'$ref': 'definitions#/surname'
}
},
'definitions': {
'firstname': {
'type': 'string'
}
}
}, {
'definitions': {
'surname': {
'type': 'string'
}
}
});


Would throw up this error:

AssertionError: Can not find schema reference: #/definitions/firstname.


This PR fixes just that + adds proper test checking this use case.

(related: https://github.com/krakenjs/swaggerize-builder/issues/33 ).

tlivings added a commit that referenced this pull request Mar 18, 2015
Handling inline references in the main schema even when subSchemas are provided
@tlivings tlivings merged commit b5d9a6d into tlivings:master Mar 18, 2015
@bardzusny
Copy link
Contributor Author

I believe this was resolved by 31175d9 (allowing to override source for inline references by providing subSchema with # key). Also: see #7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants