[英]Reading yaml file with refrence in python
演示文件
content:
application/json:
schema:
title: YamlTitle
type: object
properties:
name:
"$ref": "definitions.yaml#/name"
required:
- data
definition.yaml文件数据
name:
type: string
minLength: 10
example: GANESH
我想读取带有参考数据的 yaml 文件。
输出结果 = {'content': {'application/json': {'schema': {'title': 'YamlTitle', 'type': 'object', 'properties': {'name': {'type' : 'string', 'minLength': 10, 'example': 'GANESH'}}, 'required': ['name']}}}}
您可以使用自定义构造函数和 yaml 加载程序来实现它,您可以在其中添加一条可以完成此操作的 YAML 指令。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.