-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Description
In the OpenAPI (Swagger) Editor it is tedious to fill out apiKey authorizations with long key values, especially when doing this multiple times during testing. Having a pre-set value in the "Available authorizations" dialog, taken from a x-example key in the #/components/securitySchemes/* apiKey definitions would be nice.
I tried a couple of approaches, but did not succeed. The closest I could get was to embed an example key in the apiKey description, which could be copy/pasted into the value field. But still I find this cumbersome...
As the Security Scheme Object object may be extended with Specification Extensions, however, for this feature, the $ref would need to be evaluated in the x-example.
API looks like this:
openapi: "3.1.0"
info:
version: "0.0.1"
title: Minimal example
servers:
- url: https://localhost/minimal/api
paths:
/foo:
get:
security:
- token: []
responses:
"200":
description: "OK"
post:
requestBody:
required: true
content:
text/plain:
schema:
$ref: "#/components/schemas/token"
responses:
"200":
description: "OK"
components:
securitySchemes:
token:
type: apiKey
in: header
name: X-API-Token
description: >-
API key. Example: `CtjMYIQTYkKeX2L2ze+plMXMGxtsZCP08/fXam740Uk=`
x-example:
$ref: "#/components/schemas/token"
schemas:
token:
type: string
example: "CtjMYIQTYkKeX2L2ze+plMXMGxtsZCP08/fXam740Uk="
security:
- token: []RobertKlohr
Metadata
Metadata
Assignees
Labels
No labels