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

jackson-dataformat-xml plugin #3051

Merged
merged 2 commits into from Aug 3, 2019

Conversation

brunomendola
Copy link
Contributor

What's this PR do/fix?

This implements support for jackson-dataformat-xml annotations, based on what has been implemented for Jaxb plugin.

Are there unit tests? If not how should this be manually tested?

Implemented unit tests based on what has been implemented for Jaxb plugin.

Any background context you want to provide?

https://github.com/FasterXML/jackson-dataformat-xml

What are the relevant issues?

#2734

@codecov
Copy link

codecov bot commented Jul 17, 2019

Codecov Report

Merging #3051 into master will increase coverage by 0.01%.
The diff coverage is 86.56%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3051      +/-   ##
============================================
+ Coverage     92.94%   92.95%   +0.01%     
- Complexity     3462     3487      +25     
============================================
  Files           375      379       +4     
  Lines          9214     9273      +59     
  Branches        758      763       +5     
============================================
+ Hits           8564     8620      +56     
  Misses          464      464              
- Partials        186      189       +3
Impacted Files Coverage Δ Complexity Δ
...tation/schema/JaxbPresentInClassPathCondition.java 100% <100%> (+50%) 2 <2> (-1) ⬇️
.../schema/JacksonXmlPresentInClassPathCondition.java 100% <100%> (ø) 2 <2> (?)
...ation/schema/ClassPresentInClassPathCondition.java 50% <50%> (ø) 3 <3> (?)
...tion/schema/property/JacksonXmlPropertyPlugin.java 90% <90%> (ø) 13 <13> (?)
...entation/schema/plugins/JacksonXmlModelPlugin.java 93.33% <93.33%> (ø) 7 <7> (?)
...umentation/spring/web/scanners/ApiModelReader.java 95.46% <0%> (+0.56%) 88% <0%> (+1%) ⬆️

1 similar comment
@codecov
Copy link

codecov bot commented Jul 17, 2019

Codecov Report

Merging #3051 into master will increase coverage by 0.01%.
The diff coverage is 86.56%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3051      +/-   ##
============================================
+ Coverage     92.94%   92.95%   +0.01%     
- Complexity     3462     3487      +25     
============================================
  Files           375      379       +4     
  Lines          9214     9273      +59     
  Branches        758      763       +5     
============================================
+ Hits           8564     8620      +56     
  Misses          464      464              
- Partials        186      189       +3
Impacted Files Coverage Δ Complexity Δ
...tation/schema/JaxbPresentInClassPathCondition.java 100% <100%> (+50%) 2 <2> (-1) ⬇️
.../schema/JacksonXmlPresentInClassPathCondition.java 100% <100%> (ø) 2 <2> (?)
...ation/schema/ClassPresentInClassPathCondition.java 50% <50%> (ø) 3 <3> (?)
...tion/schema/property/JacksonXmlPropertyPlugin.java 90% <90%> (ø) 13 <13> (?)
...entation/schema/plugins/JacksonXmlModelPlugin.java 93.33% <93.33%> (ø) 7 <7> (?)
...umentation/spring/web/scanners/ApiModelReader.java 95.46% <0%> (+0.56%) 88% <0%> (+1%) ⬆️

@brunomendola brunomendola changed the title jackson-dataformat-xml plugin springfox#2734 jackson-dataformat-xml plugin Jul 22, 2019
@dilipkrish dilipkrish added the PR label Aug 3, 2019
@dilipkrish dilipkrish added this to the 3.0 milestone Aug 3, 2019
@dilipkrish
Copy link
Member

Thanks for this fix @brunomendola. A very neat PR!

@dilipkrish dilipkrish merged commit 41adbd3 into springfox:master Aug 3, 2019
@bharatchauhan51
Copy link

@dilipkrish @brunomendola
I was trying to integrate swagger with my springboot application, I was successful with the integration but swagger is not showing the sample request according to the annotations put on the model properties.

I am using the following dependency in the pom file
com.fasterxml.jackson.dataformat jackson-dataformat-xml io.springfox springfox-swagger2 2.9.2 io.springfox springfox-swagger-ui 2.9.2 io.springfox springfox-bean-validators 2.9.2

What I believe is that swagger is not able to identify the objectMapper instance that will provide the correct format of XML. Will someone please help me out. As a reference I am also providing the configuration used for setting up swagger.

`@Configuration
@EnableSwagger2
public class SwaggerConfig {
@bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.basePackage("com.example.demo.controller"))
.paths(PathSelectors.ant("//"))
.build()
.apiInfo(apiDetails());
}

private ApiInfo apiDetails(){
return new ApiInfo(
"asd",
"asda",
"2.0",
"Not Free to use",
new springfox.documentation.service.Contact("Monkey Group","asda","ada@asd.com"),
"API License",
"asdasd",
Collections.emptyList());
}
}`

@brunomendola
Copy link
Contributor Author

Hi @bharatchauhan51. I think this PR has been merged but not released yet. The last release of springfox is from June 2018, the PR is from 2019.
Maybe you could compile the master branch yourself to get the "latest" fixes :)

@bharatchauhan51
Copy link

bharatchauhan51 commented Feb 20, 2020

@brunomendola @dilipkrish Thanks for your response. As adviced I took a clone of the master branch and used the ./gradlew clean build command which resulted in a successful build. The only issue is that I am not able to find the generated jar. As this is the first time Im working with gradle, its tough for me to identify the location the jar.

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

Successfully merging this pull request may close these issues.

None yet

3 participants