Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrant0607 committed Nov 18, 2015
1 parent 0141c53 commit d625217
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/devel/api-conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ This rule maintains the invariant that all JSON/YAML keys are fields in API obje
#### Primitive types
* Avoid floating-point values as much as possible, and never use them in spec. Floating-point values cannot be reliably round-tripped (encoded and re-decoded) without changing, and have varying precision and representations across languages and architectures.
* Do not use unsigned integers. Similarly, not all languages (e.g., Javascript) support unsigned integers.
* int64 is converted to float by Javascript and some other languages, so they also need to be accepted as strings.
* All numbers (e.g., uint32, int64) are converted to float64 by Javascript and some other languages, so any field which is expected to exceed that either in magnitude or in precision (specifically integer values > 53 bits) should be serialized and accepted as strings.
* Do not use unsigned integers, due to inconsistent support across languages and libraries. Just validate that the integer is non-negative if that's the case.
* Do not use enums. Use aliases for string instead (e.g., `NodeConditionType`).
* Look at similar fields in the API (e.g., ports, durations) and follow the conventions of existing fields.

Expand Down

0 comments on commit d625217

Please sign in to comment.