Skip to content

Regression causes "Bad Request: 'readers.user_ids': Must be a list." #67

@winzig

Description

@winzig

I wrote some code against release 1.3.1 which creates channels, and it was working. I decided to fork ADNKit to try and mess with a few ideas, and noticed I was seeing this error when trying to create my channels:

Bad Request: 'readers.user_ids': Must be a list. 'writers.user_ids': Must be a list.

Traced it back to this commit: 676e9b1

I'm relatively new to Objective-C and it's not immediately obvious to me why that commit would suddenly cause the error above, but something is off.

FYI, I'm creating an ANKChannel as shown below, and passing it into [[ANKClient sharedClient] createChannel]

ANKChannel *channel = [[ANKChannel alloc] initWithJSONDictionary:
   @{
     @"type":       @"com.fanfriendly.channel",
     @"readers":
         @{
             @"any_user":   @NO,
             @"immutable":  @NO,
             @"public":     @NO,
             @"user_ids":   [NSMutableArray arrayWithCapacity:0],
             @"you":            @YES
             },
     @"writers":
         @{
             @"any_user":   @NO,
             @"immutable":  @NO,
             @"public":     @NO,
             @"user_ids":   [NSMutableArray arrayWithObjects:@170301, @6378, nil],
             @"you":            @YES
             },
     @"editors":
         @{
             @"any_user":   @NO,
             @"immutable":  @NO,
             @"public":     @NO,
             @"user_ids":   @[],
             @"you":            @YES
             },
     @"annotations":
         @[
             @{
                 @"type":   @"com.fanfriendly.event",
                 @"value":
                     @{
                         @"title":  title
                         }
                 }
             ]
     }];

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions