mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-09 20:47:44 +00:00
Added contains, minContains and maxContains to schema #28
Added support for missing 3.1 schema properties, however it does not cover the `boolean` case
This commit is contained in:
@@ -191,7 +191,11 @@ minProperties: 1
|
||||
nullable: true
|
||||
readOnly: true
|
||||
writeOnly: false
|
||||
deprecated: true`
|
||||
deprecated: true
|
||||
contains:
|
||||
type: int
|
||||
minContains: 1
|
||||
maxContains: 10`
|
||||
|
||||
var compNode yaml.Node
|
||||
_ = yaml.Unmarshal([]byte(testSpec), &compNode)
|
||||
@@ -213,6 +217,11 @@ deprecated: true`
|
||||
assert.NotNil(t, compiled)
|
||||
assert.Nil(t, schemaProxy.GetBuildError())
|
||||
|
||||
// check contains
|
||||
assert.Equal(t, "int", compiled.Contains.Schema().Type[0])
|
||||
assert.Equal(t, int64(10), *compiled.MaxContains)
|
||||
assert.Equal(t, int64(1), *compiled.MinContains)
|
||||
|
||||
wentLow := compiled.GoLow()
|
||||
assert.Equal(t, 114, wentLow.AdditionalProperties.ValueNode.Line)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user