You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes, the data provider/API of third party systems returns a null value for properties. It doesn't seem that Ajv provides for a global configuration of allowing nullable properties, we'd have to make the schemas have nullable on every single property, or at least on those where we want to allow null.
During work on the PagerDuty integration, it seemed that a better course was to change createIntegrationEntity to avoid transferring null values to the target entity. This seemed at the time as essentially the same behavior as not receiving the property at all from the provider.
There's been another run in where the integration was using assign to directly set null and had to work around validation by value ? value : undefined.
The persister uses null values as a mechanism to direct it to remove properties from stored graph objects.
The integration-sdk disables schema validation in production because provider APIs are not always consistent in providing data for every property, all the time. We have no runtime type checking of provider data so that we know when the provider is behaving "inconsistently".
We have a UI driven by the schema. What implications are there by allowing null on every property just to cover for unstable provider data?
Perhaps createIntegrationEntity should always transfer as-is, and we only need an option to have the validateEntityWithSchema remove the null value properties before validation, so that we don't have to muddy the schemas with nullable all over the place.
Sometimes, the data provider/API of third party systems returns a
null
value for properties. It doesn't seem that Ajv provides for a global configuration of allowingnullable
properties, we'd have to make the schemas havenullable
on every single property, or at least on those where we want to allownull
.During work on the PagerDuty integration, it seemed that a better course was to change
createIntegrationEntity
to avoid transferringnull
values to the target entity. This seemed at the time as essentially the same behavior as not receiving the property at all from the provider.There's been another run in where the integration was using
assign
to directly setnull
and had to work around validation byvalue ? value : undefined
.We could consider making https://github.com/JupiterOne/data-model/blob/master/src/validateEntityWithSchema.ts#L7 support an option to remove
null
value properties from the graph object so that they're treated asundefined
.The text was updated successfully, but these errors were encountered: