SolaceLabs / solace-tools-typescript

This repository contains tools to enable interaction with the Solace PubSub+ Platform including an AsyncAPI Importer
https://api.solace.dev/
Apache License 2.0
5 stars 3 forks source link

AsyncAPi Importer - warn if message is used by multiple channels #121

Open 195858 opened 1 year ago

195858 commented 1 year ago

Describe the bug Importer uses message form AsyncAPI to create an Event in EP.

If a message is referenced in multiple channels the import fails as it attempts to attach different topics attached to the same event.

To Reproduce Steps to reproduce the behavior: Import the Async API attached Observer the error

A clear and concise description of what happens.

Expected behavior A clear and concise description of what you expected to happen.

Log files If applicable, add log file(s) to help troubleshoot the problem.

Additional context Add any other context about the problem here. ERPO2CAPI.yaml.zip

TamimiGitHub commented 1 year ago

Explicitly defining the event name in the spec file will bypass this error

channels:
  sales/{object}/notification/{version}/{erp_id}/{sales_organization}/{distribution_channel}/{division}:
    x-ep-event-name: "Object"
    description: 'Event responsible for providing information about ERP orders/invocies/etc. changes that can be consumed by client system to properly inform end-user.'
    parameters:
      $ref: '#/components/parameters'
    publish:
      message:
        $ref: '#/components/messages/Notification'
  erp/{erp_id}/notification/{version}/{object}/{sales_organization}/{distribution_channel}/{division}:
    x-ep-event-name: "ERP ID"
    description: 'Event responsible for providing information about ERP orders/invocies/etc. changes that can be consumed by client system to properly inform end-user.'
    parameters:
      $ref: '#/components/parameters'
    subscribe:
      message:
        $ref: '#/components/messages/Notification'

However I do agree that this should be handled more gracefully.