小编frd*_*rdr的帖子

openApi 模式中不区分大小写的字符串参数

我有一个带有如下参数的开放 API 规范: 

- name: platform
  in: query
  description: "Platform of the application"
  required: true
  schema:
    type: string
    enum:
      - "desktop"
      - "online"
Run Code Online (Sandbox Code Playgroud)

当我从 URL 获取“平台”参数时,它可以是这样的:

platform=online or 
platform=ONLINE or 
platform=Online or 
platform=onLine  or ... any other format
Run Code Online (Sandbox Code Playgroud)

但是当我要使用它时,它仅在参数全部为小写时才有效,例如"platform=online",显然要匹配枚举值。

如何使模式不区分大小写并理解所有类型的传递参数?

enums openapi

10
推荐指数
1
解决办法
3175
查看次数

如何解决Maven Invoker API警告:Maven将以交互模式执行,但尚未配置输入流

我有一个使用 MavenInvokerAPI 调用 Maven 运行的插件。一切工作正常,但我的 Maven 控制台输出中确实有此警告。

[WARN] Maven will be executed in interactive mode, but no input stream has been configured for this MavenInvoker instance.
Run Code Online (Sandbox Code Playgroud)

我在构建过程中不需要交互,并且根据 Javadoc setInputStream(),我将我设置inputStreamnull,但我再次收到此警告:

   /**
     * Sets the input stream used to provide input for the invoked Maven build. This is in particular useful when
     * invoking Maven in interactive mode.
     * 
     * @param inputStream The input stream used to provide input for the invoked Maven build, may be <code>null</code> …
Run Code Online (Sandbox Code Playgroud)

java maven-plugin maven maven-invoker-plugin

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