小编Ale*_*nov的帖子

`minLength: 1` 是否暗示 OpenAPI 规范中需要?

考虑这个 OAS3 规范 ( testMinMax3.yaml):

openapi: 3.0.1
info:
  title: OpenAPI Test
  description: Test
  license:
    name: Apache-2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: 1.0.0
servers:
- url: http://localhost:9999/v2
paths:
  /ping:
    post:
      summary: test
      description: test it
      operationId: pingOp
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SomeObj'
        required: true
      responses:
        200:
          description: OK
          content: {}
components:
  schemas:
    SomeObj:
      type: string
      minLength: 1
      maxLength: 3
Run Code Online (Sandbox Code Playgroud)

非空(又名minLength: 1)是否意味着required即使未根据 openapi 规范 (1) 设置字段?或者仅当用户提供该字段的值时才适用(2)?

swagger openapi

13
推荐指数
1
解决办法
6797
查看次数

如何在 Terraform 中传递凭据?

我有两个选项可以将凭据传递给 terraform 提供商:

  1. 设置 ENV 变量,如FOO_PROVIDER_USERNAME& FOO_PROVIDER_PASSWORD。更新:并从提供者源代码中的 ENV 读取它们,这样*.tf文件中就没有用户名/密码变量。
  2. 在提供程序中显式设置它:
provider "foocloud" {
  username = "admin@foocloud.org"
  password = "coolpass"
}
Run Code Online (Sandbox Code Playgroud)

我应该选择#1 还是#2?我对#2 的担忧是这些用户名/密码可能会保存到状态文件中,这是一个安全问题。

terraform

5
推荐指数
1
解决办法
7531
查看次数

标签 统计

openapi ×1

swagger ×1

terraform ×1