catalog-backend-module-backstage-openapi: move over and tweak config schema

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2023-10-24 10:50:08 +02:00
parent 28fa763ba0
commit f981d5edcf
4 changed files with 18 additions and 10 deletions
+1 -3
View File
@@ -34,10 +34,8 @@
"supertest": "^6.1.3"
},
"files": [
"dist",
"config.d.ts"
"dist"
],
"configSchema": "config.d.ts",
"dependencies": {
"@backstage/backend-plugin-api": "workspace:^",
"@backstage/config": "workspace:^",
@@ -13,11 +13,19 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export interface Config {
openapi?: {
/**
* A list of plugins, whose OpenAPI specs you want to collate in `InternalOpenApiDocumentationProvider`.
*/
plugins: string[];
catalog?: {
providers?: {
/**
* BackstageOpenApiEntityProvider configuration
*/
backstageOpenapi?: {
/**
* A list of plugins, whose OpenAPI specs you want to collate in `InternalOpenApiDocumentationProvider`.
*/
plugins: string[];
};
};
};
}
@@ -47,7 +47,9 @@
"openapi3-ts": "^3.1.2",
"supertest": "^6.2.4"
},
"configSchema": "config.d.ts",
"files": [
"dist"
"dist",
"config.d.ts"
]
}
@@ -207,7 +207,7 @@ export class InternalOpenApiDocumentationProvider implements EntityProvider {
async refresh(logger: LoggerService) {
const pluginsToMerge = this.config.getStringArray(
'catalog.providers.openapi.plugins',
'catalog.providers.backstageOpenapi.plugins',
);
logger.info(`Loading specs from from ${pluginsToMerge}.`);
const documentationEntity: ApiEntity = {