0

If I have an array of objects which are various applications that look for example like this

Application Name 1
    _Id: 1
    category: design
    version: xx.xy
Application Name 2
    _Id: 2
    category: spreadsheet
    version: xx.xx

etc

How do I describe the first field?

so

I will have an array of $ref: "#/definitions/Application" and the other fields are easy

Application:
    type: object
    properties:
        _Id:
            type: integer
        category: 
            type: string

etc

But how do I handle the names? ie Application name 1, 2 etc?

user4447899
  • 320
  • 7
  • 21
  • Possible duplicate of [Swagger: map of ](https://stackoverflow.com/questions/36136885/swagger-map-of-string-object) and [Swagger HashMap property type](https://stackoverflow.com/questions/16042885/swagger-hashmap-property-type) – Helen Jan 10 '18 at 13:18

1 Answers1

0

Try like this:-

    "items":{
        type: array
        items:{
          properties:{
              "Name":{
                  type:object,
                  properties:{
                    _Id:{
                        type: integer
                    },
                    category: {
                        type: string
                    },
                    version:{
                      type: string  
                    }
                  }

              }
        }
    }
}
yogesh agrawal
  • 706
  • 7
  • 15