I'm trying out the new API Versioning for Spring Framework 7 and using the 'media-type-parameter' with YAML config that seems to have a problem parsing it.

I tried

spring:
  mvc:
    apiversion:
      use:
        media-type-parameter:
          'application/json': version

and

spring:
  mvc:
    apiversion:
      use:
        media-type-parameter:
          [application/json]: version

but the parsing seems to be dropping the forward slash as the error message during initialization is:

Description:

Failed to bind properties under 'spring.mvc.apiversion.use.media-type-parameter' to java.util.Map<org.springframework.http.MediaType, java.lang.String>:

    Reason: failed to convert java.lang.String to org.springframework.http.MediaType (caused by org.springframework.util.InvalidMimeTypeException: Invalid mime type "applicationjson": does not contain '/')

Comment From: j0hnc0yne

Sorry, got this working had to make it

spring:
  mvc:
    apiversion:
      use:
        media-type-parameter:
          '[application/json]': version

This might be worth documenting somewhere, did not see it anywhere unless I missed it