I'm on the swaggerhub website and i need to do an API documentation. I'm trying to define an object with multiple elements, most of which are basic, but one of the properties is another object, NOT ARRAY, but that child object can contain one or more properties (ALL OF SAME TYPE).
I need to make an object that looks like an array.
Lets say my big object is 'User', and the object that gives me problems is 'addresses':
User:
properties:
name:
type: string
adresses:
type: object
Example:
User:
name: Alex
addresses: {
address: {...}
address2: {....}
address3: {....}
}
I have the Address type defined, but 'addresses' must be an object (meaning that it should look like a json, and not with []). How do i make 'addresses' have variable length?? Maybe with 4 addresses, or only 2.
I want to write examples for this in the API documentation, and i want it to be of variable length, because that's how the API actually works, with a JSON, not an array.