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

Enhancement: We should be able to split JSON Schema Validation input into templates residing in separate files- #7

Open
SameerSiddiqui opened this issue Oct 17, 2016 · 0 comments

Comments

@SameerSiddiqui
Copy link

So i use file system to maintain json templates.

I notice that we can introduce a feature where can split the JSON Schema into small reusable chunks and then create a final JSON Schema Validation object... using lodash _.assign

we can introduce assign key

So let's say we have firstName and lastName section common between lots of different Schemes. I should be able to write this template outside and using nodeJS require i should be able to assign this template to my final JSON Schema validation.

var nameTemplate = {
        FirstName: {
            type: "string",
            title: "First name",
            required: "true",
            maxLength: 15
        },
        LastName: {
            type: "string",
            "title": "Last name",
            required: true,
            maxLength: 15
        }
}

so final JSON Schema will become somthing like this-

assign:[{
nameTemplate,
Contacts: {
            type: "array",
            maxItems: 4,......
}]

This will make the JSON Schema's to share the templates and we don't have to redefine the templates again and again.

Let me know if it makes sense and i can create a PR.

Thanks,
Sameer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant