Up‐ and downgrading V2 and V3 specifications - ByteBardOrg/AsyncAPI.NET GitHub Wiki

The models all reflect the current major version of Asyncapi which as of right now is V3.

V3 has non-compatible changes when coming from V2, however AsyncAPI tries to rectify this by making the upgrade/downgrade as compatible as possible. This however comes with a few caveats.
To ensure compatibility, some references might be re-flowed or models might be moved to be references instead.
It will however functionally be the same specification.
Properties that have been removed in V3 will not be kept around however, if downgrading again to V2. examples of this is

  • Channelkey - as this used to be the address, the key is now 'normalized' when downgrading.
  • Operationkey - taken either from OperationId or put as 'anonymous-operation-{int}'.
  • OperationId - this is not kept around when downgrading, even if the original V2 spec had it.
  • Messages - When downgrading only the first found is picked.
  • References - Some references are reflowed or resolved during downgrading.

Please see https://www.asyncapi.com/docs/migration/migrating-to-v3 for the generalized migration guide.
The migrations that the library makes have been validated with the AsyncAPI community.

As mentioned all models reflect the current AsyncAPI version. Reading V2 and V3 is the same

var reader = new AsyncApiStringReader();
var document = reader.Read(input, out var diagnostics);

Downgrading is simply a matter of specifying the output version.

var serialized = document.SerializeAsYaml(AsyncApiVersion.AsyncApi2_0);