Skip to content

Commit f0b0226

Browse files
Invalid string validation (#704)
* Add test case for invalid string type validation * docs: add changelog entry --------- Co-authored-by: Danny van der Sluijs <[email protected]>
1 parent eac0893 commit f0b0226

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## [Unreleased]
99
### Added
1010
- Add return types in the test suite ([#748](https://github.com/jsonrainbow/json-schema/pull/748))
11+
- Add test case for validating array of strings with objects ([#704](https://github.com/jsonrainbow/json-schema/pull/704))
1112

1213
### Fixed
1314
- Correct misconfigured mocks in JsonSchema\Tests\Uri\UriRetrieverTest ([#741](https://github.com/jsonrainbow/json-schema/pull/741))

tests/Constraints/ArraysTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,19 @@ public function getInvalidTests(): array
116116
}
117117
}
118118
}'
119+
],
120+
[
121+
'{"data": [{"not_a_string_but_object":"string_but_in_object"}]}',
122+
'{
123+
"type": "object",
124+
"properties": {
125+
"data": {
126+
"type": "array",
127+
"items": {"type":"string"},
128+
"additionalItems": false
129+
}
130+
}
131+
}'
119132
]
120133
];
121134
}

0 commit comments

Comments
 (0)