Thanks for your detailed Answer. In my previous example it's just a List of properties and the allOf is not needed - I get this. I'm still not 100% sure when to use allOf though. I tried studying the Json Schema but I'm still kinda unsure.
In the following example I add together multiple schemas which are not just parameters, but objects. Would that be a usecase for the keyword?
{
"schemas": {
"BulkLimit": {
"type": "object",
"allOf": [
{
"$ref": "#/components/schemas/Limit"
},
{
"type": "object",
"properties": {
"account": {
"$ref": "#/components/schemas/AccountReference"
}
}
}
],
"required": [
"account"
]
},
"Limit": {
"type": "object",
"properties": {
"region": {
"$ref": "#/components/schemas/Region"
},
"paymentProduct": {
"$ref": "#/components/schemas/PaymentProduct"
},
"type": {
"$ref": "#/components/schemas/Type"
},
"value": {
"$ref": "#/components/schemas/Amount"
}
},
"required": [
"region",
"paymentProduct",
"type",
"value"
]
},
"AccountReference": {
"type": "object",
"properties": {
"iban": {
"$ref": "#/components/schemas/Iban"
},
"currency": {
"$ref": "#/components/schemas/CurrencyCode"
}
},
"required": [
"iban",
"currency"
]
}
}
}
Thanks for your help