Skip to content

REST-API omits associated products depending on the type of product-id #300

@OhLookAUser

Description

@OhLookAUser

When developing a solution using the Akeneo REST-API, I noticed an issue regarding ids of associated products not being included in the result, when the products have different types of product-ids (ID vs UUID).

In our Testcase, we want to get all data of a product, that has an ID (SET000000000000039) and a UUID (5b8b4496-5ac8-40c2-8666-2aedfe915382).
The product's parent (product-model) is associated with another product, that only has a UUID (d1d68a51-6cac-408b-b58b-8b2780c4cc70).

If we do an API-call with the product's id:
{{url}}/api/rest/v1/products/SET000000000000039
...it seems that akeneo's api does NOT give the uuid from the associated products but a null value:

Image

If we do a call with the product's uuid:
{{url}}/api/rest/v1/products-uuid/5b8b4496-5ac8-40c2-8666-2aedfe915382
Then, the associated uuid is correctly displayed:

Image

When looking at the parent (product-model) of the product of our testcase, it only has an ID (2603_07a) but no UUID.
It is also associated with the product, that only has a UUID (d1d68a51-6cac-408b-b58b-8b2780c4cc70).

If we do a call for the product-model's data with its id:
{{url}}/api/rest/v1/product-models/2603_07a
... we don't even get any information on the associated product. Not even null.

Image

If we do the reverse call:
{{url}}/api/rest/v1/products-uuid/d1d68a51-6cac-408b-b58b-8b2780c4cc70
... we get the regular ids of the associated product-models

Image

To us this looks like faulty behaviour by the API.
To us, the expected behaviour is, that the endpoint should return information on any associations of the queried product regardless of the entitie's id type. Not only about entities with the same id-type.

Do you have any suggested workarounds for this behaviour?
For now our idea is to first check for products that have aproduct id and do the requests using the uuid-endpoint instead the regular endpoint.
Unfortunately that doesn't solve the issue for products / product-models that don't have a UUID yet.

This was tested on multiple systems including one running on Version: Serenity v20260219141027 Buttercup

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions