Update API swagger JSON to default to POSTs not PUTs when describing the API.

This commit is contained in:
Kegan Dougal 2014-08-29 14:12:12 +01:00
parent 27047d8f51
commit 339dd3dc6c

View File

@ -14,12 +14,12 @@
}, },
"apis": [ "apis": [
{ {
"path": "/rooms/{roomId}/send/{eventType}/{txnId}", "path": "/rooms/{roomId}/send/{eventType}",
"operations": [ "operations": [
{ {
"method": "PUT", "method": "POST",
"summary": "Send a generic non-state event to this room.", "summary": "Send a generic non-state event to this room.",
"notes": "This operation can also be done as a POST to /rooms/{roomId}/send/{eventType}", "notes": "This operation can also be done as a PUT by suffixing /{txnId}.",
"type": "EventId", "type": "EventId",
"nickname": "send_non_state_event", "nickname": "send_non_state_event",
"consumes": [ "consumes": [
@ -46,13 +46,6 @@
"required": true, "required": true,
"type": "string", "type": "string",
"paramType": "path" "paramType": "path"
},
{
"name": "txnId",
"description": "A client transaction ID to ensure idempotency. This can only be omitted if the HTTP method becomes a POST.",
"required": true,
"type": "string",
"paramType": "path"
} }
] ]
} }
@ -104,12 +97,12 @@
] ]
}, },
{ {
"path": "/rooms/{roomId}/send/m.room.message/{txnId}", "path": "/rooms/{roomId}/send/m.room.message",
"operations": [ "operations": [
{ {
"method": "PUT", "method": "POST",
"summary": "Send a message in this room.", "summary": "Send a message in this room.",
"notes": "This operation can also be done as a POST to /rooms/{roomId}/send/m.room.message", "notes": "This operation can also be done as a PUT by suffixing /{txnId}.",
"type": "EventId", "type": "EventId",
"nickname": "send_message", "nickname": "send_message",
"consumes": [ "consumes": [
@ -129,13 +122,6 @@
"required": true, "required": true,
"type": "string", "type": "string",
"paramType": "path" "paramType": "path"
},
{
"name": "txnId",
"description": "A client transaction ID to ensure idempotency. This can only be omitted if the HTTP method becomes a POST.",
"required": true,
"type": "string",
"paramType": "path"
} }
] ]
} }
@ -195,12 +181,12 @@
] ]
}, },
{ {
"path": "/rooms/{roomId}/send/m.room.message.feedback/{txnId}", "path": "/rooms/{roomId}/send/m.room.message.feedback",
"operations": [ "operations": [
{ {
"method": "PUT", "method": "POST",
"summary": "Send feedback to a message.", "summary": "Send feedback to a message.",
"notes": "This operation can also be done as a POST to /rooms/{roomId}/send/m.room.message.feedback", "notes": "This operation can also be done as a PUT by suffixing /{txnId}.",
"type": "EventId", "type": "EventId",
"nickname": "send_feedback", "nickname": "send_feedback",
"consumes": [ "consumes": [
@ -220,13 +206,6 @@
"required": true, "required": true,
"type": "string", "type": "string",
"paramType": "path" "paramType": "path"
},
{
"name": "txnId",
"description": "A client transaction ID to ensure idempotency. This can only be omitted if the HTTP method becomes a POST.",
"required": true,
"type": "string",
"paramType": "path"
} }
], ],
"responseMessages": [ "responseMessages": [
@ -239,12 +218,12 @@
] ]
}, },
{ {
"path": "/rooms/{roomId}/invite/{txnId}", "path": "/rooms/{roomId}/invite",
"operations": [ "operations": [
{ {
"method": "PUT", "method": "POST",
"summary": "Invite a user to this room.", "summary": "Invite a user to this room.",
"notes": "This operation can also be done as a POST to /rooms/{roomId}/invite", "notes": "This operation can also be done as a PUT by suffixing /{txnId}.",
"type": "void", "type": "void",
"nickname": "invite", "nickname": "invite",
"consumes": [ "consumes": [
@ -258,13 +237,6 @@
"type": "string", "type": "string",
"paramType": "path" "paramType": "path"
}, },
{
"name": "txnId",
"description": "A client transaction ID for this PUT to ensure idempotency. This can only be omitted if the HTTP method becomes a POST. ",
"required": false,
"type": "string",
"paramType": "path"
},
{ {
"name": "body", "name": "body",
"description": "The user to invite.", "description": "The user to invite.",
@ -277,12 +249,12 @@
] ]
}, },
{ {
"path": "/rooms/{roomId}/join/{txnId}", "path": "/rooms/{roomId}/join",
"operations": [ "operations": [
{ {
"method": "PUT", "method": "POST",
"summary": "Join this room.", "summary": "Join this room.",
"notes": "This operation can also be done as a POST to /rooms/{roomId}/join", "notes": "This operation can also be done as a PUT by suffixing /{txnId}.",
"type": "void", "type": "void",
"nickname": "join_room", "nickname": "join_room",
"consumes": [ "consumes": [
@ -295,25 +267,18 @@
"required": true, "required": true,
"type": "string", "type": "string",
"paramType": "path" "paramType": "path"
},
{
"name": "txnId",
"description": "A client transaction ID for this PUT to ensure idempotency. This can only be omitted if the HTTP method becomes a POST. ",
"required": false,
"type": "string",
"paramType": "path"
} }
] ]
} }
] ]
}, },
{ {
"path": "/rooms/{roomId}/leave/{txnId}", "path": "/rooms/{roomId}/leave",
"operations": [ "operations": [
{ {
"method": "PUT", "method": "POST",
"summary": "Leave this room.", "summary": "Leave this room.",
"notes": "This operation can also be done as a POST to /rooms/{roomId}/leave", "notes": "This operation can also be done as a PUT by suffixing /{txnId}.",
"type": "void", "type": "void",
"nickname": "leave", "nickname": "leave",
"consumes": [ "consumes": [
@ -326,13 +291,6 @@
"required": true, "required": true,
"type": "string", "type": "string",
"paramType": "path" "paramType": "path"
},
{
"name": "txnId",
"description": "A client transaction ID for this PUT to ensure idempotency. This can only be omitted if the HTTP method becomes a POST. ",
"required": false,
"type": "string",
"paramType": "path"
} }
] ]
} }
@ -476,7 +434,7 @@
"parameters": [ "parameters": [
{ {
"name": "body", "name": "body",
"description": "The desired configuration for the room.", "description": "The desired configuration for the room. This operation can also be done as a PUT by suffixing /{txnId}.",
"required": true, "required": true,
"type": "RoomConfig", "type": "RoomConfig",
"paramType": "body" "paramType": "body"