arrays - Change of syntax -


i used return array of 'mappoints' (from db) using following

extension sequence iterator.element == mappoints {     func makejson() -> json {         return .array(self.map { $0.makejson() })     }      func makeresponse(request: request) throws -> response {         return try makejson().makeresponse()     } } 

this gives error "instance member 'array' cannot used on type 'json'"

can tell me how should done ?

through initialiser json(array: [t]).

extension sequence iterator.element == post {   func makejson() throws -> json {     return try json(map { try $0.makejson() })   }    func makeresponse(request: request) throws -> response {     return try makejson().makeresponse()   } } 

Comments

Popular posts from this blog

php - trouble displaying mysqli database results in correct order -

depending on nth recurrence of job in control M -

sql server - Cannot query correctly (MSSQL - PHP - JSON) -