Use of "number" type in Schemas

Hello,

When looking at recipe.schema, I noticed that for the included ingredients the amount is set to have type “number”. Looking this up, this can apparently be either an integer or a floating point number.

Now the specification however (p.19), states that the amounts will be given as integers.

Why not just specify this in the schema as type “integer” then? It just seems like we’re allowing unnecessary values here.

And also how should we read out those values from the configuration files now? Should we just read them out as integers? And what should we do if e.g. an amount of 200.5 is given? Does this count as a parsing error or is it just ignored and rounded (either up or down)?

Because of this, I also noticed that I don’t think it is specified anywhere whether the packaging volume of an ingredient should be an integer or a floating point number. The schema again just uses “number”, but in case you only intend to use integers anyway it would be nice to know this, to avoid any potential unnecessary floating point imprecisions.

Thank you in advance.

1 Like

Also in the packaging change incident , the packagingVolume is double or Int , the jsonSchema says its number , so it can be int or float . would it be int or float ? Thanks in Advance