1.0.22 • Published 2 years ago
swagger-code-gen-liquid v1.0.22
swagger-code-gen-liquid
generate swagger typescript code with self-definition liquid templates. support swagger version 2.0 and 3.0+. It builds swagger operations and schemas in typescript.
how to use?
yarn add swagger-code-gen-liquid -D
or
npm install swagger-code-gen-liquid -D
Let's add a folder named 'swagger' in your project directory. write a js file named 'codegen.js'.
const { codegen } = require('swagger-code-gen-liquid')
codegen({
remoteUrl: 'http://localhost:44353/swagger/v1/swagger.json', // your swagger json url, v2.0 or 3.0+.
definitionTemplateFile: 'definitions.liquid', // your swagger schema definition template, liquidjs file.
serviceTemplateFile: 'service.liquid', // your swagger operations template, liquidjs file.
outputDir: './services' // output dir
})
console.log('finished')
In your package.json, add a command:
"scripts": {
"build:service": "node ./swagger/codegen.js"
},
then:
npm run build:service
now we have a typescript class definitions and services in your services/ folder. Enjoy it.
1.0.22
2 years ago
1.0.21
2 years ago
1.0.19
2 years ago
1.0.20
2 years ago
1.0.18
2 years ago
1.0.17
2 years ago
1.0.16
3 years ago
1.0.11
3 years ago
1.0.15
3 years ago
1.0.14
3 years ago
1.0.13
3 years ago
1.0.12
3 years ago
1.0.10
3 years ago
1.0.9
3 years ago
1.0.8
3 years ago
1.0.7
3 years ago
1.0.6
3 years ago
1.0.5
3 years ago
1.0.4
3 years ago
1.0.3
3 years ago
1.0.2
3 years ago
1.0.1
3 years ago