Skip to content

Commit d28ab7a

Browse files
committed
fix: downloaded operation is not snake-cased
1 parent 2ba1717 commit d28ab7a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/components/viewer/OperationViewer.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { useAtom } from 'jotai'
2121
import { noop } from 'lodash-es'
2222
import { ComponentType, FC, useMemo, useState } from 'react'
2323
import { Link } from 'react-router-dom'
24+
import snakecaseKeys from 'snakecase-keys'
2425

2526
import { FactItem } from 'components/FactItem'
2627
import { Paragraphs } from 'components/Paragraphs'
@@ -145,7 +146,11 @@ export const OperationViewer: ComponentType<{
145146

146147
const handleDownloadJSON = () => {
147148
// pretty print the JSON
148-
const json = JSON.stringify(operationDoc, null, 2)
149+
const json = JSON.stringify(
150+
snakecaseKeys(operationDoc, { deep: true }),
151+
null,
152+
2,
153+
)
149154
const blob = new Blob([json], {
150155
type: 'application/json',
151156
})

0 commit comments

Comments
 (0)