encoding/openapi: simplify based on user-defined format
For instance, don't use minimum and maximum for
int32 boundaries if the user indicated the field is an
int32.
Also move to apd instead of ints.
Issue #56
Change-Id: I472c3c2b1fd8622430595bd062cef3bbd53b62f1
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/2376
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
diff --git a/encoding/openapi/testdata/openapi.json b/encoding/openapi/testdata/openapi.json
index 7409a75..c0ef7db 100644
--- a/encoding/openapi/testdata/openapi.json
+++ b/encoding/openapi/testdata/openapi.json
@@ -15,7 +15,8 @@
"bar": {
"type": "array",
"items": {
- "type": "string"
+ "type": "string",
+ "format": "string"
}
},
"foo": {
@@ -61,7 +62,8 @@
],
"properties": {
"b": {
- "type": "string"
+ "type": "string",
+ "format": "string"
}
}
}
@@ -89,8 +91,7 @@
},
"Int32": {
"type": "integer",
- "minimum": -2147483648,
- "maximum": 2147483647
+ "format": "int32"
},
"YourMessage": {
"oneOf": [
@@ -101,10 +102,12 @@
],
"properties": {
"a": {
- "type": "string"
+ "type": "string",
+ "format": "string"
},
"b": {
- "type": "string"
+ "type": "string",
+ "format": "string"
}
}
},
@@ -115,7 +118,8 @@
],
"properties": {
"a": {
- "type": "string"
+ "type": "string",
+ "format": "string"
},
"b": {
"type": "number"
@@ -226,7 +230,8 @@
],
"properties": {
"a": {
- "type": "string"
+ "type": "string",
+ "format": "string"
}
}
}