How to handle a variable object label in OpenAPI 3.0?

26 views
Skip to first unread message

Steven Buehler

unread,
Nov 21, 2018, 9:52:56 PM11/21/18
to Swagger
How would I handle the following in a JSON schema, where the object uses a incrementing element name (1, 2, 3, etc.)? This is from the Twitch Helix API and I'm trying to write an OpenAPI 3.0 spec for it.

{
 
"data": {
   
"panel": {
     
"1": {
       
"active": true,
       
"id": "rh6jq1q334hqc2rr1qlzqbvwlfl3x0",
       
"version": "1.1.0",
       
"name": "TopClip"
     
},
     
"2": {
       
"active": true,
       
"id": "wi08ebtatdc7oj83wtl9uxwz807l8b",
       
"version": "1.1.8",
       
"name": "Streamlabs Leaderboard"
     
},
     
"3": {
       
"active": true,
       
"id": "naty2zwfp7vecaivuve8ef1hohh6bo",
       
"version": "1.0.9",
       
"name": "Streamlabs Stream Schedule & Countdown"
     
}
   
},
   
"overlay": {
     
"1": {
       
"active": true,
       
"id": "zfh2irvx2jb4s60f02jq0ajm8vwgka",
       
"version": "1.0.19",
       
"name": "Streamlabs"
     
}
   
},
   
"component": {
     
"1": {
       
"active": true,
       
"id": "lqnf3zxk0rv0g7gq92mtmnirjz2cjj",
       
"version": "0.0.1",
       
"name": "Dev Experience Test",
       
"x": 0,
       
"y": 0
     
},
     
"2": {
       
"active": false
     
}
   
}
 
}
}

Reply all
Reply to author
Forward
0 new messages