-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
java-server: Generate ApiJaxbJsonProvider as an abstract class so use…
…rs can modify the implementation without it being overwritten
- Loading branch information
Showing
5 changed files
with
27 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@openapi-generator-plus/java-jaxrs-server-generator": minor | ||
--- | ||
|
||
Generate ApiJaxbJsonProvider as an abstract class so users can modify the implementation without it being overwritten |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
packages/java-jaxrs-server/templates/AbstractApiJaxbJsonProvider.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package {{apiProviderPackage}}; | ||
|
||
{{>generatedAnnotation}} | ||
public abstract class AbstractApiJaxbJsonProvider extends com.fasterxml.jackson.{{#if @root.useJakarta}}jakarta.rs{{else}}jaxrs{{/if}}.json.{{#if @root.useJakarta}}JacksonXmlBindJsonProvider{{else}}JacksonJaxbJsonProvider{{/if}} { | ||
|
||
public AbstractApiJaxbJsonProvider() { | ||
super(); | ||
|
||
this.setMapper(createMapper()); | ||
} | ||
|
||
protected com.fasterxml.jackson.databind.ObjectMapper createMapper() { | ||
{{>frag/jaxbJsonProviderBody}} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters