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

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -