forked from fastify/fluent-json-schema
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
1 parent
f62a218
commit 16a1bd4
Showing
4 changed files
with
64 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v12.14.0 | ||
v14.19.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters