Provisioning: Fix OpenAPI generation (#109513)

* post-process spec

* update client

* fix the openapi

* revert playlist change

* Fix unmanaged resource counts

---------

Co-authored-by: Roberto Jimenez Sanchez <roberto.jimenez@grafana.com>
This commit is contained in:
Ryan McKinley
2025-08-12 17:25:19 +00:00
committed by GitHub
co-authored by Roberto Jimenez Sanchez
parent 2345da5100
commit edcb6e6895
5 changed files with 352 additions and 1529 deletions
+5
View File
@@ -69,6 +69,11 @@ function processOpenAPISpec(spec: OpenAPIV3.Document) {
const newSchemas: Record<string, unknown> = {};
for (const schemaKey of Object.keys(newSpec.components.schemas)) {
const newKey = simplifySchemaName(schemaKey);
if (newSchemas[newKey]) {
// This can happen when invalid specs are used, although ignoring the error will work
// it is better to fix the spec to avoid confusion.
throw new Error(`Duplicate schema key found: ${newKey}. from: ${schemaKey}`);
}
const schemaObject = newSpec.components.schemas[schemaKey];
updateRefs(schemaObject);