Okay, I have the following swagger contents now:
metas:
type: object
description: List of key-value pairs where keys are customizable
Strings. The value can be anything (String, Array, Object, and so on).
additionalProperties: true
What will be the effect of adding this "additionalProperties: true"? I do
not see any change in the processed page.
Also, how can I define that the key is a string and the value is anything
(String, Array, Object, and so on)?
2016-10-06 17:23 GMT+02:00 tony tam <[email protected]>:
> In the metas object, you would say “additionalProperties: true”
>
> On Oct 6, 2016, at 6:06 AM, Rene Ummels <[email protected]> wrote:
>
> Hi,
>
> I would like to convert the following JSON body into swagger.
> The metas keys are unknown at the time of creating the swagger file,
> key-value pairs can be added without updating the spec.
> Note we want the metas structure as flat as possible, therefore it
> contains simple key-value pairs .. we want to keep it that way on purpose.
>
> * {*
> * "deviceId" : "device-0000345",*
> * "deviceStatus" : "on",*
> * "metas" : {*
> * "manufacturerId" : "mf1",*
> * "serialNumberId" : "4CE0460D0G"*
> * }*
> * }*
>
>
> At the moment I have the swagger file contents as follows.
> But this seems incomplete for the metas part. How to do it properly?
>
>
>
>
> * 200: description: Successful response. The device
> details for the specified deviceId. schema: $ref:
> '#/definitions/DeviceDetails'*
>
> *definitions:*
>
>
>
>
>
>
>
>
>
>
>
> * DeviceDetails: type: object required: - deviceId
> properties: deviceId: $ref: '#/definitions/DeviceId'
> deviceStatus: $ref: '#/definitions/DeviceStatus' metas:
> type: object description: List of key-value pairs where keys are
> customizable Strings. The value can be anything (String, Array, Object, and
> so on).*
>
>
> thanks,
> Rene Ummels
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Swagger" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Swagger" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/swagger-swaggersocket/vO1oTntcZt4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.