Regression in 0.45.2: codegen leads to compile error for `allOf` in a named schema
This YAML generates code that can't be compiled. The problem does not occur on 0.45.1 or when reverting the commit for 0.45.2.
asyncapi: 2.6.0
info:
title: Sample
version: 0.0.2
defaultContentType: application/json
channels:
channel:
publish:
operationId: event
message:
payload:
$ref: '#/components/schemas/Payload'
components:
schemas:
Payload:
allOf:
- type: string
- type: string
The problem seems to be that there is a place where the codegen should use the name of the generated struct for Payload, but instead it uses the name that would be used if Payload wasn't defined in component.schema but inline in the message instead.
See demonstration at https://github.com/pofl/asyncapi-codegen/pull/1/files
I don't know how to fix this issue. If somebody with some insights into the inner workings of the generator could look into this, that would greatly help me and my team. Maybe @fairyhunter13?
Thanks @pofl for reporting and sorry about this, I'll take a look when I'll have a bit of time. I @fairyhunter13 you have some time to look into, please do not hesitate :)