mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-05 15:10:49 +00:00
Merge pull request #1697 from wing328/objc_minor_style
[ObjC] minor style change for objc client
This commit is contained in:
commit
2a8afbec8d
@ -132,6 +132,7 @@ static void (^reachabilityChangeBlock)(int);
|
||||
if (accepts == nil || [accepts count] == 0) {
|
||||
return @"";
|
||||
}
|
||||
|
||||
NSMutableArray *lowerAccepts = [[NSMutableArray alloc] initWithCapacity:[accepts count]];
|
||||
for (NSString *string in accepts) {
|
||||
NSString * lowerAccept = [string lowercaseString];
|
||||
@ -140,9 +141,11 @@ static void (^reachabilityChangeBlock)(int);
|
||||
}
|
||||
[lowerAccepts addObject:lowerAccept];
|
||||
}
|
||||
|
||||
if (lowerAccepts.count == 1) {
|
||||
return [lowerAccepts firstObject];
|
||||
}
|
||||
|
||||
return [lowerAccepts componentsJoinedByString:@", "];
|
||||
}
|
||||
|
||||
|
@ -6,12 +6,13 @@
|
||||
|
||||
- (instancetype)init {
|
||||
self = [super init];
|
||||
if (self)
|
||||
{
|
||||
|
||||
if (self) {
|
||||
// initalise property's default value, if any
|
||||
{{#vars}}{{#defaultValue}}self.{{name}} = {{{defaultValue}}};
|
||||
{{/defaultValue}}{{/vars}}
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -128,24 +128,25 @@ static void (^reachabilityChangeBlock)(int);
|
||||
/*
|
||||
* Detect `Accept` from accepts
|
||||
*/
|
||||
+ (NSString *) selectHeaderAccept:(NSArray *)accepts
|
||||
{
|
||||
+ (NSString *) selectHeaderAccept:(NSArray *)accepts {
|
||||
if (accepts == nil || [accepts count] == 0) {
|
||||
return @"";
|
||||
}
|
||||
|
||||
NSMutableArray *lowerAccepts = [[NSMutableArray alloc] initWithCapacity:[accepts count]];
|
||||
[accepts enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
|
||||
[lowerAccepts addObject:[obj lowercaseString]];
|
||||
}];
|
||||
|
||||
|
||||
if ([lowerAccepts containsObject:@"application/json"]) {
|
||||
for (NSString *string in accepts) {
|
||||
NSString * lowerAccept = [string lowercaseString];
|
||||
if ([lowerAccept containsString:@"application/json"]) {
|
||||
return @"application/json";
|
||||
}
|
||||
else {
|
||||
return [lowerAccepts componentsJoinedByString:@", "];
|
||||
[lowerAccepts addObject:lowerAccept];
|
||||
}
|
||||
|
||||
if (lowerAccepts.count == 1) {
|
||||
return [lowerAccepts firstObject];
|
||||
}
|
||||
|
||||
return [lowerAccepts componentsJoinedByString:@", "];
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -4,11 +4,12 @@
|
||||
|
||||
- (instancetype)init {
|
||||
self = [super init];
|
||||
if (self)
|
||||
{
|
||||
|
||||
if (self) {
|
||||
// initalise property's default value, if any
|
||||
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -4,11 +4,12 @@
|
||||
|
||||
- (instancetype)init {
|
||||
self = [super init];
|
||||
if (self)
|
||||
{
|
||||
|
||||
if (self) {
|
||||
// initalise property's default value, if any
|
||||
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -4,11 +4,12 @@
|
||||
|
||||
- (instancetype)init {
|
||||
self = [super init];
|
||||
if (self)
|
||||
{
|
||||
|
||||
if (self) {
|
||||
// initalise property's default value, if any
|
||||
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -4,11 +4,12 @@
|
||||
|
||||
- (instancetype)init {
|
||||
self = [super init];
|
||||
if (self)
|
||||
{
|
||||
|
||||
if (self) {
|
||||
// initalise property's default value, if any
|
||||
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -4,11 +4,12 @@
|
||||
|
||||
- (instancetype)init {
|
||||
self = [super init];
|
||||
if (self)
|
||||
{
|
||||
|
||||
if (self) {
|
||||
// initalise property's default value, if any
|
||||
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user