Class ApiVersionConfiguration

java.lang.Object
nl.b3p.planmonitorwonen.api.configuration.ApiVersionConfiguration
All Implemented Interfaces:
org.springframework.web.servlet.config.annotation.WebMvcConfigurer

@Configuration public class ApiVersionConfiguration extends Object implements org.springframework.web.servlet.config.annotation.WebMvcConfigurer
Versioning of the API. The major version is a path segment after the base path: /api/planmonitor-wonen/v2/planregistraties. A new major version means backwards-incompatible changes. The full version (major.minor, the minor version is increased for backwards-compatible additions) is in the "API-Version" response header and the OpenAPI documentation, which also describes this policy (see OpenApiConfiguration).

The API version is separate from the version of the application. It starts at 2 because version 1 is the unversioned API used by earlier releases.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Major version as used in the version attribute of the request mappings.
    static final String
     
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addInterceptors(org.springframework.web.servlet.config.annotation.InterceptorRegistry registry)
     
    void
    configureApiVersioning(org.springframework.web.servlet.config.annotation.ApiVersionConfigurer configurer)
     

    Methods inherited from class 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, addResourceHandlers, addReturnValueHandlers, addViewControllers, configureAsyncSupport, configureContentNegotiation, configureDefaultServletHandling, configureHandlerExceptionResolvers, configureMessageConverters, configureMessageConverters, configurePathMatch, configureViewResolvers, extendHandlerExceptionResolvers, extendMessageConverters, getMessageCodesResolver, getValidator
  • Field Details

    • MAJOR_VERSION

      public static final String MAJOR_VERSION
      Major version as used in the version attribute of the request mappings. The version parser ignores the "v", but springdoc puts it in the paths of the OpenAPI documentation as is.
      See Also:
    • VERSION

      public static final String VERSION
      See Also:
    • VERSION_HEADER

      public static final String VERSION_HEADER
      See Also:
  • Constructor Details

    • ApiVersionConfiguration

      public ApiVersionConfiguration(@Value("${planmonitor-wonen-api.base-path}") String basePath)
  • Method Details

    • configureApiVersioning

      public void configureApiVersioning(org.springframework.web.servlet.config.annotation.ApiVersionConfigurer configurer)
      Specified by:
      configureApiVersioning in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer
    • addInterceptors

      public void addInterceptors(org.springframework.web.servlet.config.annotation.InterceptorRegistry registry)
      Specified by:
      addInterceptors in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer