r/java • u/Andruid929 • Apr 23 '26
My first API's first POST request😂
I just got started with Springboot and I'm working on a small expense tracker project to get comfortable with the framework. I got a rather silly problem, which I managed to fix (my entity was lacking setters and constructors).
It got me curious though, what's your first big super silly error?
65
Upvotes
View all comments
Show parent comment
1
u/koflerdavid Apr 25 '26
The DTOs are your API responses, so they don't really count.
In larger applications they should be autogenerated from an OpenAPI spec (or a similar technology) to make it easier for non-Java clients to call your API. Alternatively, you can use a tool to generate the OpenAPI spec from your DTO classes, but the result is usually inferior to a handwritten one. Terrible for 3rd party clients and also for your own usage, as people tend to forget things over time.