init commit
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import { $ } from 'bun'
|
||||
import {writeFileSync} from "node:fs";
|
||||
|
||||
const main = async () => {
|
||||
const res = await fetch('https://{{sensitive_data}}/openapi.json')
|
||||
let openapi = await res.json()
|
||||
|
||||
openapi.paths = Object.fromEntries(Object.entries(openapi.paths).map(([key, value]) => {
|
||||
|
||||
value = Object.fromEntries(Object.entries(value).map(([key, value]) => {
|
||||
|
||||
value.responses = Object.fromEntries(Object.entries(value.responses).map(([key, value]) => {
|
||||
if (value['detail']) {
|
||||
delete value['detail'];
|
||||
}
|
||||
|
||||
return [key, value]
|
||||
}))
|
||||
|
||||
return [key, value]
|
||||
}))
|
||||
|
||||
return [key, value]
|
||||
}))
|
||||
|
||||
writeFileSync('./openapi.json', JSON.stringify(openapi, null, 2))
|
||||
|
||||
await $`bun run generate`
|
||||
}
|
||||
|
||||
main()
|
||||
Reference in New Issue
Block a user