How to add multiple profile pictures to User

I’m finding the way to upload more than one picture to user model by adding and initiate an optional String array for the images to the user model as following .

final class User: Codable {
var id: UUID?
var name: String
var username: String
var password: String
var profilePicture: [String?]

init(name: String, username: String , password: String,profilePicture:[String?] = [nil]) { = name
    self.username = username
    self.password = password
    self.profilePicture = profilePicture

But I get the error like this.
[ ERROR ] DecodingError.dataCorrupted: The given data was not valid JSON. (NIOServer.swift:102)

Appreciated if anyone can advise how to solve the problem.

Oh , I know the problem.
It should separate the table using one to many.

Sorry everyone.

1 Like

@thammaporn Really glad you sorted it out! Cheers! :]