GET components API is responding with two columns of same name. how do I differentiate them? - Sonatype Nexus Repository - Sonatype Community

GET components API is responding with two columns of same name. how do I differentiate them?

post by deepi.nag on Oct 29, 2024

I am using GET components using APEX_WEB_SERVICE.MAKE_REST_REQUEST.

But the response for is showing the same column twice. How do I differentiate.

Thanks,

Deepika

post by mprescott on Oct 29, 2024

That’s clearly not right. Can you share all of the relevant details? What version and edition (OSS or Pro) of Repository are you using? What REST endpoint are you calling, and what parameters are you using?

post by deepi.nag on Oct 30, 2024

I am using

version is OSS 3.70.2-01

rest/v1/components?repository=

The code is very simple and straight. other APIs return correct response. Only in this case I am receiving blobCreated twice.

Thanks,

Deepika

post by djb on Nov 7, 2024

I’d seen this issue with 3.42.0 (Pro) when calling /service/rest/v1/components?repository=blah. I had raised it in an email with a Sonatype colleague, but was informed that it had been ticketed and solved in 3.48.0.

However, I’ve just run the same GET on a golang-format repo. on 3.68.1-02 (Pro) and then a docker-format repo. on 3.69.0-02 (also Pro), and both responses contain duplicate blobCreated fields as shown in Deepika’s initial example image.

post by deepi.nag on Nov 19, 2024

Hi @djb

Thanks for the information. Is there any workaround/solution for this? I need this data for my requirement.

Deepika

post by djb on Nov 19, 2024

I just ignored the null value field in favour of the non-null field value provided beneath.

post by deepi.nag on Nov 25, 2024

But the problem is I get the same column name. only the values are different and by default it returns the value with null. Its in the screenshot attached above.

Thanks

post by mpiggott on Nov 25, 2024

I don’t see this on our internal instance for a Docker asset. Have you upgraded to H2 or PostgreSQL or is your instance still using OrientDB?