多个ID下的嵌套PUT

时间:2019-06-19 14:49:02

标签: javascript node.js api swagger

运行带有ID的多个模拟,这些模拟也将ID归类为PUT信息(建筑物)到API。我该如何在其内部发布带有ID的模拟中放置带有其ID的“建筑物”。

我使用了/ simulation / {id},它通过id来模拟。然后,对于PUT变量,我还使用/ building / {id}声明一栋建筑物,并通过id声明哪一栋建筑物。

/sim_launch/{sim_id}:
    put:
      operationId: "putLaunchById"
      parameters: 
      - name: "sim_id"
        in: "path"
        description: "Id of launch simulation"
        required: true
        type: "string"
      - in: "body"
        name: "sim_launch"
        description: "The ID of the vehicle to return"
        schema:
          $ref: '#/definitions/launch'
      responses:
        201:
          description: "Note was correctly created"
        400:
          description: "bad input parameter"enter code here

  /building/{id}:
    put:
      operationId: "postBuilidingById"
      parameters:
      - name: "id"
        in: "path"
        description: "id of building simulation"
        required: true
        type: "string"
      - in: "body"
        name: "building_array"
        description: "building array holder"
        schema:
          $ref: '#/definitions/building'
      responses:
        201:
          description: "Note was correctly created"
        400:
          description: "bad input parameter"

0 个答案:

没有答案