27 Feb 2020 08:18 AM
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
Solved! Go to Solution.
06 Jul 2020 11:11 AM
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