[SOLVED] DTOs - do we keep schemas or generated classes in the source tree?

Many bindings which communicate with an external web API keep the representation of the API as (possibly hand-written) DTOs in the main source tree. For example my pushbullet and sensebox bindings, but there are many more of them. On the other hand, there are usually schemata available for these APIs, often offered by the external service.

I’d like to generate those classes (at least on my bindings) so I keep just the schema in src/main/resources/whatever, either http://www.jsonschema2pojo.org/ or http://www.mojohaus.org/jaxb2-maven-plugin/ , depending on which language the schema is offered.

Is this acceptable for the development community? I know @Kai wants developers to be able to be able to start working immediately after cloning, but I having developers do work that is much easier done by the build system sounds strange to me. Also, this would reduce the lines of code to review, which would make @David_Graeff happier I guess :slight_smile:

As all projects are now Maven projects (and m2e-enabled in Eclipse), I would reckon that the project can be configured in a way so that the project builders automatically do this generation step after importing the project in the workspace. I am not sure, if this is the case for different IDEs though (now that many are also looking into e.v. VS Code as an IDE). If yes, I don’t see a reason against it. But I hope we all agree that we should not end up with IDE setups, which show compilation errors on projects.

Cool. I’ll set up my branch, and import that project via a clean Eclipse installation too. Let’s see how good the integration is :smile:

Of course. Usually, the IDE works a bit and generates the sources. All I can imagine would be that the developer has to “build” once.