Closed lamuertepeluda closed 5 years ago
Do you test with example
npm run build:api
?
Actually I did with my endpoint.
Now that you asked, I also tried with the example. However testing with the example is not straightforward:
cd example
yarn build:api
internal/modules/cjs/loader.js:583
throw err;
^
Error: Cannot find module 'swagger-axios-codegen'
...
I had to modify
swagger-axios-codegen/example/swagger/codegen.js
const { codegen } = require('../../dist/index')
and also run
yarn
yarn build:all
In the example directory.
Here I attach the outcome index.ts.zip
Perhaps we should add some automated testing, e.g. with jest. like "Expect the output to be some reference file"
Good!
BTW, you can cd example && yarn && yarn link swagger-axios-codegen
for test
@lamuertepeluda I was add azure pipe
Hi,
I solved the problem with class names (at least when using
path
parameter) mentioned in #13 .The main issue is that type definitions for camelcase are wrong (or out of date, so at least currently wrong). Using a rx, as you did, is not effective.
The following is a more correct definition for camelcase. You can compare against the library docs and the "official" types definition which is completely wrong.
But i didn't have success in including into the local definitions, so I just decided to cut the official ones out. I removed
@types/camelcase
and I added atsconfig.json
for handling this, which also address debugging issues (lack of sourcemaps in the generated code)