gazebosim / gazebosim/sdformat

Missing required elements not being reported

Open
#1,287 5 comments 0 reactions 1 assignee Claimed by @marcoag View on GitHub
bug
Dominant language
C++
Stars
216
Forks
125
Avg merge
1d 14h
Merged PRs (30d)
14

Description

## Description
It seems that this `if` statement:

https://github.com/gazebosim/sdformat/blob/3fdc0a1fe7026fbc1f004de018daf83839a2914e/src/parser.cc#L1928

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. a `world` without `gravity`) 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 in `main` 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.