所以在使用Swagger-CodeGen之后,我想知道是否有任何方法可以排除生成客户端文件夹(包括Configuration,ApiClient,ApiException等),因为这段代码似乎是样板文件,当我有多个 endpoints 时它会重复使用CodeGen生成 .
除了手动删除客户端文件夹并在生成的Api中重新映射命名空间之外,目前有解决方案吗?
您可以使用.swagger-codegen-ignore文件跳过文件生成,该文件与.gitignore非常相似 . 这是一个例子:
# Swagger Codegen Ignore # Lines beginning with a # are comments # This should match build.sh located anywhere. build.sh # Matches build.sh in the root /build.sh # Exclude all recursively docs/**
参考:https://github.com/swagger-api/swagger-codegen#ignore-file-format
1 回答
您可以使用.swagger-codegen-ignore文件跳过文件生成,该文件与.gitignore非常相似 . 这是一个例子:
参考:https://github.com/swagger-api/swagger-codegen#ignore-file-format