question

Gerald M. avatar image
Gerald M. asked ·

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


javarest apitags and metadata
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

1 Answer

Florian A. avatar image
Florian A. answered ·

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

Share
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.