From 0f8a97777489bcfa208d201b08fcb88c33359107 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 22 Aug 2023 16:52:27 +0200 Subject: [PATCH] catalog-backend: relax validation of full text query field Signed-off-by: Patrik Oldsberg --- .changeset/four-masks-fry.md | 5 +++++ .../src/schema/openapi.generated.ts | 15 +++++++++++++++ plugins/catalog-backend/src/schema/openapi.yaml | 15 +++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 .changeset/four-masks-fry.md diff --git a/.changeset/four-masks-fry.md b/.changeset/four-masks-fry.md new file mode 100644 index 0000000000..94bd929016 --- /dev/null +++ b/.changeset/four-masks-fry.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend': patch +--- + +Update OpenAPI schema to relax the encoding validation of all request parameters. diff --git a/plugins/catalog-backend/src/schema/openapi.generated.ts b/plugins/catalog-backend/src/schema/openapi.generated.ts index 3a56893b48..6691cad41c 100644 --- a/plugins/catalog-backend/src/schema/openapi.generated.ts +++ b/plugins/catalog-backend/src/schema/openapi.generated.ts @@ -45,6 +45,7 @@ export const spec = { name: 'kind', in: 'path', required: true, + allowReserved: true, schema: { type: 'string', }, @@ -53,6 +54,7 @@ export const spec = { name: 'namespace', in: 'path', required: true, + allowReserved: true, schema: { type: 'string', }, @@ -61,6 +63,7 @@ export const spec = { name: 'name', in: 'path', required: true, + allowReserved: true, schema: { type: 'string', }, @@ -69,6 +72,7 @@ export const spec = { name: 'uid', in: 'path', required: true, + allowReserved: true, schema: { type: 'string', }, @@ -78,6 +82,7 @@ export const spec = { in: 'query', description: 'Cursor to a set page of results.', required: false, + allowReserved: true, schema: { type: 'string', minLength: 1, @@ -88,6 +93,7 @@ export const spec = { in: 'query', description: 'Pointer to the previous page of results.', required: false, + allowReserved: true, schema: { type: 'string', minLength: 1, @@ -111,6 +117,7 @@ export const spec = { in: 'query', description: 'Filter for just the entities defined by this filter.', required: false, + allowReserved: true, schema: { type: 'array', items: { @@ -123,6 +130,7 @@ export const spec = { in: 'query', description: 'Number of records to skip in the query page.', required: false, + allowReserved: true, schema: { type: 'integer', minimum: 0, @@ -133,6 +141,7 @@ export const spec = { in: 'query', description: 'Number of records to return in the response.', required: false, + allowReserved: true, schema: { type: 'integer', minimum: 0, @@ -1037,6 +1046,7 @@ export const spec = { in: 'query', description: 'Text search term.', required: false, + allowReserved: true, schema: { type: 'string', }, @@ -1047,6 +1057,7 @@ export const spec = { description: 'A comma separated list of fields to sort returned results by.', required: false, + allowReserved: true, schema: { type: 'array', items: { @@ -1086,6 +1097,7 @@ export const spec = { in: 'query', name: 'facet', required: true, + allowReserved: true, schema: { type: 'array', items: { @@ -1141,6 +1153,7 @@ export const spec = { in: 'query', name: 'dryRun', required: false, + allowReserved: true, schema: { type: 'string', }, @@ -1226,6 +1239,7 @@ export const spec = { in: 'path', name: 'id', required: true, + allowReserved: true, schema: { type: 'string', }, @@ -1251,6 +1265,7 @@ export const spec = { in: 'path', name: 'id', required: true, + allowReserved: true, schema: { type: 'string', }, diff --git a/plugins/catalog-backend/src/schema/openapi.yaml b/plugins/catalog-backend/src/schema/openapi.yaml index e0b60b1a98..fe9574f89d 100644 --- a/plugins/catalog-backend/src/schema/openapi.yaml +++ b/plugins/catalog-backend/src/schema/openapi.yaml @@ -20,24 +20,28 @@ components: name: kind in: path required: true + allowReserved: true schema: type: string namespace: name: namespace in: path required: true + allowReserved: true schema: type: string name: name: name in: path required: true + allowReserved: true schema: type: string uid: name: uid in: path required: true + allowReserved: true schema: type: string cursor: @@ -45,6 +49,7 @@ components: in: query description: Cursor to a set page of results. required: false + allowReserved: true schema: type: string minLength: 1 @@ -53,6 +58,7 @@ components: in: query description: Pointer to the previous page of results. required: false + allowReserved: true schema: type: string minLength: 1 @@ -71,6 +77,7 @@ components: in: query description: Filter for just the entities defined by this filter. required: false + allowReserved: true schema: type: array items: @@ -80,6 +87,7 @@ components: in: query description: Number of records to skip in the query page. required: false + allowReserved: true schema: type: integer minimum: 0 @@ -88,6 +96,7 @@ components: in: query description: Number of records to return in the response. required: false + allowReserved: true schema: type: integer minimum: 0 @@ -788,12 +797,14 @@ paths: in: query description: Text search term. required: false + allowReserved: true schema: type: string - name: fullTextFilterFields in: query description: A comma separated list of fields to sort returned results by. required: false + allowReserved: true schema: type: array items: @@ -818,6 +829,7 @@ paths: - in: query name: facet required: true + allowReserved: true schema: type: array items: @@ -853,6 +865,7 @@ paths: - in: query name: dryRun required: false + allowReserved: true schema: type: string requestBody: @@ -908,6 +921,7 @@ paths: - in: path name: id required: true + allowReserved: true schema: type: string delete: @@ -923,6 +937,7 @@ paths: - in: path name: id required: true + allowReserved: true schema: type: string /analyze-location: