-
-
Notifications
You must be signed in to change notification settings - Fork 307
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
Can a schema document just be a "$ref"? #174
Comments
@handrews Would you be able to elaborate how you see this might happen? (In as tarse means as possible). It doesn't sound unreasonable, but I'm not clear on the use case. |
@Relequestual Let's say you have a schema documents A and B that declare complex data types, where B is something like As time goes on, the limitation for B that it could only support 10 items is removed. So its schema is now just So that's how you might have a schema that starts separate, degenerates to a plain ref, and then becomes separate again. |
This issue is addressed by PR #194. |
In #194 I stated my opinion it probably makes sense if $ref is allowed anywhere a schema is. A use case would be that a third party is asked to provide a schema to validate instances against. For instance, filtering a list of JSON documents. In this case, they will frequently want to use the |
OK so everyone agrees that as of right now without throwing in new proposals and alternatives this should be true ( Numerous further changes, such as changing how we treat other fields in an object with Can we PLEASE just merge in #194 and open new issues for all the other mutually incompatible ideas floating around for |
@handrews @awwright @Relequestual I completely agree with this issue, $ref should be a valid schema on its own. But I don't think #194 should be merged - see my comment there: #194 (comment). |
@awwright @Relequestual after much discussion, I've closed #194 and endorsed @epoberezkin's #211 in its place. |
Resolved by #211. |
In IRC with @awwright (and related to #167) the question came up as to whether a single JSON reference is a valid schema document. Currently, it is allowed for any subschema but not mentioned for the root schema.
I am in favor of allowing it as a root schema as it doesn't increase the chances of circular references all that much and I can see a situation where an ecosystem of schemas may end up with a schema that degenerates into a reference to a larger packaged schema definition.
The text was updated successfully, but these errors were encountered: