You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The "discriminator mapping" in OpenApi (see my OpenApi declaration in the gist below) seems to be ignored in generated Objective-C Client.
Having a look at the generated source code of the model class "A":
/** * Maps "discriminator" value to the sub-class name, so that inheritance is supported.*/
- (id)initWithDictionary:(NSDictionary *)dict error:(NSError *__autoreleasing *)err {
NSString * discriminatedClassName = [dict valueForKey:@"aTypeString"];
if(discriminatedClassName == nil ){
return [superinitWithDictionary:dict error:err];
}
Class class = NSClassFromString([@"OAI"stringByAppendingString:discriminatedClassName]);
if(!class) {
class = NSClassFromString([@"OAI"stringByAppendingString:[discriminatedClassName capitalizedString]]);
}
if([self class ] == class) {
return [superinitWithDictionary:dict error:err];
}
return [[class alloc] initWithDictionary:dict error: err];
}
Seems like the class name is just appended and no mapping value is considered.
Description
The "discriminator mapping" in OpenApi (see my OpenApi declaration in the gist below) seems to be ignored in generated Objective-C Client.
Having a look at the generated source code of the model class "A":
Seems like the class name is just appended and no mapping value is considered.
openapi-generator version
4.3.1
OpenAPI declaration file content or url
https://gist.github.com/onlymate/fbdf06ba849ebdbf64361aaeb8072f22
Command line used for generation
openapi-generator generate -i spec.json -o . -g objc
Related issues/PRs
Is this similar too:
#417
?
The text was updated successfully, but these errors were encountered: