From ad0adf79bd23d76b85ec1de1ab88fd1793aaf99b Mon Sep 17 00:00:00 2001 From: Ryan McKinley Date: Tue, 9 Dec 2025 15:08:16 +0300 Subject: [PATCH] fix test spec --- .../apis/datasource/hardcoded/testdata.go | 16 +++++++++++----- ...testdata.datasource.grafana.app-v0alpha1.json | 4 ++-- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/pkg/registry/apis/datasource/hardcoded/testdata.go b/pkg/registry/apis/datasource/hardcoded/testdata.go index 55fe00de237..05720b8fdf7 100644 --- a/pkg/registry/apis/datasource/hardcoded/testdata.go +++ b/pkg/registry/apis/datasource/hardcoded/testdata.go @@ -215,6 +215,17 @@ func TestdataOpenAPIExtension() (*datasourceV0.DataSourceOpenAPIExtension, error }, }, }, + "/test/json": { + PathProps: spec3.PathProps{ + Summary: "Echo json request", + Post: &spec3.Operation{ + OperationProps: spec3.OperationProps{ + RequestBody: unstructuredRequest, + Responses: unstructuredResponse, + }, + }, + }, + }, "/sims": { PathProps: spec3.PathProps{ Description: "Get list of simulations", @@ -260,10 +271,5 @@ func TestdataOpenAPIExtension() (*datasourceV0.DataSourceOpenAPIExtension, error }, }, } - - // Duplicate the test route (but with a new path) - testcopy := *oas.Routes["/test"] - oas.Routes["/test/json"] = &testcopy - return oas, nil } diff --git a/pkg/tests/apis/openapi_snapshots/testdata.datasource.grafana.app-v0alpha1.json b/pkg/tests/apis/openapi_snapshots/testdata.datasource.grafana.app-v0alpha1.json index fde74835f57..450482baa25 100644 --- a/pkg/tests/apis/openapi_snapshots/testdata.datasource.grafana.app-v0alpha1.json +++ b/pkg/tests/apis/openapi_snapshots/testdata.datasource.grafana.app-v0alpha1.json @@ -804,7 +804,7 @@ "tags": [ "Route" ], - "operationId": "post_route_test_json", + "operationId": "post_route_test", "requestBody": { "content": { "application/json": { @@ -852,7 +852,7 @@ ] }, "/apis/testdata.datasource.grafana.app/v0alpha1/namespaces/{namespace}/datasources/{name}/resource/test/json": { - "summary": "Echo any request", + "summary": "Echo json request", "post": { "tags": [ "Route"