-
Notifications
You must be signed in to change notification settings - Fork 97
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
Missing required elements not being reported #1287
Comments
I don't think it's necessarily wrong to add a default element when required elements aren't present; it's primarily a matter of what is the expected behavior. I think it is a bug that ball joint elements are treated differently. I'm guessing it's because the |
Isn't the expected behavior in SDFormat to complain when a required element is not present? I'm saying this mainly because of consistency across the library: we do for missing required attributes, for top level elements and for certain elements that go through the check in other parts of the code. I have the impression the intention of that code was just to not complain for ball joint axis that don't have an I agree that ball joints shouldn't be a special case. I guess an option could be to keep adding defaults and only add the complain to |
We can add an option to |
I like that idea. Still wanna confirm if changing the default on |
I think adding the strict mode option to |
Description
It seems that this
if
statement:sdformat/src/parser.cc
Line 1928 in 3fdc0a1
Is preventing sdformat from reporting missing elements that are
required
according to the specification.Steps to reproduce
Create and load and sdformat that has a missing
required
element (i.e. aworld
withoutgravity
) and nothing will be reported. Remove the above statement in the library and the missing element errors will arise.Way forward
I opened this issue to start a discussion on the way forward. This seems to be an ancient bug that when fixed will probably prevent many
sdf
files from loading successfully. I guess the safest option would be to fix it inmain
and add a backport fix with a flag to current supported versions of sdformat.As a sneak peek into the impact this fix might have: just removing the
if
yields 202 errors from the tests in the library itself.The text was updated successfully, but these errors were encountered: