Skip to content

Commit

Permalink
fix: show server dropdown (instead hide authorization button)
Browse files Browse the repository at this point in the history
  • Loading branch information
jarlah committed Jan 24, 2024
1 parent ab303a4 commit f4d960f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
15 changes: 15 additions & 0 deletions dist/index.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
<html>
<head>
<script type="text/javascript" src="./try-it-out.min.js"></script>
<!-- <link rel="stylesheet" href="https://unpkg.com/[email protected]/swagger-ui.css" /> -->
</head>
<body>
<div id="redoc_container"></div>
<!-- <script src="https://unpkg.com/[email protected]/swagger-ui-bundle.js" crossorigin></script> -->
<script>
// SwaggerUIBundle({
// url: "./openapi.yaml",
// dom_id: '#redoc_container',
// presets: [
// SwaggerUIBundle.presets.apis,
// SwaggerUIBundle.SwaggerUIStandalonePreset
// ],
// })
RedocTryItOut.init(
"https://petstore.swagger.io/v2/swagger.json",
{ title: "Pet Store" },
document.getElementById("redoc_container"),
);
// RedocTryItOut.init(
// "./openapi.yaml",
// { title: "Pet Store" },
// document.getElementById("redoc_container"),
// );
</script>
</body>
</html>
4 changes: 2 additions & 2 deletions dist/try-it-out.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/config/style-matcher.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export class StyleMatcherConfig implements StyleMatcherOptions {

private readonly _informationContainerTargetSelector: string =
".swagger-ui .information-container";
private readonly _schemeContainerTargetSelector: string =
".swagger-ui .scheme-container";
private readonly _authWrapperTargetSelector: string =
".swagger-ui .auth-wrapper";
private readonly _modelsContainerTargetSelector: string =
".swagger-ui .models";

Expand Down Expand Up @@ -152,8 +152,8 @@ export class StyleMatcherConfig implements StyleMatcherOptions {
return `${this.swaggerConfig.boxSelector}.${this.swaggerConfig.showClass} ${this._informationContainerTargetSelector}`;
}

public get openedSchemeContainerTargetSelector(): string {
return `${this.swaggerConfig.boxSelector}.${this.swaggerConfig.showClass} ${this._schemeContainerTargetSelector}`;
public get openedAuthWrapperTargetSelector(): string {
return `${this.swaggerConfig.boxSelector}.${this.swaggerConfig.showClass} ${this._authWrapperTargetSelector}`;
}

public get openedModelsContainerTargetSelector(): string {
Expand Down
2 changes: 1 addition & 1 deletion src/styler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export class Styler {
.noDisplay()
.add(Styler.cfg.openedInformationContainerTargetSelector)
.noDisplay()
.add(Styler.cfg.openedSchemeContainerTargetSelector)
.add(Styler.cfg.openedAuthWrapperTargetSelector)
.noDisplay()
.add(Styler.cfg.openedModelsContainerTargetSelector)
.noDisplay();
Expand Down

0 comments on commit f4d960f

Please sign in to comment.