小编J. *_*fer的帖子

OpenAPI CodeGen for Spring-Webflux / Mono 或 Flux 对象作为返回

最新版本的 OpenApi Codegen(及其 Maven 插件)能够/应该能够使用 Webflux/Reative 返回对象(例如 Mono 或 Flux 对象)为 spring maven 自动生成接口。然而,我认为无法让它发挥作用。这些是我的 pom.xml 的摘录:

    <plugin>
        <groupId>io.swagger</groupId>
        <artifactId>swagger-codegen-maven-plugin</artifactId>
        <version>${swagger.codegen.version}</version>
        <executions>
        <!-- AUTHENTICATION-API -->
            <execution>
              <id>authentication-api</id>
              <goals>
                <goal>generate</goal>
              </goals>
              <configuration>
                <inputSpec>src/main/resources/swagger/authentication.yaml</inputSpec>
                <language>spring</language>
                <configOptions>
                  <sourceFolder>src/main/java</sourceFolder>
                    <library>spring-boot</library>
                    <!-- <async>true</async> -->
                    <reactive>true</reactive>
                    <dateLibrary>java8</dateLibrary>
                    <useTags>true</useTags>
                    <apiPackage>${project.groupId}.api</apiPackage>
                    <modelPackage>${project.groupId}.model</modelPackage>
                    <interfaceOnly>true</interfaceOnly>
                </configOptions>
              </configuration>
            </execution>
         </executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)

这些是authentication.yaml和生成的接口的摘录

身份验证.yaml

paths:
  /dotcmsAuthentication:
    get:
      tags:
        - authentication
        - dotCMS
      description: Returns dotCMS json with JWT Token.
      operationId: getDotcmsAuthentication
      produces:
        - application/json
      consumes:
        - application/json
      parameters:
        - name: DotcmsAuthentication
      in: header …
Run Code Online (Sandbox Code Playgroud)

java mono spring openapi reactive

6
推荐指数
0
解决办法
1万
查看次数

标签 统计

java ×1

mono ×1

openapi ×1

reactive ×1

spring ×1