Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions app/javascript/packs/service_active_docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ const renderActiveDocs = async () => {

SwaggerUI({
url,
// eslint-disable-next-line @typescript-eslint/naming-convention -- SwaggerUI API
dom_id: `#${containerId}`,
domNode: container,
requestInterceptor
})
}
Expand Down
10 changes: 5 additions & 5 deletions app/javascript/src/ActiveDocs/ThreeScaleApiDocs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ const getApiSpecUrl = (baseUrl: string, specPath: string): string => {
return `${baseUrl.replace(/\/$/, '')}${specPath}`
}

const appendSwaggerDiv = (container: HTMLElement, id: string): void => {
const appendSwaggerDiv = (container: HTMLElement, id: string): HTMLDivElement => {
const div = document.createElement('div')
div.setAttribute('class', 'api-docs-wrap')
div.setAttribute('id', id)

container.appendChild(div)
return div
}

/**
Expand Down Expand Up @@ -137,14 +138,13 @@ export const renderSwaggerUI = async (container: HTMLElement, apiDocsPath: strin

const accountData: AccountDataResponse = await fetchData<AccountDataResponse>(accountDataUrl)

apiSpecs.apis.forEach( api => {
apiSpecs.apis.forEach(api => {
const domId = api.system_name.replace(/_/g, '-')
const url = getApiSpecUrl(baseUrl, api.path)
appendSwaggerDiv(container, domId)
const div = appendSwaggerDiv(container, domId)
SwaggerUI({
url,
// eslint-disable-next-line @typescript-eslint/naming-convention -- Swagger UI
dom_id: `#${domId}`,
domNode: div,
requestInterceptor: (request) => autocompleteRequestInterceptor(request, accountData, ''),
tryItOutEnabled: true,
plugins: [
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"@types/react-redux": "^7.1.34",
"@types/redux-api-middleware": "^3.2.3",
"@types/redux-immutable-state-invariant": "^2.1.2",
"@types/swagger-ui": "^3.52.0",
"@types/swagger-ui": "^5.21.1",
"@types/virtual-dom": "^2.1.1",
"bootstrap-sass": "3.4.3",
"braintree-web": "3.102.0",
Expand Down Expand Up @@ -103,7 +103,7 @@
"sass-loader": "13.3.3",
"showdown": "2.1.0",
"swagger-client": "^3.32.4",
"swagger-ui": "~5.12.3",
"swagger-ui": "5.27.1",
"validate.js": "^0.13.1",
"virtual-dom": "^2.1.1",
"webpack-assets-manifest": "5.2.1",
Expand Down
Loading