Closed
Description
const { generateApi } = require('swagger-typescript-api');
const path = require('path');
generateApi({
name: 'my-app',
output: path.join(process.cwd(), 'src', 'types', 'generated'),
url: 'https://127.0.0.1:8080/v3/api-docs',
prettier: true,
generateClient: false,
sortTypes: true
})
.then(() => console.log('API types successfully generated'))
.catch((ex) => console.error('Error generating API types', ex));
This all works just fine, except it outputs non-read-only types. From the docs I've seen, the only way to get readonly types is via the CLI. This seems like a strange limitation of the NodeJS API. Is there something I'm missing? Or is there just no way to make the generated types readonly?
Metadata
Metadata
Assignees
Labels
No labels