Created
July 21, 2020 21:08
-
-
Save dexterlabora/505342359ad62d112b43dd320f5c9eb8 to your computer and use it in GitHub Desktop.
JSONata - Format OpenAPI Spec JSON for Vue V-Swagger component
This file contains hidden or 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