Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/elixir/2.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
Swagger 如何在OpenAPIyml中的映射对象中定义多个对象时间_Swagger_Swagger Ui_Openapi_Swagger 2.0_Swagger Editor - Fatal编程技术网

Swagger 如何在OpenAPIyml中的映射对象中定义多个对象时间

Swagger 如何在OpenAPIyml中的映射对象中定义多个对象时间,swagger,swagger-ui,openapi,swagger-2.0,swagger-editor,Swagger,Swagger Ui,Openapi,Swagger 2.0,Swagger Editor,我是openapi的新手。我需要一些帮助来编写OpenAPIyml3.0 对于以下响应格式 { “Details”: { “detail1”: [ { "id": “idvalue”1, “Info”: { “Testinfo1”: "1.0.0", “Testinf

我是openapi的新手。我需要一些帮助来编写OpenAPIyml3.0

对于以下响应格式

{
    “Details”: {
        “detail1”: [
            {
                "id": “idvalue”1,
                “Info”: {
                    “Testinfo1”: "1.0.0",
                    “Testinfo2”: "2.0.0"
                }
            }
        ],
        “Detail2”: [
            {
                "id": “idvalue2”,
                “Info”: {
                    “Testinfo3”: "1.0.0",
                    “Testinfo4”: "2.0.0"                }
            }
        ],
        "Detail3”: [
            {
                “First name”: “firstName,
                “Lastname: “last”Name,
                “Address”: “address”,
                “Dependents”: []
            }
        ]
    },
    "links": {
        "self": {
            "href": “some url”
        }
    }
}
detail1、detail2、detail3可以是不同的对象类型,也可以是相同的对象类型 而且可能没有任何细节。 我被以下几点打动了

  • 如何表示MapOpenAPI
  • 如何在地图中表示多个对象类型

  • 检查下面的YAML snap

    DetailsSchemaElement:
      type: object
      properties:
        Details:
          type: object
          properties:
            detail1:
              type: array
              items:
                properties:
                  id:
                    type: string
                  Info:
                    type: object
                    properties:
                      Testinfo1:
                        type: string
                      Testinfo2:
                        type: string
            Detail2:
              type: array
              items:
                properties:
                  id:
                    type: string
                  Info:
                    type: object
                    properties:
                      Testinfo4:
                        type: string
                      Testinfo3:
                        type: string
            Detail3:
              type: array
              items:
                properties:
                  First-name:
                    type: string
                  Address:
                    type: string
                  Dependents:
                    type: array
                    items:
                      type: string
                  Lastname:
                    type: string
        links:
          type: object
          properties:
            self:
              type: object
              properties:
                href:
                  type: string
    

    检查下面的YAML snap

    DetailsSchemaElement:
      type: object
      properties:
        Details:
          type: object
          properties:
            detail1:
              type: array
              items:
                properties:
                  id:
                    type: string
                  Info:
                    type: object
                    properties:
                      Testinfo1:
                        type: string
                      Testinfo2:
                        type: string
            Detail2:
              type: array
              items:
                properties:
                  id:
                    type: string
                  Info:
                    type: object
                    properties:
                      Testinfo4:
                        type: string
                      Testinfo3:
                        type: string
            Detail3:
              type: array
              items:
                properties:
                  First-name:
                    type: string
                  Address:
                    type: string
                  Dependents:
                    type: array
                    items:
                      type: string
                  Lastname:
                    type: string
        links:
          type: object
          properties:
            self:
              type: object
              properties:
                href:
                  type: string