OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
21.78k stars 6.57k forks source link

Flag -t (template directory) not workin in docker #11861

Open RussianDragon opened 2 years ago

RussianDragon commented 2 years ago

Hi. I try create custom template, but having a problem with template folder.

For beginning i just copy template typescript-fetch and try use it my local folder. docker run --rm -v C:\generatortest:/local openapitools/openapi-generator-cli:v5.4.0 generate -i /local/swagger_api.json -g typescript-custom -o /local/out/typescript8 --skip-validate-spec -t /local/template In the console I see.

Can't load config class with name 'typescript-custom'
Available:
ada
ada-server
android
apache2
apex
asciidoc
aspnetcore
avro-schema
bash
crystal
c
clojure
cwiki
cpp-qt-client
cpp-qt-qhttpengine-server
cpp-pistache-server
cpp-restbed-server
cpp-restsdk
cpp-tiny
cpp-tizen
cpp-ue4
csharp
csharp-netcore
csharp-dotnet2
csharp-nancyfx-deprecated
csharp-netcore-functions
dart
dart-dio
dart-dio-next
dart-jaguar
eiffel
elixir
elm
erlang-client
erlang-proper
erlang-server
flash-deprecated
fsharp-functions
fsharp-giraffe-server
go
go-deprecated
go-echo-server
go-server
go-gin-server
graphql-schema
graphql-nodejs-express-server
groovy
kotlin
kotlin-server
kotlin-server-deprecated
kotlin-spring
kotlin-vertx
ktorm-schema
haskell-http-client
haskell
haskell-yesod
java
jaxrs-cxf-client
java-inflector
java-micronaut-client
java-micronaut-server
java-msf4j
java-pkmst
java-play-framework
java-undertow-server
java-vertx
java-vertx-web
java-camel
jaxrs-cxf
jaxrs-cxf-extended
jaxrs-cxf-cdi
jaxrs-jersey
jaxrs-resteasy
jaxrs-resteasy-eap
jaxrs-spec
javascript
javascript-apollo
javascript-flowtyped
javascript-closure-angular
jmeter
k6
lua
markdown
mysql-schema
nim
nodejs-express-server
objc
ocaml
openapi
openapi-yaml
plantuml
perl
php
php-laravel
php-lumen
php-slim-deprecated
php-slim4
php-silex-deprecated
php-symfony
php-mezzio-ph
php-dt
powershell
protobuf-schema
python-legacy
python
python-fastapi
python-experimental
python-flask
python-aiohttp
python-blueplanet
r
ruby
ruby-on-rails
ruby-sinatra
rust
rust-server
scalatra
scala-akka
scala-akka-http-server
scala-finch
scala-httpclient-deprecated
scala-gatling
scala-lagom-server
scala-play-server
scala-sttp
scalaz
spring
dynamic-html
html
html2
swift5
typescript
typescript-angular
typescript-angularjs-deprecated
typescript-aurelia
typescript-axios
typescript-fetch
typescript-inversify
typescript-jquery
typescript-nestjs
typescript-node
typescript-redux-query
typescript-rxjs
wsdl-schema

[error] Check the spelling of the generator's name and try again.

I don't understand why not working special template folder... Problem persists on the latest version docker container.

wing328 commented 2 years ago

Can't load config class with name 'typescript-custom'

looks like that's the issue. it can't find the generator "typescript-custom"

adrianwix commented 2 years ago

Unless you are implementing your own generator by extending the class you have to use the same typescript-axios generator but with another template

RussianDragon commented 1 year ago

I need create new specific generator. But I don't find a simple guide. On this page There doesn't say how to set the templates directory. And "-t" doesn't work.

I don't understand how to run the test template created after the command: meta -o out/generators/my-codegen -n my-codegen -p com.my.company.codegen


I use next command for generate: docker run --rm -v C:\generatortest:/local openapitools/openapi-generator-cli:v6.2.1 generate \ -i /local/swagger.json \ -g my-codegen \ -t /local/template \ -o /local/out/typescript_2