Closed mktecson closed 8 years ago
need more of the error than what you provided. the nested exception will be the real interesting one.
When i run PersonTypeApiTest, method testPersonTypePost() gets a 400 error. MissingServletRequestParameterException: Required PersonType parameter 'type' is not present
This is the response body when i try it from the swagger UI { "timestamp": 1460488734174, "status": 400, "error": "Bad Request", "exception": "org.springframework.web.bind.MissingServletRequestParameterException", "message": "Required PersonType parameter 'type' is not present", "path": "/api/v1/persontype" }
@rob2885 is it supposed to be @RequestBody PersonType type or @RequestBody() PersonType type. Either way. the API test works. just in the swagger getting some errors.
So @requestbody seems to work for me. The error now is
java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed
Removing the readonly=true from the @Transactional annotation should fix that.
Ok.. next error is now:
java.lang.NullPointerException: null
at org.spring2885.server.db.model.PersonTypeConverter$JsonToDbConverter.apply(PersonTypeConverter.java:37) ~[classes/:na]
at org.spring2885.server.api.PersonTypeApi.post(PersonTypeApi.java:105) ~[classes/:na]
and now it works.. I posted this:
{
"name": "staff"
}
I went ahead and just fixed it and merged it. Please look at my last commit to see what I changed.
Thanks rob. Will look over your commit right now. Im gonna go ahead and look for bugs.
@rob2885 i fixed the Api to accept a Request body of PersonType. I changed the POST test too. It succeeds. But when i run the server and go to localhost:8888 and go to the PersonTypeApi, when i try a post i am getting a 500 error.
Internal Server Error "message": "could not execute statement; nested exception is org.hibernate.exception.GenericJDBCException: could not execute statement"
I also try putting in the example value from swagger. and i get a 400 bad request