cnabio / cnab-go

A Go implementation of CNAB Core 1.0
MIT License
69 stars 37 forks source link

Swap integer for float on the Schema struct #116

Closed carolynvs closed 5 years ago

carolynvs commented 5 years ago

All bundles are ultimately represented in canonical json format, which does not allow for decimal numbers, only integers. We are updating the specification to remove numbers from the schema and only allow for integers (see https://github.com/deislabs/cnab-spec/issues/256).

This updates our Schema struct to only use integers as well so that we can only represent valid bundles which can be written with the canonical json library that we use.

Closes #115

carolynvs commented 5 years ago

In golangTypeToJSONType, I didn't modify it because it is inspecting a given golang value and reporting back what json type could contain it. If it ends up not being something compatible with the schema that's another problem entirely, that validation or something else should catch, but I don't want to change the type reported back by this function.