Skip to content

Conversation

Ghesselink
Copy link
Contributor

Header entity can only be FILE_DESCRIPTION, FILE_NAME or FILE_SCHEMA. Encountered a file with FILE_INFO, which doesn't give a fail somewhere else.
e.g. ifcopenshell.validate

 python3 -m ifcopenshell.validate fail_invalid_header_entity.ifc
Validating /home/geert/Documents/gherkin/packages/simple_spf/fork/step-file-parser/fixtures/fail_invalid_header_entity.ifc
No validation issues found.

After these changes

python3 -m ifcopenshell.simple_spf /home/geert/Documents/gherkin/packages/simple_spf/fork/step-file-parser/fixtures/fail_invalid_header_entity.ifc
On line 6 column 1:
Unexpected __anon_3 ('FILE_INFO')
Expecting ENDSEC
00006 | FILE_INFO(
        ^

For the validation service, this will cause the file to fail before reaching the header validation.

@aothms
Copy link
Member

aothms commented May 5, 2025

We do have something in ifcopenshell, but indeed if there is a header entity following the three specified ones it doesn't raise an error. Also, this is probably a better place to do that check. https://github.com/IfcOpenShell/IfcOpenShell/blob/d401e4c948482c02d789a890f897b6929928f504/src/ifcparse/IfcSpfHeader.cpp#L94-L110

@aothms aothms merged commit 63a2b91 into IfcOpenShell:master May 5, 2025
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants