Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion datamodel/high/base/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ func NewSchema(schema *base.Schema) *Schema {
// if we're dealing with a 3.1 spec using an int
if !schema.ExclusiveMaximum.IsEmpty() && schema.ExclusiveMaximum.Value.IsB() {
s.ExclusiveMaximum = &DynamicValue[bool, int64]{
N: 1,
B: schema.ExclusiveMaximum.Value.B,
}
}
Expand All @@ -161,6 +162,7 @@ func NewSchema(schema *base.Schema) *Schema {
// if we're dealing with a 3.1 spec, using an int
if !schema.ExclusiveMinimum.IsEmpty() && schema.ExclusiveMinimum.Value.IsB() {
s.ExclusiveMinimum = &DynamicValue[bool, int64]{
N: 1,
B: schema.ExclusiveMinimum.Value.B,
}
}
Expand Down Expand Up @@ -418,7 +420,7 @@ func NewSchema(schema *base.Schema) *Schema {
KeyNode: schema.Items.KeyNode,
}}}
} else {
items = &DynamicValue[*SchemaProxy, bool]{B: schema.Items.Value.B}
items = &DynamicValue[*SchemaProxy, bool]{N: 1, B: schema.Items.Value.B}
}
}
if !schema.PrefixItems.IsEmpty() {
Expand Down
2 changes: 2 additions & 0 deletions datamodel/high/base/schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ exclusiveMinimum: 5

value := int64(5)
assert.EqualValues(t, value, highSchema.ExclusiveMinimum.B)
assert.True(t, highSchema.ExclusiveMinimum.IsB())
}

func TestSchemaNumberMaximum(t *testing.T) {
Expand Down Expand Up @@ -594,6 +595,7 @@ exclusiveMaximum: 5

value := int64(5)
assert.EqualValues(t, value, highSchema.ExclusiveMaximum.B)
assert.True(t, highSchema.ExclusiveMaximum.IsB())
}

func TestSchema_Items_Boolean(t *testing.T) {
Expand Down