Skip to content

Schema validation accepting wrong or random parameter names #17

@fg55b

Description

@fg55b

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions