-
-
Notifications
You must be signed in to change notification settings - Fork 311
about $ref as used in Open Contracting Data Standards #130
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
Comments
Yes, the current correct usage would be something like: {
"definitions": {...},
"properties": {
"value": {
"allOf": [
{"description": "The total upper estimated value of the procurement."},
{"$ref": "#/definitions/Value"}
]
}
}
} Although see also |
Spec only says that other keywords should be ignored. |
Ignored means that when the reference is replaced, those extra fields go away. Otherwise the behavior would be a merge, and we've discussed many times in many issues that $ref does not merge. |
@ruifortes does this answer your question? If so could you please close this issue? If not, what is needed to resolve it? |
Adding a "description" field to a $ref object is as meaningful as making it a comment (if JSON had comments): It's not illegal, but it has no semantic value whatsoever. If you want to make it meaningful, then using "allOf" would be the solution. |
@ruifortes it's been over a month since we asked if this answer satisifed you so I'm assuming it did in fact answer your question. Please re-open if not, or file a new issue with any new questions. See also #197 for more ideas about commenting. |
OCDS uses $ref's in they're schema in an interesting way.
In this excerpt it the $ref object has a "description" property besides "$ref". (see code below)
References to Value type can have different descriptions which is vert useful but isn't this against the json-reference/pointer RFC (and this repo) directives?
The text was updated successfully, but these errors were encountered: