Class YamlMessageConverterConfig

java.lang.Object
edu.ucsb.cs.scaffold.config.YamlMessageConverterConfig
All Implemented Interfaces:
org.springframework.web.servlet.config.annotation.WebMvcConfigurer

@Configuration public class YamlMessageConverterConfig extends Object implements org.springframework.web.servlet.config.annotation.WebMvcConfigurer
Registers a YAML HttpMessageConverter so that endpoints can accept application/yaml request bodies (e.g. POST /api/concept). YAML block scalars make multi-line Markdown fields far easier to enter through Swagger than JSON's escaped one-line strings.

The converter is read-only (canWrite is false): it only deserializes request bodies. Responses continue to be serialized as JSON by the default converters, even for clients that send Accept: */*.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    extendMessageConverters(List<org.springframework.http.converter.HttpMessageConverter<?>> converters)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer

    addArgumentResolvers, addCorsMappings, addErrorResponseInterceptors, addFormatters, addInterceptors, addResourceHandlers, addReturnValueHandlers, addViewControllers, configureAsyncSupport, configureContentNegotiation, configureDefaultServletHandling, configureHandlerExceptionResolvers, configureMessageConverters, configurePathMatch, configureViewResolvers, extendHandlerExceptionResolvers, getMessageCodesResolver, getValidator
  • Constructor Details

    • YamlMessageConverterConfig

      public YamlMessageConverterConfig()
  • Method Details

    • extendMessageConverters

      public void extendMessageConverters(List<org.springframework.http.converter.HttpMessageConverter<?>> converters)
      Specified by:
      extendMessageConverters in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer