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

Expand references of DocuemntStore schemas #93

Closed

Commits on Jan 30, 2019

  1. Expand references of DocuemntStore schemas

    This is a fix for thoughtbot#92.
    
    Calls `expand_references!` on loaded schemas before adding them to the
    `DocumentStore`.  This is intended to fix a bug where complex schemas
    that include more than one level of cross-file use of `$ref`s are not
    being validated correctly.
    
    This commit includes new test cases that reproduce this issue and show
    the effectiveness of the proposed fix.
    
    The inspiration for this fix comes from a command included in the
    `json_schema` gem.  In that gem, the stand-alone validator command
    expands references within schemas before adding them to the store.
    It seems reasonable to do the same here.
    
    See https://github.com/brandur/json_schema/blob/20ccb82d7e18140d88ded508edd6c003865c98a0/lib/commands/validate_schema.rb#L92.
    richardlarocque committed Jan 30, 2019
    Configuration menu
    Copy the full SHA
    b47d301 View commit details
    Browse the repository at this point in the history