Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@dexterlabora
Created July 21, 2020 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dexterlabora/505342359ad62d112b43dd320f5c9eb8 to your computer and use it in GitHub Desktop.
Save dexterlabora/505342359ad62d112b43dd320f5c9eb8 to your computer and use it in GitHub Desktop.
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