File tree Expand file tree Collapse file tree 4 files changed +24
-18
lines changed
main/java/io/openapiparser/model/v31
test/kotlin/io/openapiparser/model Expand file tree Collapse file tree 4 files changed +24
-18
lines changed Original file line number Diff line number Diff line change @@ -234,10 +234,10 @@ public Collection<String> getType () {
234
234
/**
235
235
* JSON Schema Validation: validation Keywords for numeric instances (number and integer)
236
236
*
237
- * @return exclusive maximum or false if missing
237
+ * @return exclusive maximum or null if missing
238
238
*/
239
- public Boolean getExclusiveMaximum () {
240
- return getBooleanOrDefault (EXCLUSIVE_MAXIMUM , false );
239
+ public @ Nullable Number getExclusiveMaximum () {
240
+ return getNumberOrNull (EXCLUSIVE_MAXIMUM );
241
241
}
242
242
243
243
/**
@@ -252,10 +252,10 @@ public Boolean getExclusiveMaximum () {
252
252
/**
253
253
* JSON Schema Validation: validation Keywords for numeric instances (number and integer)
254
254
*
255
- * @return exclusive minimum or false if missing
255
+ * @return exclusive minimum or null if missing
256
256
*/
257
- public Boolean getExclusiveMinimum () {
258
- return getBooleanOrDefault (EXCLUSIVE_MINIMUM , false );
257
+ public Number getExclusiveMinimum () {
258
+ return getNumberOrNull (EXCLUSIVE_MINIMUM );
259
259
}
260
260
261
261
/**
Original file line number Diff line number Diff line change @@ -37,6 +37,14 @@ class SchemaSpec: StringSpec({
37
37
schema().nullable.shouldBeFalse()
38
38
}
39
39
40
+ " gets schema exclusiveMaximum is false if missing" {
41
+ schema().exclusiveMaximum.shouldBeFalse()
42
+ }
43
+
44
+ " gets schema exclusiveMinimum is false if missing" {
45
+ schema().exclusiveMinimum.shouldBeFalse()
46
+ }
47
+
40
48
" gets schema additionalProperties" {
41
49
schema("additionalProperties: false").additionalProperties.shouldBeInstanceOf<Boolean >()
42
50
schema("additionalProperties: {}").additionalProperties.shouldBeInstanceOf<Schema >()
Original file line number Diff line number Diff line change @@ -70,6 +70,14 @@ class SchemaSpec: StringSpec({
70
70
schema().minContains shouldBe 1
71
71
}
72
72
73
+ " gets schema exclusiveMaximum is null if missing" {
74
+ schema().exclusiveMaximum.shouldBeNull()
75
+ }
76
+
77
+ " gets schema exclusiveMinimum is null if missing" {
78
+ schema().exclusiveMinimum.shouldBeNull()
79
+ }
80
+
73
81
" gets schema dependentRequired" {
74
82
val required = schema("dependentRequired: {bar: [foo]}").dependentRequired
75
83
required shouldContainKey " bar"
Original file line number Diff line number Diff line change @@ -42,12 +42,7 @@ class SchemaSpec: StringSpec({
42
42
43
43
" gets schema exclusiveMaximum" {
44
44
schema30("exclusiveMaximum: true").exclusiveMaximum.shouldBeTrue()
45
- schema31("exclusiveMaximum: true").exclusiveMaximum.shouldBeTrue()
46
- }
47
-
48
- " gets schema exclusiveMaximum is false if missing" {
49
- schema30().exclusiveMaximum.shouldBeFalse()
50
- schema31().exclusiveMaximum.shouldBeFalse()
45
+ schema31("exclusiveMaximum: 9.9").exclusiveMaximum shouldBe 9.9
51
46
}
52
47
53
48
" gets schema minimum" {
@@ -62,12 +57,7 @@ class SchemaSpec: StringSpec({
62
57
63
58
" gets schema exclusiveMinimum" {
64
59
schema30("exclusiveMinimum: true").exclusiveMinimum.shouldBeTrue()
65
- schema31("exclusiveMinimum: true").exclusiveMinimum.shouldBeTrue()
66
- }
67
-
68
- " gets schema exclusiveMinimum is false if missing" {
69
- schema30().exclusiveMinimum.shouldBeFalse()
70
- schema31().exclusiveMinimum.shouldBeFalse()
60
+ schema31("exclusiveMinimum: 9.9").exclusiveMinimum shouldBe 9.9
71
61
}
72
62
73
63
" gets schema maxLength" {
You can’t perform that action at this time.
0 commit comments