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 McKinleyandRoberto Jimenez Sanchez authored and GitHub committed 2025-08-12 17:25:19 +00:00
1 parent 2345da5100
commit edcb6e6895
5 files changed
+352 -1529

No files matched your search

+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);