sngular / scs-multiapi-plugin

This is a Maven plugin designed to help developers automatizing the creation of code classes from YML files based on AsyncApi and OpenAPI.
http://sngular.com
Mozilla Public License 2.0
48 stars 10 forks source link

[AsyncApi] The plugin crash when parsing an array of objects #249

Closed alfredo9f closed 1 year ago

alfredo9f commented 1 year ago

What happens

If you have a definition like this:

asyncapi: 2.6.0
info:
  title: Customer Position
  version: 1.0.0
  description: Customer Position Service
servers:
  development:
    url: localhost:9092
    description: Development server
    protocol: kafka
    protocolVersion: 0.9.1
channels:
  importProduct:
    subscribe:
      operationId: "importProduct"
      message:
        payload:
          $ref: '#/components/schemas/ProductEvent'
  publishProduct:
    publish:
      operationId: "publishProduct"
      message:
        payload:
          $ref: '#/components/schemas/ProcessedProductEvent'

components:
  schemas:
    ProductEvent:
      type: object
      properties:
        accountId:
          type: string
        parties:
          type: array
          items:
            $ref: '#/components/schemas/Party'

    Party:
      type: object
      properties:
        partiId:
          type: string

    ProcessedProductEvent:
      type: object
      properties:
        accountId:
          type: string

The plugin is not able to create an array of Party and you have this error:

image

What is expected

The plugin creates an array of Party called parties