jonaslagoni / asyncapi-quicktype-template

Template for generating typed models from AsyncAPI message payloads.
6 stars 3 forks source link

Generate message headers #11

Open alex-mueller opened 3 years ago

alex-mueller commented 3 years ago

Hi,

I took a look at the generator and tried to use it, works like a charm, thanks! But one thing I miss is the ability to add message header like described here: https://www.asyncapi.com/docs/specifications/2.0.0#definitionsMessage.

A message MUST contain a payload and MAY also contain headers

As a workaround I can add the header like a correlation id to the payload, but would be cool if this can be generated as well. Do you think this could be accomplished by the generator + quicktype?

jonaslagoni commented 3 years ago

Hey @alex-mueller thanks for the issue! Headers are also JSON Schema so they are compatible, and I will accept any PR adding this of course 😄

alex-mueller commented 3 years ago

I actually just realized, that I can define a correlationId within an operation that is just referring to one defined as part of the message payload. So the "workaround" seems to be a feature ^^ I'm still trying to figure out how to model my API and playing around with the ecosystem, so please don't expect any contribution so far.