asyncapi-codegen icon indicating copy to clipboard operation
asyncapi-codegen copied to clipboard

fix: add JSON omitempty and omitzero tags to asyncapiv3 types

Open justenstall opened this issue 4 months ago • 1 comments

This PR adds omitempty and omitzero to the JSON struct tags for any fields that are not required according to the AsyncAPI specification. Some fields required the newer omitzero tag to be excluded without changing them to a pointer type, but I used omitempty for every other field for maximum backwards compatibility.

There is also a bug fix for the Operation.Description field, which was set to use string as its name in JSON.

I documented that the MessageTrait.Payload field should probably be removed, but kept it for now.

I also documented some nuances with the interpretation of the Operation.Messages field.

justenstall avatar Aug 06 '25 19:08 justenstall

Sorry about the delay, I had some changes in my life this 2 past months, I'll take a look ASAP.

lerenn avatar Oct 27 '25 09:10 lerenn