Fix for issue 20256: Bug Report: converting circular structure to JSON error
Signed-off-by: bnechyporenko <bnechyporenko@bol.com>
This commit is contained in:
@@ -66,6 +66,7 @@
|
||||
"@types/json-schema": "^7.0.9",
|
||||
"@types/react": "^16.13.1 || ^17.0.0",
|
||||
"classnames": "^2.2.6",
|
||||
"flatted": "3.2.9",
|
||||
"humanize-duration": "^3.25.1",
|
||||
"immer": "^9.0.1",
|
||||
"json-schema": "^0.4.0",
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { JsonObject } from '@backstage/types';
|
||||
import { stringify, parse } from 'flatted';
|
||||
import { FieldValidation, UiSchema } from '@rjsf/utils';
|
||||
|
||||
function isObject(value: unknown): value is JsonObject {
|
||||
@@ -123,7 +124,7 @@ export const extractSchemaFromStep = (
|
||||
inputStep: JsonObject,
|
||||
): { uiSchema: UiSchema; schema: JsonObject } => {
|
||||
const uiSchema: UiSchema = {};
|
||||
const returnSchema: JsonObject = JSON.parse(JSON.stringify(inputStep));
|
||||
const returnSchema: JsonObject = parse(stringify(inputStep));
|
||||
extractUiSchema(returnSchema, uiSchema);
|
||||
return { uiSchema, schema: returnSchema };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user