I was testing the examples of the book. Unfortunately this route gives me the above mentioned error:
router.get("api","acronyms",Acronym.parameter){ req -> Future<Acronym> in
return try req.parameters.next(Acronym.self)
}
Here my model, nearly identical as in the book:
import Vapor
import FluentMySQL
final class Acronym: Codable{
var id: Int?
var short: String
var long: String
init(short:String, long:String){
self.short=short
self.long=long
}
static let idKey: IDKey = \.id
}
extension Acronym:MySQLModel {}
extension Acronym:Migration {}
extension Acronym:Content{}
Is there another way to get the Model by Id. Is this an typo in the book or an old implementation or I have an error in some part of the code.
Thanks
Arnold