{"id":19985893,"url":"https://github.com/aeberdinelli/schemy-child-settings","last_synced_at":"2026-04-09T08:54:30.249Z","repository":{"id":144044988,"uuid":"397615005","full_name":"aeberdinelli/schemy-child-settings","owner":"aeberdinelli","description":"Allow using settings in child schemas without creating a Schemy instance separately.","archived":false,"fork":false,"pushed_at":"2021-08-19T05:35:16.000Z","size":3,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-12T11:30:54.040Z","etag":null,"topics":["json","library","nodejs","schemy","validation"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/schemy-child-settings","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aeberdinelli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-18T13:42:26.000Z","updated_at":"2021-08-19T12:29:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"87cfc06a-c1d8-44de-a9c3-9a61d1e655e6","html_url":"https://github.com/aeberdinelli/schemy-child-settings","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aeberdinelli%2Fschemy-child-settings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aeberdinelli%2Fschemy-child-settings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aeberdinelli%2Fschemy-child-settings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aeberdinelli%2Fschemy-child-settings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aeberdinelli","download_url":"https://codeload.github.com/aeberdinelli/schemy-child-settings/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241419702,"owners_count":19959963,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["json","library","nodejs","schemy","validation"],"created_at":"2024-11-13T04:26:44.133Z","updated_at":"2026-04-09T08:54:25.216Z","avatar_url":"https://github.com/aeberdinelli.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## About\nThis plugin for Schemy will allow you to add settings to child schemas. Currently, the only way to do that is creating a Schemy instance separately before using it as a property type in the parent schema. \u003cbr /\u003e\n\n## Install\n`npm install --save schemy-child-settings`\n\n## Usage\nLet's go directly into an example:\n\n```javascript\nconst Schemy = require('schemy');\nconst ChildSettingsPlugin = require('schemy-child-settings');\n\n// Load the plugin into Schemy\nSchemy.extend(ChildSettingsPlugin);\n\n// Now you can do something like this\nconst schema = new Schemy({\n    name: {\n        schema: {\n            firstname: String,\n            lastname: String\n        },\n        settings: {\n            strict: true\n        }\n    }\n}, { strict: false });\n\nschema.validate({\n\tname: {\n\t\tfirstname: 'Firstname',\n\t\tlastname: 'Lastname',\n\t\tmiddlename: 'Middlename'\n\t},\n\tage: 21\n}); // =\u003e false\n\nschema.getValidationErrors(); // =\u003e [ 'Property name.middlename not valid in schema' ]\n```\n\nWhat happens in the example above, is that we define the parent schema as not strict. That way we can add the `age` property even if is not defined. However, we set the `name` schema as `{ strict: true }` so when we try to add the `middlename` property we get the error that is not valid.\n\n## Compatibility\nRequires Schemy version `\u003e= 3.1.0`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faeberdinelli%2Fschemy-child-settings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faeberdinelli%2Fschemy-child-settings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faeberdinelli%2Fschemy-child-settings/lists"}