Skip to content

Commit

Permalink
public.json: Add 'POST /drops' to create a new drop
Browse files Browse the repository at this point in the history
The posted data should match the usual 'drop' schema except that you
shouldn't be setting the 'id' property.  I haven't been able to figure
out a reasonable Swagger syntax for that though [1].

[1]: https://groups.google.com/d/msg/swagger-swaggersocket/i7EEXw_MQZ8/wcXXsQa2CYAJ
     From: "W. Trevor King" <wking@tremily.us>
     To: swagger-swaggersocket@googlegroups.com
     Subject: Requiring pet.id but disallowing newPet.id (was: Altering a model)
     Date: Fri, 19 Dec 2014 14:16:04 -0800
     Message-ID: <20141219221604.GF19920@odin.tremily.us>
  • Loading branch information
wking committed Dec 19, 2014
1 parent b6f295a commit 03e139a
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions public.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,41 @@
}
}
}
},
"post": {
"summary": "Create a new drop",
"operationId": "addDrop",
"tags": [
"drop"
],
"parameters": [
{
"name": "drop",
"in": "body",
"description": "Drop to add",
"required": true,
"schema": {
"$ref": "#/definitions/newDrop"
}
}
],
"responses": {
"200": {
"description": "drop response",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/drop"
}
}
},
"default": {
"description": "unexpected error",
"schema": {
"$ref": "#/definitions/errorModel"
}
}
}
}
},
"/drop/{id}": {
Expand Down Expand Up @@ -974,6 +1009,9 @@
"members"
]
},
"newDrop": {
"$ref": "drop"
},
"dropFees": {
"description": "additional costs for members receiving at a drop",
"type": "object",
Expand Down

0 comments on commit 03e139a

Please sign in to comment.