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

Asyncapi: setting a reference on a message payload is not saved #801

Open
ben-lc opened this issue Aug 13, 2024 · 2 comments
Open

Asyncapi: setting a reference on a message payload is not saved #801

ben-lc opened this issue Aug 13, 2024 · 2 comments

Comments

@ben-lc
Copy link
Contributor

ben-lc commented Aug 13, 2024

Expected Behavior

When a reference is set on an asyncapi message payload, it should be saved.

Actual Behavior

Nothing is saved

Cause of the issue

ChangePayloadRefCommand_Aai20 command is called to update the payload ref, but the payload is not properly initialized when it is null :

Object payload = message.payload;
if (payload == null) {
   payload = JsonCompat.objectNode();  // it misses 'message.payload = payload' to set the newly created payload on the message
}
Object oldValue = JsonCompat.getProperty(payload, "$ref");

Steps to Reproduce the Problem

  1. Create a new asyncapi spec
  2. Create a new data type
  3. Create a new message
  4. Try to set the data type on the message payload reference

Specifications

  • apicurio studio: 0.2.62.Final
  • apicurio data models: 1.1.27
ben-lc pushed a commit to ben-lc/apicurio-data-models that referenced this issue Aug 13, 2024
@ben-lc ben-lc changed the title Asyncapi: payload not correctly initialized when setting a new ref in ChangePayloadRefCommand_Aai20 Asyncapi: setting a reference on a message payload is not saved Aug 13, 2024
EricWittmann pushed a commit that referenced this issue Aug 16, 2024
@EricWittmann
Copy link
Member

I guess we need a new release for this now yes? Specifically a new 1.x release.

@ben-lc
Copy link
Contributor Author

ben-lc commented Aug 20, 2024

Yes, but I also created Apicurio/apicurio-studio#2752 that may require new modifications in models, if you have time to take a look at it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants