Search code examples
gogeneratorasyncapi

AsyncAPI: Only generate payload


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

Solution

  • 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