考虑这个 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)?
我有两个选项可以将凭据传递给 terraform 提供商:
FOO_PROVIDER_USERNAME
& FOO_PROVIDER_PASSWORD
。更新:并从提供者源代码中的 ENV 读取它们,这样*.tf
文件中就没有用户名/密码变量。provider "foocloud" {
username = "admin@foocloud.org"
password = "coolpass"
}
Run Code Online (Sandbox Code Playgroud)
我应该选择#1 还是#2?我对#2 的担忧是这些用户名/密码可能会保存到状态文件中,这是一个安全问题。