-
Notifications
You must be signed in to change notification settings - Fork 649
Using Json Schema $ref #118
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
It's not supperted right now, but it's on the TODO list. See #69 The plan is to start off by pre processesing the schema, essentially putting a real reference to the subschema instead of the $ref where its needed building a new schema without $refs that schema form and tv4 can happily use.. Non-local $refs would need to be fetched or supplied with the the main schema, not sure how to solve them. |
Resolving |
FYI, following workaround did the job. Thanks for the hint! JsonRefs.resolveRefs($scope.schema, function(err, resolvedSchema) {
if(err) throw err;
$scope.schema = resolvedSchema;
}); |
Nice! I feel like resolving the refs outside of schema form is more flexible than within. Closing this issue. Complain and I will reopen it. :-) |
P.S. thanks ippeiukai for showing your workaround... which helped me upgrade it to this one :) |
@davidlgj any chance we can have this added to the documentation, prominently? $refs are a fairly integral part of json schema definitions, and the only mention of the currently-supported-status is buried deep in github issues like this one. |
@marcelchastain it will be a part of the 1.0.0 release and is already in the current alpha. I've just added it to the alpha docs and will push them in the next update. |
@Anthropic Can we see the the alpha docs for ref now? |
@legend80s it's in the docs for the dev branch. Not much to say though, it just parses using fairly default options. More advanced options may come in future but not for a while. |
@Anthropic Can I see a demo of how to use $ref. The docs is too brief for a newbie |
JSON Schema website has examples of how to use $ref. $ref is only for the schema and not the UI schema, at least at this stage. |
How can I use schema definition and
$ref
within the form?I have this definition:
"definitions": { "CAN_postalCode": { "type":"string", "title": "Postal Code", "pattern":"^[A-Z][0-9][A-Z]( )?[0-9][A-Z][0-9]$" } }
In schema properties: Referring to the definition about
"province":{"$ref":"#/definitions/CAN_province"}
Demo link: http://igtestvm1.cloudapp.net:8989/offline/angularschemaform/views/refTest.html
The text was updated successfully, but these errors were encountered: