Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Unexpected "Overwriting existing model" warning #2140

Open
2 tasks done
coekie opened this issue Dec 23, 2024 · 1 comment
Open
2 tasks done

[BUG] Unexpected "Overwriting existing model" warning #2140

coekie opened this issue Dec 23, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@coekie
Copy link

coekie commented Dec 23, 2024

Describe the bug.

When there are multiple references to the same message type in an asyncapi schema, an unexpected warning is printed.

Expected behavior

No warning. (Or, if there really is something wrong with this usage, a warning that more clearly states what the problem is).

Screenshots

›   Warning: Overwriting existing model with name Bar, are there two models with the same name present? Overwriting the old model.

How to Reproduce

With this file:

asyncapi: 2.6.0
info:
  title: overwriting warning problem
  version: "1"
defaultContentType: application/json
channels:
  /lala:
    publish:
      message:
        $ref: "#/components/messages/foo"
    subscribe:
      message:
        $ref: "#/components/messages/foo"
components:
  messages:
    foo:
      payload:
          type: object
          title: Bar
          properties: {}

Try to generate the model, e.g. with

asyncapi generate models typescript namesproblem.yml

🥦 Browser

None

👀 Have you checked for similar open issues?

  • I checked and didn't find similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to work on this issue ?

No, someone else can work on it

@coekie coekie added the bug Something isn't working label Dec 23, 2024
Copy link
Contributor

Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant