I am using kwalify to validate JSON objects in Java. Unfortunately, empty JSON arrays, validated without problems in Ruby, are not validated in Java.
Example:
example.yaml:
type: map
required: true
mapping:
"entitlement":
type: seq
required: false
sequence:
- type: str
pattern: /([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}/ # this is a UUID
"subscription":
type: seq
required: true
sequence:
- type: str
pattern: /([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}/ # this is a UUID
example.json:
{"entitlement": ["550e8400-e29b-41d4-a716-446655440000", "550e8400-e29b-41d4-a716-446655440001"],
"subscription": []}
The above is valid if I use kwalify for Ruby, it is not valid if I use kwalify for Java.