跳转到正文

config_schema API ​

完整接口目录 · 配置与密钥用法 · 工具包下载

模块说明 ​

text
Explicit dataclass export and a deliberately small JSON Schema subset.

schema_for_config is an author/build operation, which may evaluate type hints
and default factories. Management tools consume its JSON output and never need
to import or execute plugin code. This is not a general JSON Schema engine.

DIALECT ​

python
DIALECT = 'https://json-schema.org/draft/2020-12/schema'

SECRET_REFERENCE ​

python
SECRET_REFERENCE = re.compile('secret:[A-Za-z][A-Za-z0-9_-]{0,63}\\Z')

check_config_schema ​

python
def check_config_schema(schema)

SDK 说明:

text
Reject unsupported/ambiguous declarations before validating user data.

validate_config ​

python
def validate_config(schema, value)

SDK 说明:

text
Validate pure JSON, return a separate normalized value with defaults.

Secret fields validate references only; credential lookup is a host concern.

schema_for_config ​

python
def schema_for_config(kind)

SDK 说明:

text
Explicitly export an author's dataclass, without any plugin discovery.

Neomega · 使用、开发与参考文档