How to define heterogeneous array items type

Skip to first unread message

Simone Tripodi

Oct 12, 2018, 4:17:59 AM10/12/18
to JSON Schema
Hi all,

In Apache Sling we have a Feature model, defined using the JSON format, which mixes usage of "string" and "object" array items type, i.e.








I am now trying to define a JSON schema for modelling the feature model, but got in trouble how to describe such structure in the schema.

Do you have any suggestion, please?
Any hint will be more than appreciated, many thanks in advance!

Felix Meschberger

Oct 12, 2018, 11:41:35 AM10/12/18

Hi Simone


I think you can use the "anyOf" construct for this:


"anyOf": [

  { "type": "string" },

  { "type": "object", "properties": { ... } }






Am 12.10.18, 01:18 schrieb " im Auftrag von Simone Tripodi" < im Auftrag von>:

You received this message because you are subscribed to the Google Groups "JSON Schema" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
For more options, visit

Reply all
Reply to author
0 new messages