Closed asiridissa closed 10 months ago
This needs to be done for all fields marked as optional
in the XSD, regardless of type?
So for example, <xsd:attribute name="fareAmount" type="xsd:float" use="optional"/>
would need to also have null added? As in: "fareAmount": { "type": ["number", "null"] }
And does this need to be done everywhere use="optional"
and minOccurs="0"
occur in the XSD?
Yes. I believe that is exactly what we need to do. Unfortunately we need to do this everywhere.
Thanks, Asiri, for the clarification. OK, I'll take this task on.
@keviniano Please check https://github.com/RideNoCo/drt-tds/issues/6#issuecomment-1786472416
I have added a possible fix for this issue in commit 85cc492, which I put in a temporary branch. I will also comment in #6.
Thanks for updating @keviniano.
Should we go with the stringNullable
type here as well?
'null' is a different type in JSON Schema https://json-schema.org/understanding-json-schema/reference/null. it needs to explicitly define nullable fields ex: Schema rule
"street2": { "type": "string" }
does not allow"street2": null
It needs to be"street2": { "type": ["string", "null"] }
to accept bothstring
andnull
.Need to mark all the nullable properties in schema