generated from pagopa/template-java-spring-microservice
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
42b641f
commit 17dd135
Showing
6 changed files
with
71 additions
and
11 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
src/main/java/it/gov/pagopa/bizeventsservice/config/ContentNegotiationConf.java
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,25 @@ | ||
package it.gov.pagopa.bizeventsservice.config; | ||
|
||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.http.MediaType; | ||
import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer; | ||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | ||
|
||
/** | ||
* This configuration is required ignore the 'accept' header in the request. | ||
* If the client uses a different value of the response then SpringBoot goes wrong because the response type doesn't match. | ||
* We can ignore the accept header from the client. | ||
* <p> | ||
* see more information in this GitHub <a href="https://github.com/swagger-api/swagger-ui/issues/5649">issue</a> | ||
*/ | ||
// TODO should I remove this configuration? | ||
@Configuration | ||
public class ContentNegotiationConf implements WebMvcConfigurer { | ||
|
||
@Override | ||
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) { | ||
configurer | ||
.ignoreAcceptHeader(true) | ||
.defaultContentType(MediaType.ALL); | ||
} | ||
} |
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
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
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