insomnia icon indicating copy to clipboard operation
insomnia copied to clipboard

[Feature Request] Import Enumerations from Swagger file

Open bashovski opened this issue 5 years ago • 7 comments

As we are able to provide enumerations for parameters in body/query in Swagger, it would be neat if you could implement an option to import enumerations explicitly from Swagger file which would be, again, optional along with custom input provided by user. By making this feature possible, larger groups of developers would spend less time opening swagger file and searching the whole file for enums for certain parameter. For a single developer working on a project, such feature won't make significant difference, but as mentioned, larger teams may often come in confusion where many http requests are used along with their unsemantic params as well.

bashovski avatar Nov 25 '19 20:11 bashovski

👋 Thanks for opening your first issue! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. If you're requesting a feature 🎁, please provide real use cases that would benefit. 👪

To help make this a smooth process, please be sure you have first read the contributing guidelines.

welcome[bot] avatar Nov 25 '19 20:11 welcome[bot]

Hi @bashovski,

I'm not super familiar with Swagger. Can you elaborate, with examples, what you are describing?

gschier avatar Dec 04 '19 16:12 gschier

@gschier Swagger Data Models support Enums, generally these are explicitly defined values that parameters support. See here for more information.

The first example on that page is a good one where the query contains a parameter that is an enum:

paths:
  /items:
    get:
      parameters:
        - in: query
          name: sort
          description: Sort order
          schema:
            type: string
            enum: [asc, desc]

The enum being sort with the accepted values of asc or desc.


The ask I believe is to take these pre-defined values and present the parameter to the user and allow them to select one of the options defined in the file rather than free-hand type them. Am I correct in my evaluation of your ask @bashovski ?

nijikokun avatar Dec 05 '19 18:12 nijikokun

@nijikokun You are correct.

bashovski avatar Dec 10 '19 18:12 bashovski

Interesting idea! This seems like a feature that expands beyond Swagger/OpenAPI, as it would also be useful to have enum support in general within Insomnia. This has actually been requested a number of times already as well.

gschier avatar Dec 11 '19 16:12 gschier

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 02 '21 00:06 stale[bot]

Hi @bashovski, Thank you for reporting this issue. Have you tried our newest release to see if it alleviates your issue? It can be located here: https://github.com/Kong/insomnia/releases/tag/core%402022.6.0-beta.2

kreosus avatar Aug 24 '22 18:08 kreosus

I'm using

Version: Insomnia 2023.2.0
Build date: 4/26/2023
OS: Linux x64 5.4.0-146-generic
Electron: 22.0.0
Node: 16.17.1
V8: 10.8.168.20-electron.0
Architecture: x64

and it still seems to be lacking enum support in request creation.

SandyWalsh avatar Apr 28 '23 12:04 SandyWalsh