Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build plugin options to configure the Jackson annotations on the generated DTO classes. #9

Closed
ermadmi78 opened this issue Oct 2, 2021 · 4 comments · Fixed by #11
Closed
Assignees

Comments

@ermadmi78
Copy link
Owner

There is currently only one build option for generating Jackson annotations. Let expand Gradle and Maven options to provide more abilities to configure Jackson annotations.

Gradle:

kobby {
    kotlin {
        dto {
            jackson {
                // Is Jackson annotations generation enabled
                // By default `true` if `com.fasterxml.jackson.core:jackson-annotations`
                // artifact is in the project dependencies
                enabled = true
            }
        }
    }
}

The Gradle jackson section is defined in KobbyKotlinDtoJacksonExtension class. See source code here

Maven:

    <build>
        <plugins>
            <plugin>
                <groupId>io.github.ermadmi78</groupId>
                <artifactId>kobby-maven-plugin</artifactId>
                <version>1.1.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate-kotlin</goal>
                        </goals>
                        <configuration>
                            <kotlin>
                                <dto>
                                    <jackson>
                                        <!-- Is Jackson annotations generation enabled -->
                                        <!-- By default `true` if `com.fasterxml.jackson.core:jackson-annotations` -->
                                        <!-- artifact is in the project dependencies -->
                                        <enabled>true</enabled>
                                    </jackson>
                                </dto>
                            </kotlin>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

The Maven jackson section is defined in KotlinDtoJacksonConfig class. See source code here

@lewisenator
Copy link
Contributor

Thanks for the instructions. I opened a pull request for these changes here. Feedback welcome.

@ermadmi78
Copy link
Owner Author

ermadmi78 commented Oct 6, 2021

@lewisenator, Great job, thank you!
I have merged you pull request to main branch. I can publish a release with your improvements this weekend or wait for the Builder Issue. How will you be more comfortable?

@lewisenator
Copy link
Contributor

lewisenator commented Oct 6, 2021

@ermadmi78 It's fine to wait until the builder issue is resolved to publish the next release. Thanks.

@ermadmi78
Copy link
Owner Author

Available since release 1.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants