Chapter 11: Testing - compile err

This line in my UserTests.swift,
let clients = try app.getResponse(to: “(usersURI)(user.id!)/clients”, decodeTo: [Client].self)
gets a compile error "Ambiguous reference to member ‘Client’ referring to the “[Client]” part.

I’ve modeled my app similar to the book’s TILApp and Client is similar to the Acronym class.

Any clues where I should look to resolved this?
Your Chapter 11 final TILApp builds just fine.

Gonzalo

Vapor has it’s own Client type which is probably confusing it. Try changing it to App.Client

That was it! So glad I asked. I’ve been banging my head over this.
I’ll just rename my model to avoid future confusion. THANK YOU!

1 Like