Closed Akron closed 6 years ago
The error is coming from OpenAPI's validation of the response. There's no ID on the row, so when the data is posted, it can't be retrieved by ID. You likely need to change SERIAL
to ROWID
.
We could make this error message easier by adding an explicit exception if no ID can be computed for the newly-inserted row.
Okay, I've re-created your schema, but the problem isn't what I said it was. I'm going to have to look closer.
Thanks for investigating! I followed the recipe in Yancy::Backend::Sqlite
for the SQL schema. So in case it's wrong, it probably needs to be changed there as well.
Looks like the correct way to access the rowid
special field in SQLite is to make a column of type INTEGER PRIMARY KEY
. I've fixed the docs in the Yancy::Backend::Sqlite appropriately.
Thanks for the detailed reproduction case!
I wrote a small example application with Mojo::SQLite, that follows pretty much the Yancy standard receipt:
When posting the object to
/yancy/api/people
in 0.017 (replicating the editor behaviour), the server status is 500 and the response is{"errors":[{"message":"Expected object - got null.","path":"\/"}],"status":500}
. However, the data is correctly stored and can be retrieved. Am I doing something wrong?