Skip to content

Commit de3c734

Browse files
authored
fix(orchestrator): warn "unknown format X ignored in schema at path Y" (#1270)
Fix warn "unknown format X ignored in schema at path Y" During backstage startup there are warnings like `unknown format "date-time" ignored in schema at path "#/oneOf/0/properties/ended"` due to a bug in OpenAPIBackend[1]. Resolve https://issues.redhat.com/browse/FLPATH-1045 Based on Yaron Dayagi <[email protected]> work in notification plugin[2] [1] openapistack/openapi-backend#280 [2] https://github.com/janus-idp/backstage-plugins/blob/903c7f37a1cf138ac96ef3f631f951866c2014fa/plugins/notifications-backend/src/service/router.ts#L45-L52 Signed-off-by: Gloria Ciavarrini <[email protected]>
1 parent 903c7f3 commit de3c734

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

plugins/orchestrator-backend/dist-dynamic/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"winston": "^3.11.0",
6464
"yn": "^5.0.0",
6565
"moment": "^2.29.4",
66+
"ajv-formats": "^2.1.1",
6667
"js-yaml": "^4.1.0"
6768
},
6869
"devDependencies": {},

plugins/orchestrator-backend/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@
8686
"openapi-types": "^12.1.3",
8787
"winston": "^3.11.0",
8888
"yn": "^5.0.0",
89-
"moment": "^2.29.4"
89+
"moment": "^2.29.4",
90+
"ajv-formats": "^2.1.1"
9091
},
9192
"devDependencies": {
9293
"@backstage/cli": "0.25.2",

plugins/orchestrator-backend/src/service/router.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { DiscoveryApi } from '@backstage/core-plugin-api';
33
import { ScmIntegrations } from '@backstage/integration';
44
import { JsonObject, JsonValue } from '@backstage/types';
55

6+
import { fullFormats } from 'ajv-formats/dist/formats';
67
import express from 'express';
78
import Router from 'express-promise-router';
89
import { OpenAPIBackend, Request } from 'openapi-backend';
@@ -146,6 +147,7 @@ function initOpenAPIBackend(): OpenAPIBackend {
146147
strictSchema: false,
147148
verbose: true,
148149
addUsedSchema: false,
150+
formats: fullFormats, // open issue: https://github.com/openapistack/openapi-backend/issues/280
149151
},
150152
handlers: {
151153
validationFail: async (

0 commit comments

Comments
 (0)