We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 32c8b4c commit bb5028eCopy full SHA for bb5028e
app/src/main/java/hexlet/code/schemas/MapSchema.java
@@ -15,5 +15,17 @@ MapSchema sizeof(int limitSize) {
15
return this;
16
}
17
18
- //public MapSchema shape()
+ MapSchema shape(Map<String, BaseSchema> schemas) {
19
+ addValidation(
20
+ "shape",
21
+ map -> {
22
+ return schemas.entrySet()
23
+ .stream()
24
+ .allMatch(e ->
25
+ e.getValue().isValid((map.get(e.getKey())))
26
+ );
27
+ }
28
29
+ return this;
30
31
0 commit comments