swagger-api / swagger-api/swagger-codegen

[Question]: swagger-codegen-maven-plugin jakarta.annotation and booleanGetterPrefix

Open
#12,681 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Question

How to configure swagger-codegen-maven-plugin 3.0.76 to generate only @jakarta.annotation.Nonnull annotations on fields instead of @NotNull validation annotations? I want Jakarta annotation without bean validation.

Second question:
How to use booleanGetterPrefix?. For now this parameter doesnt work

Is that an option?

        <plugin>
            <groupId>io.swagger.codegen.v3</groupId>
            <artifactId>swagger-codegen-maven-plugin</artifactId>
            <version>3.0.76</version>
            <executions>
                <execution>
                    <id>generate-allegro-api</id>
                    <configuration>
                        <inputSpec>${project.basedir}/src/main/resources/allegro/allegro-swagger.yaml</inputSpec>
                        <language>spring</language>
                        <output>${project.basedir}</output>
                        <modelPackage>com.allegroclient.model</modelPackage>
                        <generateSupportingFiles>false</generateSupportingFiles>
                        <generateApis>false</generateApis>
                        <generateModelDocumentation>false</generateModelDocumentation>
                        <generateModelTests>false</generateModelTests>
                        <configOptions>
                            <sourceFolder>src/main/java</sourceFolder>
                            <useJakartaEe>true</useJakartaEe>
                            <jakarta>true</jakarta>
                            <hideGenerationTimestamp>true</hideGenerationTimestamp>

                            <openApiNullable>true</openApiNullable>
                            <useBeanValidation>true</useBeanValidation>


                           
                            <booleanGetterPrefix>get</booleanGetterPrefix>
                        </configOptions>
                    </configuration>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

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

Reproduce the configuration with swagger-codegen-maven-plugin 3.0.76, using the shown useJakartaEe, jakarta, useBeanValidation, and booleanGetterPrefix options. Inspect the generated Java annotations and boolean getter names to compare them with the requested behavior. Done means determining whether these options are supported and identifying the relevant configuration or template change.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.