Skip to content

Conversation

@markendos
Copy link
Collaborator

This PR fixes issue described here by correctly mapping the attributes in the ReferenceValue.java class.

@markendos markendos added bug Something isn't working patch Should be applied for dependency updates and small bugfixes. and removed bug Something isn't working labels May 26, 2025
"id"
]
},
"ProductOfferingRefValue": {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not change the api.json files. They are the orginals from TMForum and only here for convinience.

Copy link
Collaborator Author

@markendos markendos May 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could not find another way autogenrate VO classes for the ProductOfferingRefValue class so it matches this type (needed in order for testing to assert equality).

Can you provide an alternative approach?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think I know understand the issue. When being translated to NGSI-LD, the reference needs to be treated as a relationship, not as a plain entity. Therefor the domain objects needs to be handled differnetly. See ProductOfferingRef, you might be able to just reuse it. Essentially, the library needs to knwo that this is a relationship, not just an attribute to be embedded.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't that reverting the changes made here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you are wanting to reference an entity here, it should. The change there might not be required at all anymore, due to the changes in translation to NGSI-LD since then. I need to have a deeper look into that, but for your case, we want that to behave as a relationship and a real entity.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I managed to apply this in latest changes

private URI href;

@Override
@JsonIgnore
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think that its a good solution to ignore it. We most likely need to change that class to provide the actual referenced type. The List.of("") is not correct, it needs to provide the type of the actual referenced entity.

Copy link
Collaborator Author

@markendos markendos May 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure of a good approach here since ReferenceValue is used both as an extension class (RelatedPartyRefValue, ProductOfferingRefValue and directly for attribute typing here and here. Therefore, ReferenceValue cannot be, for instance, abstract.

Could you provide some insight?

.productOfferingQualificationItem(null)
.quoteItem(null);

/**
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have direct access to the broker, therefor can create anything in the context you want;) See for example https://github.com/FIWARE/tmforum-api/blob/main/customer-bill-management/src/test/java/org/fiware/tmforum/customerbillmanagement/CustomerBillApiIT.java#L80

@markendos markendos force-pushed the fix-product-order-creation branch from 51b1c1e to 84adee6 Compare May 26, 2025 16:48
@markendos markendos requested a review from wistefan May 27, 2025 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch Should be applied for dependency updates and small bugfixes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants