Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
JSONata - Format OpenAPI Spec JSON for Vue V-Swagger component
(
/*
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