RideNoCo / drt-tds

0 stars 1 forks source link

Nullable fields needs to be marked #5

Closed asiridissa closed 10 months ago

asiridissa commented 12 months ago

'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 both string and null.

Need to mark all the nullable properties in schema

keviniano commented 11 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?

asiridissa commented 11 months ago

Yes. I believe that is exactly what we need to do. Unfortunately we need to do this everywhere.

keviniano commented 11 months ago

Thanks, Asiri, for the clarification. OK, I'll take this task on.

asiridissa commented 11 months ago

@keviniano Please check https://github.com/RideNoCo/drt-tds/issues/6#issuecomment-1786472416

keviniano commented 11 months ago

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.

asiridissa commented 11 months ago

Thanks for updating @keviniano. Should we go with the stringNullable type here as well?