Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Yaml Openapi 3.0:does';allOf';如果架构只有一个属性,是否要求架构的属性?_Yaml_Openapi_Swagger Editor - Fatal编程技术网

Yaml Openapi 3.0:does';allOf';如果架构只有一个属性,是否要求架构的属性?

Yaml Openapi 3.0:does';allOf';如果架构只有一个属性,是否要求架构的属性?,yaml,openapi,swagger-editor,Yaml,Openapi,Swagger Editor,我在openApi 3.0的“组件”部分定义了以下模式: schema1: required: - prop1 - prop2 - prop3 properties: prop1 prop2 prop3 现在有另一个模式对上述两个模式执行“anyOf”操作,如下所示: schema3: anyOf: - $ref: '#/components/schema1' - $ref: '#/c

我在openApi 3.0的“组件”部分定义了以下模式:

schema1:
   required:
      - prop1
      - prop2
      - prop3
   properties:
      prop1
      prop2
      prop3
现在有另一个模式对上述两个模式执行“anyOf”操作,如下所示:

schema3:
   anyOf:
     - $ref: '#/components/schema1'
     - $ref: '#/components/schema2'
我有另一个模式,其中一个属性是

schema4:
   properties:
      prop7
现在我的问题是,如果我在schema5中对schema3和schema4执行allOf,那么属性7会成为必需的属性吗?如果是,那么如何在schema5中保持property7可选

方案5如下:

schema5:
   allOf:
     - $ref: '#/components/schema3'
     - $ref: '#/components/schema4'
该物业7是否会成为必需物业


否-因为
property7
未列在架构中任何位置的
required
列表中。

对于schema5,可能的值是什么?schema1、schema2或schema4或者schema5应该是什么样子?@SamiAkkawi schema5将具有(全部prop1,2,3)或(全部prop4,5,6)以及可选的prop7。
schema5:
   allOf:
     - $ref: '#/components/schema3'
     - $ref: '#/components/schema4'