swagger-typescript-api
swagger-typescript-api copied to clipboard
Readonly Prop and .d.ts option
Currently, the plugin does not reflect readonly properties. Also, there should be an option to allow export to .d.ts file
i think you are trying to create an SDK.
So,
- Create a new folder
- Add the generates types API.ts in src folder
- use this tsconfig.json
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"strict": true,
"noImplicitThis": true,
"alwaysStrict": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"forceConsistentCasingInFileNames": true,
"lib": [
"dom",
"es2015",
"esnext.asynciterable"
],
"sourceMap": true,
"declaration": true,
"skipLibCheck": true
},
"include": [
"src/**/*.ts"
],
"exclude": [
"node_modules"
]
}
- In the package.json, add this command to generate the build
"build": "rm -rf dist && npx tsc -p tsconfig.json --outDir ./dist"