英文:
AsyncAPI: Only generate payload
问题
使用asyncapi-generator是否可以跳过生成特定文件?
我正在使用Go生成器,但我只需要payload.go
文件。目前它总是生成所有文件:
handlers.go payloads.go publishers.go router.go server.go subscribers.go
我正在使用的命令是:
$ docker run --rm -it \
-v ${PWD}/asyncapi.yaml:/app/asyncapi.yml \
-v ${PWD}/output:/app/output \
asyncapi/generator -o /app/output /app/asyncapi.yml @asyncapi/go-watermill-template --force-write
英文:
Is it possible to skip generation of specific files using asyncapi-generator?
I am using the Go generator but I only need the payload.go
. Right now it always generates all files:
handlers.go payloads.go publishers.go router.go server.go subscribers.go
The command I am using is:
$ docker run --rm -it \
-v ${PWD}/asyncapi.yaml:/app/asyncapi.yml \
-v ${PWD}/output:/app/output \
asyncapi/generator -o /app/output /app/asyncapi.yml @asyncapi/go-watermill-template --force-write
答案1
得分: 3
你目前还不能选择性地仅生成选定的文件。我鼓励你加入GitHub上的相关讨论。
根据我所了解,你只对模型生成感兴趣。所以也许你可以直接使用go-watermill-template中使用的Modelina工具。
Modelina已经与AsyncAPI CLI集成,你可以执行asyncapi generate models golang asyncapi.yml
来生成模型。
英文:
You cannot selectively generate only selected files yet. I encourage you to join the related discussion on GitHub
From what I understand is that you are interested only in models generation. So maybe you should just use directly the Modelina tool that is used there in go-watermill-template.
Modelina is already integrated with AsyncAPI CLI and you can do asyncapi generate models golang asyncapi.yml
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论