-
Notifications
You must be signed in to change notification settings - Fork 23
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
Parsing composite schema object definition #26
Comments
It's hard to say with that snippet; I'd need to know what you think should fail validation that isn't (or vice versa). Could I see the complete schema (paricularly as $ref works differently between different schema versions) and some example data? |
Thanks for responding so promptly. I guess, I did not explain my problem clearly enough. I am not trying to validate an instance JSON document - I am trying to parse a schema to look for certain features. Here is a more complete version of the schema: So, I am loading the sub schemas and trying to iterate through them - Map<URI, Schema> subSchemas = schema.getSubSchemas();
|
Hi sorry I haven't had time to investigate this yet. |
No problem. Appreciate you getting back.
From: Jim Blackler ***@***.***>
Sent: Saturday, April 29, 2023 11:56 AM
To: jimblackler/jsonschemafriend ***@***.***>
Cc: gauamg ***@***.***>; Author ***@***.***>
Subject: Re: [jimblackler/jsonschemafriend] Parsing composite schema object definition (Issue #26)
Hi sorry I haven't had time to investigate this yet.
-
Reply to this email directly, view it on GitHub<#26 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AMR3RIRCGS6VH2HXUORCPV3XDU2YHANCNFSM6AAAAAAXBGZSBY>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
You miss the "type": "object" definition in schema. @jimblackler - issue can be closed |
Thank you very much for making this library available as open source. This is extremely useful and I am glad I chanced upon it before giving up. I am using this library to build a quality check tool that scans JSON schemas for compliance with certain design standards. There is one particular design pattern (composition) that seems to be slipping through the parser. Here is the schema snippet:
"BaseAddress": {
"type": "object",
"properties": {
"addressLineText": {
"$ref": "#/definitions/String50"
},
"addressUnitIdentifier": {
"$ref": "#/definitions/String11"
},
"cityName": {
"$ref": "#/definitions/String35"
},
"postalCode": {
"$ref": "#/definitions/PostalCodeType"
}
}
},
"ResidenceAddress": {
"allOf": [
{
"$ref": "#/definitions/BaseAddress"
},
{
"properties": {
"stateCode": {
"$ref": "#/definitions/ResidenceStateCodeType"
}
}
}
],
"required": [ "addressLineText", "cityName", "postalCode", "stateCode" ]
},
While the BaseAddress object is being correctly read, the ResidenceAddress object is not being recognized. What am I missing?
Regards
The text was updated successfully, but these errors were encountered: