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

An "instance" property proposal #121

Open
awwright opened this issue May 11, 2015 · 3 comments
Open

An "instance" property proposal #121

awwright opened this issue May 11, 2015 · 3 comments
Labels
question Issues awaiting feedback from more users
Milestone

Comments

@awwright
Copy link
Collaborator

Right now we are somewhat overloading the "type" property to allow it to contain things like "date". I overload it myself for a MongoDB "ObjectId".

What if instead we just used {type:"object", instance:"ObjectId"}? This would be a little bit closer to ECMAScript semantics, without overloading JSON Schema semantics.

For cases where you want to say an object can't be an instance of anything, you only want it to be a key-value map, you could use {type:"object", instance:false} maybe.

@awwright awwright added the question Issues awaiting feedback from more users label May 11, 2015
@tdegrunt
Copy link
Owner

Same here, on the overloading part. What you suggest seems fine, we do need to maintain compatibility for a while though.

@awwright
Copy link
Collaborator Author

Right, {type:"date"} could continue to be supported, I don't think we'd even need to deprecate it; but in my usage it would raise as an invalid JSON Schema against the meta-schema.

@tdegrunt
Copy link
Owner

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Issues awaiting feedback from more users
Projects
None yet
Development

No branches or pull requests

2 participants