The current IDFromString converter doesn't reject invalid IDs. Ideally, as the ways in which an ID can be invalid are growing, it should be replaced with two converters:
a validating converter that basically just behaves as NewID(strings.Split(..., ".")) and returns an error, for use when unmarshalling and otherwise accepting IDs from the outside world;
a 'trusting' converter that just returns the empty ID (or suchlike) on error, to be used in tests and places where we 'know' the ID is safe.
The current
IDFromString
converter doesn't reject invalid IDs. Ideally, as the ways in which an ID can be invalid are growing, it should be replaced with two converters:NewID(strings.Split(..., "."))
and returns anerror
, for use when unmarshalling and otherwise accepting IDs from the outside world;