-
Notifications
You must be signed in to change notification settings - Fork 53
Error in parsing nested json schemas #115
Comments
I'm seeing this problem as well. https://github.com/mulesoft/api-console/blob/master/app/examples/github.raml Most of the embedded post body schemas are being evaluated as text. |
Hi, yes this is an open req for the parser: validation of JSON schemas. If you guys are aware of a good js library that does JSON schema validation (not only validations of JS objects against a JSON schema) and handles these, we could include it in an updated version of the parser. |
@dmartinezg this looks to be relatively clean, and active. https://github.com/geraintluff/tv4 |
@naterkane correct that is a good library to validate JS objects against a schema, that parser however does not really validate JSON schemas against the JSON schema spec, I just tried this:
and it outputs: |
@dmartinezg Okay a few things. First when you say that tv4 lets you validate objects against a schema but not schemas against the spec; that is wrong. In fact there is no difference between the 2 operations because a schema is a json object and the spec is a json schema. So tv4 can accomplish this. It's just not easy 😦 . The biggest problem I've found with tv4 is that any references to other schemas (via the Here is an example repo to demonstrate my point: https://github.com/thebinarypenguin/tv4-sandbox So while I don't have a ready solution tv4 can probably be used to create one. |
Maybe this project might be worth looking into for dereferencing |
Raml parser doesn't attempt to parse or validate the nested schema.
{
"required": true,
"description": "Bulk buy limit attributes",
"type": [
"object",
"null"
],
"$ref": "bulkbuy-schema.json"
}
In the following example it would just treat this as a text. The fact that $ref is there wouldn't mean anything to RAML parser.
The text was updated successfully, but these errors were encountered: