Yes.

 

 

 

From: <[email protected]> on behalf of 
"[email protected]" <[email protected]>
Reply-To: "[email protected]" 
<[email protected]>
Date: Tuesday, February 6, 2018 at 05:50
To: Swagger <[email protected]>
Subject: swagger 3: schema for map of maps

 

I want to model a schema where the json is map of maps:

 
{
  'id1': {
    'type': 'type1',
    'active': true,
  }, 
  'id2': {
    'type': 'type2',
    'active': false,
  },
  ... 
  ... 
}
 

 

I have defined:

 
components:
  schemas:
    accountData:
      type: object
      required:
        - type
        - active
      properties:
        type:
          type: string
        active:
          type: boolean
 
    accounts:
      type: object
      additionalProperties:
        $ref: '#/components/schemas/accountData'
 

Is it correct?

-- 
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 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.

Reply via email to