Openapi-Generator built API Client not working for TagComparisonOperation

Hi Guys,

We want to use the dynatrace configuration API in one of our projects and generated the client with the openapi-generator for java. Unfortunately for the Endpoint (POST/service/detectionRules/FULL_WEB_SERVICE ) it came up with a non working client.

Problem seems to be that the discriminator name of the entity CompareOperation has the same name as the attribute type within the TagCompareOperation

"CompareOperation" : {<br>      "type" : "object",<br>      "required" : [ "type" ],<br>      "<strong>discriminator" : "type"</strong>,

The generated client comes up with this so that the compareOperation has to “type” attributes.

compareOperations":[<strong>{"type":"TagCompareOperation"</strong>,"compareKeyOnly":null,"tags":[{"context":"KUBERNETES","key":"eosapp","value":"dynatrace-0-1-0"},{"context":"KUBERNETES","key":"environment","value":"dev"},{"context":"KUBERNETES","key":"project","value":"core"}]<strong>,"type":"TAG"</strong>}]}]

When I change the discriminator to baseType it works fine.

Is this a problem of the specification or a problem of openapi-generator?

regards,

Gerald

Hi Gerald,

this looks like a problem in the generator code, there is nothing wrong in having same attribute names in a nested objects. Good that you found a reasonable workaround.

Best regards,

Florian