Tools: Spring CRUD Generator: a YAML/JSON-driven Spring Boot backend generator (version update + stability improvements)

Tools: Spring CRUD Generator: a YAML/JSON-driven Spring Boot backend generator (version update + stability improvements)

Source: Dev.to

Why I built this ## What it can generate ## What improved since v1.0.0 ## Example spec (YAML) ## Quick start ## Feedback welcome If you saw my initial post about Spring CRUD Generator v1.0.0, this is a follow-up with a version update and a more complete overview of what the project is aiming to solve. Spring CRUD Generator is an open-source Maven plugin that generates a Spring Boot backend from a single YAML/JSON spec. The main goal is to reduce repetitive CRUD boilerplate and keep a consistent baseline across projects. Version update: 1.0.2 In most Spring Boot projects, the first few hours (or days) often look the same: Spring CRUD Generator tries to make that “baseline” reproducible from a spec, so you can focus on domain logic instead of wasting your time and concentration writing the same code again and again. Depending on the configuration, it can generate: The initial version proved the concept, but real usage quickly exposed edge cases. Recent releases focus on stability and correctness, especially around: Here is a small example showing the overall idea: This should generate the backend sources and related resources based on your YAML/JSON spec. If you have a few minutes, I’d love feedback on: Templates let you quickly answer FAQs or store snippets for re-use. Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse CODE_BLOCK: configuration: database: postgresql migrationScripts: true errorResponse: MINIMAL openApi: apiSpec: true generateResources: true docker: dockerfile: true dockerCompose: true tests: unit: true dataGenerator: instancio entities: - name: Product storageName: product_table audit: enabled: true type: LocalDate fields: - name: id type: Long id: strategy: IDENTITY - name: name type: String - name: tags type: List<String> Enter fullscreen mode Exit fullscreen mode CODE_BLOCK: configuration: database: postgresql migrationScripts: true errorResponse: MINIMAL openApi: apiSpec: true generateResources: true docker: dockerfile: true dockerCompose: true tests: unit: true dataGenerator: instancio entities: - name: Product storageName: product_table audit: enabled: true type: LocalDate fields: - name: id type: Long id: strategy: IDENTITY - name: name type: String - name: tags type: List<String> CODE_BLOCK: configuration: database: postgresql migrationScripts: true errorResponse: MINIMAL openApi: apiSpec: true generateResources: true docker: dockerfile: true dockerCompose: true tests: unit: true dataGenerator: instancio entities: - name: Product storageName: product_table audit: enabled: true type: LocalDate fields: - name: id type: Long id: strategy: IDENTITY - name: name type: String - name: tags type: List<String> CODE_BLOCK: src/main/resources/crud-generator.yml Enter fullscreen mode Exit fullscreen mode CODE_BLOCK: src/main/resources/crud-generator.yml CODE_BLOCK: src/main/resources/crud-generator.yml CODE_BLOCK: mvn clean install -DskipTests -Pgenerate-resources Enter fullscreen mode Exit fullscreen mode CODE_BLOCK: mvn clean install -DskipTests -Pgenerate-resources CODE_BLOCK: mvn clean install -DskipTests -Pgenerate-resources CODE_BLOCK: https://github.com/mzivkovicdev/spring-crud-generator Enter fullscreen mode Exit fullscreen mode CODE_BLOCK: https://github.com/mzivkovicdev/spring-crud-generator CODE_BLOCK: https://github.com/mzivkovicdev/spring-crud-generator CODE_BLOCK: dev.markozivkovic:spring-crud-generator:1.0.2 Enter fullscreen mode Exit fullscreen mode CODE_BLOCK: dev.markozivkovic:spring-crud-generator:1.0.2 CODE_BLOCK: dev.markozivkovic:spring-crud-generator:1.0.2 - CRUD layers (entity/repo/service/controller) - DTO mapping / mappers - consistent error responses - database migrations (and keeping them in sync) - Docker bits - OpenAPI and resource structures - tests and test data setup - CRUD stack: entities, repositories, services, mappers, REST controllers - Flyway migrations (incremental change detection) - OpenAPI specs + optional resource generation - Dockerfile + docker-compose - Unit tests + test data generation (Instancio/Podam) - Caching (Redis/Caffeine) - OpenAPI generation and schema handling (including optional fields) - ID naming consistency across endpoints and DTOs - improved equals/hashCode generation depending on whether the model is JSON-centric or a table entity - stricter validation so misconfigurations fail fast - Create your spec file, for example: - Configure the Maven plugin (see the repository README) - Run generation - Github repo: - Maven Central artifact: - the spec design (YAML/JSON structure and ergonomics) - what you expect from generated “production baseline” code - edge cases you’d test first