Ensuring optional vs required JSON/XML/Query operators are applied correctly