Skip to content
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

Schema validation accepting wrong or random parameter names #17

Open
fg55b opened this issue Oct 3, 2023 · 0 comments
Open

Schema validation accepting wrong or random parameter names #17

fg55b opened this issue Oct 3, 2023 · 0 comments

Comments

@fg55b
Copy link

fg55b commented Oct 3, 2023

Greetings!

When testing and validating an IfcJSON file that had already an expected error inside, the schema_validator.py actually pointed out that it was a valid ifcJSON.

The code with an expected error was the following, since IfcRelAssignsToProduct do not have the "relatingObject" parameter, but "relatingProduct" instead.

{ "type": "IfcRelAssignsToProduct", "globalId": "Rel_Id", "relatedObjects": [ { "type": "IfcBuildingElementProxy", "ref": "Element_Id" } ], "relatingObject": { "type": "IfcTask", "ref": "Task_Id" } }

I tried using random values in the parameters' names and they also worked fine. But, if "relatingObject" is changed by the correct value, "relatingProduct", then an error is raised, since IfcTask is not a Product. According to the schema:

"relatingProduct": { "$ref": "#/definitions/IfcProductSelect"}

I'm not sure if this issue can be addressed since the validation is based on the external jsonschema library, but since the validator can be used as a reference for implementations of the IfcJSON, would be very helpful if it was capable of checking this type of error that can often happen.

Thanks for the attention!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant