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

fix(objectschema)!: omit id from schema returned by without + only #195

Merged

Commits on Oct 3, 2022

  1. fix(objectschema)!: omit id from schema returned by without + only

    the methods without and only return new schema objects with the same id
    that was found on the original. In terms of schema reuse, this creates
    two different schemas with the same id which is technically invalid.
    Additionally, it was not possible to set the id property on an object
    schema that had properties defined. This problem originates from the
    setattribute function which will always set the attribute on the
    schema properties if they are defined. In the case of the object schema,
    this is almost always the case. This changes the id function on the
    object schema to always generate a new schema with the id set on the
    object schema rather than its properties
    
    BREAKING CHANGE: ObjectSchema.id() will always set the id on the root object
    BREAKING CHANGE: ObjectSchema.without() will omit id from the return schema
    BREAKING CHANGE: ObjectSchema.only() will omit id from the return schema
    esatterwhite committed Oct 3, 2022
    Configuration menu
    Copy the full SHA
    16a1bd4 View commit details
    Browse the repository at this point in the history