kaiiam / mifc

A minimum information standard checklist formalizing the description of food composition data and related metadata.
MIT License
2 stars 1 forks source link

Issue with integer constraint for primary_food_type_upc_code #20

Closed GregLyonJIFSAN closed 2 days ago

GregLyonJIFSAN commented 6 days ago

A couple of issues were raised regarding the integer constraint for this slot described in mifc.yaml:

  primary_food_type_upc_code:
    description: An integer denoting a Universal Product Code (UPC) barcode.
    range: integer

Some of the sample data JIFSAN has imported from STACI has letters and other characters in this field. It was also pointed out that there is the danger of dropping leading zeroes when the UPC code is represented as an integer. The consensus seemed to be that it would be better to make this a string field.

kaiiam commented 2 days ago

OK thanks @GregLyonJIFSAN for the issue, it should be an easy fix to change food_upc_code to a string, hopefully that doesn't break any tests which have it as integers, not sure if we'll get a validation error. I'll try to fix it now.

kaiiam commented 2 days ago

Changes pushed and issue closed. If anyone objects we can readdress this later in the future.