diff --git a/src/scripts/import-open-api.ts b/src/scripts/import-open-api.ts index c9ef88b..925b8ca 100644 --- a/src/scripts/import-open-api.ts +++ b/src/scripts/import-open-api.ts @@ -269,7 +269,12 @@ const importSpecs = (data: string, extension: "yaml" | "json"): Promise value.replace(/^{(.*)}$/, "$1"); +export const reactPropsValueToObjectValue = (value: string) => { + if (value.startsWith("{") && value.endsWith("}")) { + return value.slice(1, -1); + } + return value; +}; /** * Generate a restful-react component from openapi operation specs