Swagger codegen .swagger-codegen-ignore not working

时间:2017-08-31 16:53:10

标签: python flask swagger

我几天都在为这个问题苦苦挣扎。试图确保我的控制器逻辑不会被覆盖。生成python-flask服务器存根。

swagger-codegen版本:2.2.3

.swagger-codegen-ignore contents

# Swagger Codegen Ignore
unity_controller.py

swagger-codegen生成-i ../tmp/swagger.yml -l python-flask -o ./

[main] INFO io.swagger.parser.Swagger20Parser - reading from ../tmp/swagger.yml
[main] INFO io.swagger.codegen.AbstractGenerator - writing file /Users/nctiggy/Syncplicity/DropBox/unity-sbux-hackathon/./swagger_server/models/unity_detail.py
[main] INFO io.swagger.codegen.AbstractGenerator - writing file /Users/nctiggy/Syncplicity/DropBox/unity-sbux-hackathon/./swagger_server/models/unity_summary.py
[main] INFO io.swagger.codegen.AbstractGenerator - writing file /Users/nctiggy/Syncplicity/DropBox/unity-sbux-hackathon/./swagger_server/controllers/unity_controller.py
[main] INFO io.swagger.codegen.DefaultGenerator - File exists. Skipped overwriting /Users/nctiggy/Syncplicity/DropBox/unity-sbux-hackathon/./swagger_server/test/test_unity_controller.py

我排除了其他正在编写的文件,因为我并不关心这些文件。看起来忽略适用于使用DefaultGenerator而不是AbstractGenerator的一个测试文件。

任何帮助将不胜感激!

1 个答案:

答案 0 :(得分:0)

必须指定它是多目录深度。

指定

#Swagger Codegen Ignore
swagger_server/controllers/unity_controller.py

解决了这个问题。

如果我希望它不那么具体,我也可以指定使用通配符。不是我期待的行为,但它会做。