-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get rid of multiple account_data calls for 3scale docs
- Loading branch information
Showing
6 changed files
with
52 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,24 @@ | ||
// We can define the 3scale plugins here and export the modified bundle | ||
import 'swagger-ui/dist/swagger-ui.css' | ||
|
||
import { renderApiDocs } from 'ActiveDocs/ThreeScaleApiDocs' | ||
import { renderSwaggerUI } from 'ActiveDocs/ThreeScaleApiDocs' | ||
|
||
import 'ActiveDocs/swagger-ui-3-provider-patch.scss' | ||
|
||
document.addEventListener('DOMContentLoaded', () => { | ||
const renderActiveDocs = async () => { | ||
const containerId = 'api-containers' | ||
const container = document.getElementById(containerId) | ||
|
||
if (!container) { | ||
throw new Error('The target ID was not found: ' + containerId) | ||
console.error(`The target element with ID ${containerId} was not found`) | ||
return | ||
} | ||
|
||
const { baseUrl = '', apiDocsPath = '', apiDocsAccountDataPath = '' } = container.dataset | ||
|
||
void renderApiDocs(container, apiDocsPath, baseUrl, apiDocsAccountDataPath) | ||
await renderSwaggerUI(container, apiDocsPath, baseUrl, apiDocsAccountDataPath) | ||
} | ||
|
||
document.addEventListener('DOMContentLoaded', () => { | ||
renderActiveDocs().catch(error => { console.error(error) }) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters