Describe the bug
The documentation on refined types is not really clear on how bounds in refined types are treated.
https://wirespec.io/docs/language/types#refined
For example, if we have
type IntegerBetweenTwoAndFive = Integer(2,5)
Which integer values are considered to be valid? 2, 3, 4, 5?
The implementation of the emitters seems to be somewhat unclear about it too:
- Kotlin --> 3, 4 .. both bounds are exclusive
- Java --> same
- Typescript --> same
- Python --> ??
- OpenAPIV2 --> 2,3,4,5 .. both bounds are inclusive
- OpenAPIV3 --> same
I believe the Wirespec language should be clear about this, whether or not these bounds are inclusive or not. Conceptually, it makes the most sense to make them inclusive, as that is also the default in most other languages (e.g. OpenAPI).
To Reproduce
Steps to reproduce the behavior:
- Create a wirespec file:
type AnIntegerType = Integer(_,1)
type ANumberType = Number(_,1.0)
- Compile or convert into various languages
- Observe
Expected behavior
Consistent use of lower and upper bounds
Actual behavior
Inconsistent use of lower and upper bounds
Describe the bug
The documentation on refined types is not really clear on how bounds in refined types are treated.
https://wirespec.io/docs/language/types#refined
For example, if we have
Which integer values are considered to be valid? 2, 3, 4, 5?
The implementation of the emitters seems to be somewhat unclear about it too:
I believe the Wirespec language should be clear about this, whether or not these bounds are inclusive or not. Conceptually, it makes the most sense to make them inclusive, as that is also the default in most other languages (e.g. OpenAPI).
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Consistent use of lower and upper bounds
Actual behavior
Inconsistent use of lower and upper bounds