Skip to content

Commit e8dba5f

Browse files
author
Jakub Jankowski
authored
fix: use safeStringify (#78)
* fix: safe stringify * fix: no need for stringifying * fix: prefer safeStringify
1 parent 34995d2 commit e8dba5f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/shared/Validations.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { safeStringify } from '@stoplight/json';
12
import { Dictionary } from '@stoplight/types';
23
import { Popover } from '@stoplight/ui-kit';
34
import cn from 'classnames';
@@ -50,7 +51,7 @@ export const Validations: React.FunctionComponent<IValidations> = ({
5051
} else {
5152
elem = (
5253
<div className="m-1 px-1 bg-gray-2 dark:bg-gray-8 font-bold text-sm rounded" key={index}>
53-
{JSON.stringify(validation)}
54+
{typeof validation === 'string' ? `"${validation}"` : safeStringify(validation)}
5455
</div>
5556
);
5657
}

0 commit comments

Comments
 (0)