Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #1004: Support Swagger tags #1211

Merged
merged 2 commits into from Oct 17, 2018

Conversation

Projects
None yet
2 participants
@thewheat
Copy link
Contributor

thewheat commented Oct 13, 2018

Closes #1004

  • Adds support for Swagger tags which groups requests into folders

image

  • Also provides support for multiple tags in a single request: it will create duplicate requests to list them in multiple folders
    • A request with multiple Swagger Tags (i.e. Insomnia folders) is possible and displaying multiple times is expected as seen in this Swagger UI issue
    • Sample below is a modified json file where
      • Update an existing pet has tags of pet and store and
      • Add a new pet to the store has no tags

image

if (!tags || tags.length == 0) tags = [''];
tags.forEach((tag, index) => {
let id =
endpointSchema.operationId + (index > 0 ? index : '') || `__REQUEST_${requestCount++}__`;

This comment has been minimized.

@thewheat

thewheat Oct 13, 2018

Author Contributor

Added a suffix with index as if the request has multiple tags, each request needs a unique id and thus append index to make it unique

This comment has been minimized.

@gschier

gschier Oct 17, 2018

Collaborator

Nice, that sounds like a good solution 👍

@thewheat thewheat force-pushed the thewheat:support-swagger-tags branch from bb080c0 to 22360fc Oct 13, 2018

@gschier
Copy link
Collaborator

gschier left a comment

This looks awesome! This has been requested for a long time so thank you for taking care of it 🎆

if (!tags || tags.length == 0) tags = [''];
tags.forEach((tag, index) => {
let id =
endpointSchema.operationId + (index > 0 ? index : '') || `__REQUEST_${requestCount++}__`;

This comment has been minimized.

@gschier

gschier Oct 17, 2018

Collaborator

Nice, that sounds like a good solution 👍

@gschier gschier merged commit ebd3761 into getinsomnia:develop Oct 17, 2018

1 check was pending

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.