mirror of
https://github.com/LukeHagar/connexion.git
synced 2025-12-10 04:19:37 +00:00
This PR updates the examples for Connexion 3.0 and merges them for OpenAPI and Swagger. 2 examples required some changes to make them work: - The reverse proxy example required some fixes to the SwaggerUIMiddleware to leverage the `root_path` correctly. This is included in the PR. - The enforced defaults example requires the json validator to adapt the body and pass it on. We currently pass on the original body after validation, and I'm not sure if we should change this. I'll submit a separate PR to discuss this.
33 lines
803 B
YAML
33 lines
803 B
YAML
swagger: "2.0"
|
|
|
|
info:
|
|
title: OAuth Example
|
|
version: "1.0"
|
|
|
|
basePath: /swagger
|
|
|
|
paths:
|
|
/secret:
|
|
get:
|
|
summary: Return secret string
|
|
operationId: app.get_secret
|
|
responses:
|
|
200:
|
|
description: secret response
|
|
schema:
|
|
type: string
|
|
security:
|
|
# enable authentication and require the "uid" scope for this endpoint
|
|
- oauth2: ['uid']
|
|
|
|
securityDefinitions:
|
|
oauth2:
|
|
type: oauth2
|
|
flow: implicit
|
|
authorizationUrl: https://example.com/oauth2/dialog
|
|
# the token info URL is hardcoded for our mock_tokeninfo.py script
|
|
# you can also pass it as an environment variable TOKENINFO_URL
|
|
x-tokenInfoUrl: http://localhost:7979/tokeninfo
|
|
scopes:
|
|
uid: Unique identifier of the user accessing the service.
|