adewg / ICAR

Standard messages and specifications for animal data exchange in livestock.
https://icar.org/
Apache License 2.0
49 stars 26 forks source link

Consider adding PostalAddress to icarConsignmentType #317

Closed cookeac closed 2 years ago

cookeac commented 2 years ago

Currently icarConsignmentType has string fields for destinationAddress and `originAddress'. Several systems store addresses in structured fields (e.g. Address 1, Address 2, City, Post Code, Country...). There is a standard for this.

It is relatively easy to convert a structured address to a string -- but much more effort to reconstitute a structured address from a string.

In Schema.Org they get around this by having:

address: { "anyOf": [ { "string" }, { "$ref": "../types/PostalAddress.json" } (this is a simplified approximation)

At face value, this would be a non-breaking change (to validation), but I suspect it would break implementations.

An alternative would be to extend icarConsignmentType, adding destinationPostalAddress and originPostalAddress. Not as elegant, but maybe safer.

cookeac commented 2 years ago

Andrew to do a PR with anyOf and we will review.