admin管理员组

文章数量:1394544

I am working with OpenAPI version 7.0.1 and I have some behavior I don't understand.

When I try to map the type of my schema multi value map to Spring multi value map it does not work, I guess because OpenAPI map my multi value map to Java map.

I used schema mapping and I was able to get the result I wanted, the problem is that when I try to tell OpenAPI to import the multi value map it does not recognize my import mapping.

I did import mapping to another object and it worked as expected, I guess it was because in the previous object I used type mapping instead of schema mapping.

This is my pom.xml, as you can see I tried diffrent ways to use multi value map:

<typeMappings>
    <typeMapping>string+binary=ResponseBodyEmitter</typeMapping>
    <typeMapping>object+array=MultiValueMap</typeMapping>
    <typeMapping>#/components/schemas/MultiValueMapStringString=MultiValueMap</typeMapping>
</typeMappings>
<schemaMappings>
    <schemaMapping>MultiValueMapStringString=.springframework.util.MultiValueMap</schemaMapping>
</schemaMappings>
<importMappings>
    <importMapping>ResponseBodyEmitter=.springframework.web.servlet.mvc.method.annotation.ResponseBodyEmitter</importMapping>
    <importMapping>MultiValueMap=.springframework.web.servlet.mvc.method.annotation.ResponseBodyEmitter</importMapping>
</importMappings>

This is my multi value map schema:

MultiValueMapStringString:
  type: object
  additionalProperties:
    type: array
    items:
      type: string

Does anyone know how OpenAPI work with the import mapping?

本文标签: javaOpenAPI does not recognize my import mapping in Spring BootStack Overflow