aspen icon indicating copy to clipboard operation
aspen copied to clipboard

Support strong typing of default attributes

Open beechnut opened this issue 5 years ago • 0 comments
trafficstars

From the README:

One known issue is that default and default_attribute auto-type the attributes they're given, and try to make them either a string or number. So, if you pass a Massachusetts zip code like 02111 into a node in either short form or default attribute form, it will become integer 2111.

As a Massachusetts resident, I vowed never to let this happen in my software, so I intend to address this soon.

The default and default_attribute lines should support (or perhaps require!) types.

default:
  label: PostOffice
  attribute: zipcode (string)
  attributes:
    Shipment: tracking_number (string)

beechnut avatar Mar 21 '20 19:03 beechnut