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.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
openapi: 3.0.0info:
title: My APIversion: ""paths:
/item:
get:
responses:
200:
$ref: '#/components/responses/PaginatedItems'400:
$ref: '#/components/responses/BadRequest'401:
$ref: '#/components/responses/Unauthorized'summary: List all resourcesdescription: Get a paginated list of all items.tags:
- Itemparameters:
- $ref: '#/components/parameters/JsonHeader'
- $ref: '#/components/parameters/PerPage'
- $ref: '#/components/parameters/Page'security:
- oauth2:
- item:indextags:
- name: Itemservers:
- url: https://{subdomain}.mydomain.com/apivariables:
subdomain:
default: testcomponents:
securitySchemes:
oauth2:
type: oauth2flows:
authorizationCode:
authorizationUrl: https://{subdomain}.mydomain.com/api/oauth/authorizetokenUrl: https://{subdomain}.mydomain.com/api/oauth/access_tokenscopes:
'item:index': Index itemsschemas:
Pagination:
type: objectproperties:
total:
type: numberdescription: Total number of objectscount:
type: numberdescription: Object on this pageper_page:
type: numberdescription: Object per pagecurrent:
type: numberdescription: Current page numbertotal_pages:
type: numberdescription: Total number of pageslinks:
type: objectdescription: Array of meta linksproperties:
self:
type: stringdescription: Link to the current pagefirst:
type: stringdescription: Link to the first pageprev:
type: stringdescription: Link to the previous pagenext:
type: stringdescription: Link to the next pagelast:
type: stringdescription: Link to the last pageItem:
type: objectproperties:
id:
type: numberdescription: Id of the itemname:
type: stringdescription: The name of the itemUnauthorized:
type: objectproperties:
success:
type: booleanerror:
type: stringdescription: The type of errorerror_description:
type: stringdescription: A detailed description of the errordescription: An authorized actionBadRequest:
type: objectproperties:
error:
type: stringerror_description:
type: stringdescription: A bad requestresponses:
BadRequest:
description: Bad Requestcontent:
application/json:
schema:
$ref: '#/components/schemas/BadRequest'examples:
UnauthorizedScopeExample:
$ref: '#/components/examples/BadScopeRequestExample'UnauthorizedExample:
$ref: '#/components/examples/BadRequestExample'Unauthorized:
description: Unauthorizedcontent:
application/json:
schema:
$ref: '#/components/schemas/Unauthorized'examples:
UnauthorizedExample:
$ref: '#/components/examples/UnauthorizedExample'PaginatedItems:
description: A paginated collection of the item resourceheaders: {}content:
application/json:
schema:
type: objectproperties:
data:
type: arrayitems:
$ref: '#/components/schemas/Item'meta:
$ref: '#/components/schemas/Pagination'examples:
PaginatedAddressExample:
$ref: '#/components/examples/PaginatedItemsExample'examples:
BadRequestExample:
summary: 400 No access tokendescription: Your request is missing required oauth paramenters, check that the access_token is passed correctlyvalue:
error: invalid_requesterror_description: The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the "access token" parameter.BadScopeRequestExample:
summary: 400 Invalid scope(s)description: Your access token doesn't have the correct scopes. You will probably need to request a new one which includes the scope(s) for this endpoint.value:
success: falseerror:
code: 400message: Invalid scope(s) providedPaginatedItemsExample:
summary: 200 OKvalue:
data:
- id: 4name: itemmeta:
pagination:
total: 1count: 1per_page: 15current: 1total_pages: 1links: []parameters:
PerPage:
name: perPagein: querydescription: The maximum number of objects to returnrequired: falseexample: "25"schema:
type: integerdefault: 15Page:
name: pagein: querydescription: The page numberrequired: falseexample: "1"schema:
type: integerdefault: 1JsonHeader:
name: Acceptin: headerdescription: Provide the desired response type. If this is not provided error messages might be rendered as a generic 500 html page.required: trueexample: application/jsonschema:
type: stringenum:
- application/json
The authorizationUrl and tokenUrl values themselves don't support {variables}, that's why those placeholders aren't replaced.
Since your OAuth authorization server is the same as the API server, what you can do is define these endpoints relative to the API server so that they will "inherit" the computed subdomain:
The effort to support this approach in Swagger UI is tracked in #3992, so I'll close this issue in favor of #3992. Please track the other issue to get notified when this functionality becomes available in Swagger UI.
Q&A (please complete the following information)
Content & configuration
Swagger/OpenAPI definition:
Swagger-UI configuration options:
Default editor at https://editor.swagger.io/
Screenshots
Change the subdomain variable:

Not reflected in the authorizationUrl:

How can we help?
Why isn't the changed
subdomain
variable reflected in theauthorizationUrl
?The text was updated successfully, but these errors were encountered: