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

No way to choose right schema from dropdown box in Endpoint #52

Closed
boskiv opened this issue Aug 15, 2019 · 5 comments

Comments

@boskiv
Copy link

commented Aug 15, 2019

Based on https://community.stoplight.io/t/security-schemas-in-stoplight-studio/796

Describe the bug
You will be confused with security configuration in the endpoint when you have more than one security schemas of one type but a different kind.

To Reproduce

  1. Create a 2 security schemas of http type. One for basic auth, one for bearer
  2. Create an endpoint GET /auth/login that should get basic auth and return a JWT token
  3. See 2 http options in security dropdown box

Expected behavior
I prefer to use key instead of schema_n as a dropdown value here.
And also when I create a schema I prefer to use a kind as a key instead of schema_n

components:
  schemas: {}
  securitySchemes:
    bearer:
      type: http
      scheme: Bearer
      description: bearer
    basic:
      type: http
      scheme: Basic
      description: basic
    scheme_2: <- i think apikey here will be more verbose
      name: API Key
      type: apiKey

Screenshots
Screenshot 2019-08-15 at 3 10 36 PM
Screenshot 2019-08-15 at 3 10 29 PM

Environment (remove any that are not applicable):

  • Studio version: 1.0.0.5249
  • OS: OSX Mojave 10.14.6 (18G87)
  • Browser: Chrome Version 76.0.3809.100 (Official Build) (64-bit)

Additional context
Add any other context about the problem here.

@boskiv boskiv added the bug label Aug 15, 2019

@boskiv

This comment has been minimized.

Copy link
Author

commented Aug 15, 2019

I have found, that if I add name attribute here

components:
  schemas: {}
  securitySchemes:
    bearer:
      type: http
      scheme: Bearer
      description: bearer
      name: bearer
    basic:
      type: http
      name: basic
      scheme: Basic
      description: basic

it fixes dropbox issue
Screenshot 2019-08-15 at 3 51 26 PM

but add some validation errors

Screenshot 2019-08-15 at 3 53 31 PM

@boskiv

This comment has been minimized.

Copy link
Author

commented Aug 15, 2019

@chris-miaskowski

This comment has been minimized.

Copy link

commented Aug 29, 2019

Howdy! Here is my suggestion. Instead of trying to figure out the right name to display based on type, name or a combination of these we would always display the key.

The reason I would opt for key instead anything else is that only keys will assure uniqueness.

I have a quick fix that would allow us to modify the key directly form UI which should make stuff more obvious.

Here are some screenshots:

image.png

image.png

Note that we'd still generate a "indexed" name to ensure we have some default key folks can start working with.

@boskiv

This comment has been minimized.

Copy link
Author

commented Aug 29, 2019

Sounds good.

@chris-miaskowski

This comment has been minimized.

Copy link

commented Aug 29, 2019

Thanks for the feedback @boskiv! It's under review now. Will update this issue if we decide to change anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.