Package com.evolveum.midpoint.rest.impl
Class RestConfig
java.lang.Object
com.evolveum.midpoint.rest.impl.RestConfig
- All Implemented Interfaces:
- org.springframework.web.servlet.config.annotation.WebMvcConfigurer
@Configuration
@ComponentScan
public class RestConfig
extends Object
implements org.springframework.web.servlet.config.annotation.WebMvcConfigurer
Spring configuration for MVC-based REST service.
 This prepares needed XML/JSON/YAML message converters.
 It also drives the package scan for REST controllers under this package.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidconfigureContentNegotiation(@NotNull org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer configurer) Registers content-types for path extension and request parameter usage.voidextendMessageConverters(List<org.springframework.http.converter.HttpMessageConverter<?>> converters) All beans above will be first in the converter list and other Spring converters will be available as well.jsonConverter(PrismContext prismContext, LocalizationService localizationService) xmlConverter(PrismContext prismContext, LocalizationService localizationService) yamlConverter(PrismContext prismContext, LocalizationService localizationService) Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.web.servlet.config.annotation.WebMvcConfigureraddArgumentResolvers, addCorsMappings, addFormatters, addInterceptors, addResourceHandlers, addReturnValueHandlers, addViewControllers, configureAsyncSupport, configureDefaultServletHandling, configureHandlerExceptionResolvers, configureMessageConverters, configurePathMatch, configureViewResolvers, extendHandlerExceptionResolvers, getMessageCodesResolver, getValidator
- 
Constructor Details- 
RestConfigpublic RestConfig()
 
- 
- 
Method Details- 
configureContentNegotiationpublic void configureContentNegotiation(@NotNull @NotNull org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer configurer) Registers content-types for path extension and request parameter usage. Not needed for header-based content negotiation and midPoint typically doesn't use this, but it doesn't hurt and may be handy for download URLs.- Specified by:
- configureContentNegotiationin interface- org.springframework.web.servlet.config.annotation.WebMvcConfigurer
 
- 
yamlConverter@Bean public MidpointYamlHttpMessageConverter yamlConverter(PrismContext prismContext, LocalizationService localizationService) 
- 
xmlConverter@Bean public MidpointXmlHttpMessageConverter xmlConverter(PrismContext prismContext, LocalizationService localizationService) 
- 
jsonConverter@Bean public MidpointJsonHttpMessageConverter jsonConverter(PrismContext prismContext, LocalizationService localizationService) 
- 
extendMessageConverterspublic void extendMessageConverters(List<org.springframework.http.converter.HttpMessageConverter<?>> converters) All beans above will be first in the converter list and other Spring converters will be available as well. We want to add "catch-all" converter for cases like error output for any (even unsupported) content type.- Specified by:
- extendMessageConvertersin interface- org.springframework.web.servlet.config.annotation.WebMvcConfigurer
 
 
-