Template doesn't work with Vapor 4 RC
Closed this issue · 9 comments
Hello,
The template doesn't seem to work with vapor 4 RC.
The error I get is when calling the "/todo" url: Fatal error: @ID requires UUID, use @ID(custom:) for Int.
.
Here's the file that should be fixed: https://github.com/vapor/api-template/blob/4/Sources/App/Models/Todo.swift
According to the documentation, I believe it should be @ID(key: .id)
, and ID should be of UUID type
I don't need support on this as I figured it out myself.
CreateTodo should also create an UUID table
I'd open a PR but I'm not sure that this is the right fix. If you want me to do it, I'd be happy to.
@abarisain I think the API template will be deprecated in favour of vapor/template, which works with the new toolbox. (Again that needs to be fixed with the same issue).
@tanner0101 are API/web and auth disappearing?
Oh, I used the latest beta toolbox and I ended up with this template, so did I get the wrong repo?
What command did you use with vapor-beta
? I've just merged a PR to fix that template so
vapor-beta new MyApp
Should work
I used this command, but ~24hours ago
Try now, it should be fixed with the PR I merged
As @0xTim said, vapor-beta
is the preferred way to generate new Vapor 4 projects. This is what the docs recommend.
I will still fix API template though since lots of examples out there still use that.
This has been fixed now 👍
Thanks!
I did use vapor-beta but I must have found the wrong repo to report the issue on, sorry. Anyway I'll check it out by updating the cli but it looks good
Just for posterity, the template used by the new toolbox is https://github.com/vapor/template/