Skip to content

Commit

Permalink
feat(additional-properties): adds typed expando object schema (#193)
Browse files Browse the repository at this point in the history
This commit adds a new schema for validating, mapping and un-mapping additional properties in an object. It will also validate and skip the additional properties that do not match the specified type while mapping. While the un-mapping step will fail if the additional properties key matches one of the objects original keys.
  • Loading branch information
asadali214 authored Nov 28, 2024
1 parent 6c382f2 commit b36ed4d
Show file tree
Hide file tree
Showing 3 changed files with 541 additions and 125 deletions.
4 changes: 2 additions & 2 deletions packages/schema/src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ function createSchemaContextCreator(
createSchemaContextCreator({
value,
type: childSchema.type(),
branch: [...currentContext.branch, value],
path: [...currentContext.path, key],
branch: currentContext.branch.concat(value),
path: currentContext.path.concat(key),
strictValidation: currentContext.strictValidation,
});

Expand Down
Loading

0 comments on commit b36ed4d

Please sign in to comment.