OpenAPITools / OpenAPITools/openapi-generator

[REQ] [Spring] Add AOT hints registrar generation for DTOs

Open
#15,458 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Is your feature request related to a problem? Please describe.

Spring Boot 3 got support for Native image builds, but it required DTO's to be registered for reflection, so classes will be accessible by Jackson when running in native mode.

Describe the solution you'd like

Add additional flat, like "aotHintsEnabled", so openapi generator will create HintsRegistrar with reflection registration for all DTOs, which later can be imported into app, where it is going to be used.

Describe alternatives you've considered

Alternatively you need to list all classes in every app you wan't to use it, instead of importing just HintsRegistrar from library with generated sources;

Additional context

I already basic support in my private fork, and can help to work on this feature.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, entry points, or tests are named. Start by locating the Spring generator's options, templates, and DTO generation path, then check how generated sources are tested. Done means an AOT-hints option generates a HintsRegistrar that registers all DTOs for reflection and can be imported by a native Spring Boot application.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
backend, build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.