# Openapi-Generator built API Client not working for TagComparisonOperation

**URL:** <https://community.dynatrace.com/t/openapi-generator-built-api-client-not-working-for-tagcomparisonoperation/18595>\
**Category:** Dynatrace API\
**Tags:** tagging, java, dynatrace-api\
**Created:** [February 27, 2020, 8:18am UTC](https://community.dynatrace.com/t/openapi-generator-built-api-client-not-working-for-tagcomparisonoperation/18595 "2020-02-27T08:18:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gerald\_madlsper](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/gerald_madlsper/32/22365_2.png) [@gerald\_madlsper](https://community.dynatrace.com/u/gerald_madlsper)\
**Post date:** [February 27, 2020, 8:18am UTC](https://community.dynatrace.com/t/openapi-generator-built-api-client-not-working-for-tagcomparisonoperation/18595/1 "2020-02-27T08:18:59Z")

</div>

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](https://nwdyna01/e/b23df3f5-7024-4f3b-a773-cc4de9ac0ac0/rest-api-doc/index.jsp?urls.primaryName=Configuration%20API#/Service%20-%20Detection%20full%20web%20service/createRule_2) ) 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

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

```

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

```auto
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

---

<div class="post-metadata">

**Author:** ![florian\_AIgner](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/florian_aigner/32/37751_2.png) [@florian\_AIgner](https://community.dynatrace.com/u/florian_AIgner)\
**Post date:** [July 6, 2020, 10:11am UTC](https://community.dynatrace.com/t/openapi-generator-built-api-client-not-working-for-tagcomparisonoperation/18595/2 "2020-07-06T10:11:00Z")

</div>

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
