cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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" : {
      "type" : "object",
      "required" : [ "type" ],
      "discriminator" : "type",


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

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


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


1 REPLY 1

dyaigs
Dynatrace Contributor
Dynatrace Contributor

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