AsyncAPI:仅生成有效负载

huangapple go评论79阅读模式
英文:

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

huangapple
  • 本文由 发表于 2022年10月13日 19:24:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/74054951.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定