Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support submitting array of empty values as GeoPoint attribute value #11

Open
Pictor13 opened this issue Jun 23, 2016 · 1 comment
Open

Comments

@Pictor13
Copy link
Member

AggregateRootTypeCommandValidator could be improved in its default behaviour when dealing with a GeoPoint attribute.

At the moment we need to explicitly specify, in the entity schema:

<attribute name="coords" type="geo-point">
    <option name="null_island_as_null">false</option>
    <option name="default_value">
        <option name="lon">0.0</option>
        <option name="lat">0.0</option>
    </option>
</attribute>

Otherwise when submitting empty strings for lon and lat values the validation will always fail (because an array of empty values is submitted as value for the attribute, while Trellis just checks for NULL, empty-string, or null-island, as accepted NULL values).

The AggregateRootTypeCommandValidator should consider this case and set then a proper value, taking in account the option null_island_as_null.
I am not sure though how to deal with that in the case where just one of the two coordinates is specified.

@MrHash
Copy link
Contributor

MrHash commented Jun 23, 2016

This should be handled by modifying the Trellis GeopointAttributeRule to cast empty string coordinate arrays to the null value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants