Created
July 21, 2020 21:08
JSONata - Format OpenAPI Spec JSON for Vue V-Swagger component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( | |
/* | |
JSONata expression to: | |
Format OpenAPI Spec JSON for Vue V-Swagger component | |
https://www.npmjs.com/package/v-swagger | |
*/ | |
$requestArray := $.paths.*#$pi.*#$i.{ | |
"id": $i, | |
"url": $keys(%.%)[$pi], | |
"method": $keys(%)[$i], | |
"description": description, | |
"operationId": operationId, | |
"tags": tags | |
}; | |
{ | |
"host": "${this.apiUrl}", | |
"title": "Meraki Dashboard API", | |
"description": "Cisco Meraki API", | |
"opened": true, | |
"request":$requestArray | |
}; | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment