{
"order": {
"id": "1234",
"objType": "order",
"priceInfo": {
"currencyFormat": "$0.00",
"currency": "USD",
"amount": "70.91",
"isDiscounted": true
},
"shippingGroups": [
{
"id": "1234",
"objType": "shippingGroup",
"priceInfo": {
"currencyFormat": "$0.00",
"currency": "USD"
}
}
]
}
}
Hi Harish. The way to achieve this is to define priceInfo once in the schema, then use a $ref when you want to refer to priceInfo again.
--
You received this message because you are subscribed to the Google Groups "jsonschema2pojo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jsonschema2pojo-...@googlegroups.com.
Visit this group at http://groups.google.com/group/jsonschema2pojo-users.
For more options, visit https://groups.google.com/d/optout.
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "/",
"type": "object",
"properties": {
"order": {
"id": "order",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "string"
},
"objType": {
"id": "objType",
"type": "string"
},
"priceInfo": {
"$ref": "#/definitions/priceInfo"
},
"additionalProperties": false
},
"shippingGroups": {
"id": "shippingGroups",
"type": "array",
"items": {
"id": "0",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "string"
},
"objType": {
"id": "objType",
"type": "string"
},
"priceInfo": {
"$ref": "#/definitions/priceInfo"
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false
},
"additionalProperties": false,
"definitions": {
"priceInfo": {
"id": "priceInfo",
"type": "object",
"properties": {
"currencyFormat": {
"id": "currencyFormat",
"type": "string"
},
"currency": {
"id": "currency",
"type": "string"
}
},
"additionalProperties": false
}
}
}
To unsubscribe from this group and stop receiving emails from it, send an email to jsonschema2pojo-users+unsub...@googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "jsonschema2pojo-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jsonschema2pojo-users/F4LEdCONdaI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jsonschema2pojo-...@googlegroups.com.
Visit this group at http://groups.google.com/group/jsonschema2pojo-users.
For more options, visit https://groups.google.com/d/optout.