some change
This commit is contained in:
parent
d4a1492d56
commit
313f1def49
38 changed files with 475 additions and 401 deletions
|
@ -14,7 +14,9 @@ export async function generateApiSchema(openapiUrl, outputFilePath, pathToPretti
|
|||
const request = new Request(openapiUrl)
|
||||
const response = await fetch(request)
|
||||
const json = await response.text()
|
||||
const ast = await openapiTS(json, {})
|
||||
const ast = await openapiTS(json, {
|
||||
pathParamsAsTypes: true,
|
||||
})
|
||||
const prettierConfig = await resolveConfig(pathToPrettierRc, {
|
||||
useCache: true,
|
||||
})
|
||||
|
@ -25,5 +27,5 @@ export async function generateApiSchema(openapiUrl, outputFilePath, pathToPretti
|
|||
|
||||
if (fileURLToPath(import.meta.url) === process.argv[1]) {
|
||||
if (!process.env.OPENAPI_URL) throw new Error('OPENAPI_URL is not defined')
|
||||
await generateApiSchema(process.env.OPENAPI_URL, './src/api/schema.ts', './.prettierrc')
|
||||
await generateApiSchema(process.env.OPENAPI_URL, './src/app/api/schema.ts', './.prettierrc')
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue