I am trying to design a RESTFul API. My model is like that:
VesselVisit // Parent object
Property1
Property2
Stages[] // Array of Stage type
And I would like to implement a POST method like this:
/VesselVisit/{vvId}/Stage/Track:
My understanding is I have to pass into body two parameters, vvId and a Stage object. This is my swagger specification:
/VesselVisit/{vvId}/Stage:
post:
tags:
- Stage
summary: Add a new stage to vessel visit
operationId: addStage
consumes:
- application/json
- application/xml
produces:
- application/json
- application/xml
parameters:
- in: body
name: body
description: Stage object that needs to be added to the vesselVisit
required: true
schema:
$ref: '#/definitions/Stage'
responses:
405:
description: Invalid input
I am able to send the Stage object, but I want to post it in a specific VesselVisit (parent object), how I can specify this second parameter vvId?