|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
API Flow my delete method no body |
« View previous topic :: View next topic » |
Author |
Message
|
matuwe |
Posted: Thu Oct 12, 2017 4:23 am Post subject: API Flow my delete method no body |
|
|
 Master
Joined: 05 Dec 2007 Posts: 296
|
According to my Swagger file my delete has a message body, but when I test , during debug my http request node has no message body, just httpHeaderRequest.
What could I be doing wrong.
Code: |
"delete" : {
"tags" : [ "vaps" ],
"operationId" : "resetVap",
"summary" : "reset vap",
"responses" : {
"200" : {
"description" : "reset VAP has been accepted",
"schema" : {
"$ref" : "#/definitions/resetVapsResponse"
}
},
"202" : {
"description" : "detele vap has been accepted",
"schema" : {
"$ref" : "#/definitions/api_response"
}
},
"default" : {
"description" : "Unexpected error",
"schema" : {
"$ref" : "#/definitions/api_error"
}
}
},
"consumes" : [ "application/json" ],
"produces" : [ "application/json" ],
"description" : "reset a VAP",
"parameters" : [ {
"name" : "Authorization",
"in" : "header",
"description" : "Oauth2 Bearer Token.",
"required" : true,
"type" : "string",
"format" : "string"
}, {
"name" : "correlationId",
"in" : "header",
"description" : "This is a process correlation Id which all messages related to the same logical business process instance should carry",
"required" : true,
"type" : "string",
"format" : "string"
}, {
"name" : "messageId",
"in" : "header",
"description" : "A unique identifier (UID) which identifies this specific message instance",
"required" : false,
"type" : "string",
"format" : "string"
}, {
"name" : "messageType",
"in" : "header",
"description" : "When present indicates the type of message and determines the schema that the message payload conforms to",
"required" : false,
"type" : "string",
"format" : "string"
}, {
"name" : "publishUTC",
"in" : "header",
"description" : "Populated by publisher/requester at the time the message is published or sent",
"required" : false,
"type" : "string",
"format" : "string"
}, {
"name" : "source",
"in" : "header",
"description" : "The system/component/service name of the requester/publisher",
"required" : false,
"type" : "string",
"format" : "string"
}, {
"name" : "userName",
"in" : "header",
"description" : "The identity of the requesting user",
"required" : false,
"type" : "string",
"format" : "string"
}, {
"name" : "referenceNumber",
"in" : "path",
"description" : "Search by reference number",
"required" : true,
"type" : "string",
"format" : "double"
}, {
"name" : "type",
"in" : "query",
"description" : "vaps query type.",
"required" : true,
"type" : "string",
"enum" : [ "touchup", "tyreRim", "coverSure", "protectionPlus", "driverAssist" ],
"default" : "touchup"
}, {
"name" : "requestInput",
"in" : "body",
"schema" : {
"$ref" : "#/definitions/resetVapRequest"
},
"description" : "vap request Message",
"required" : true
} ]
}
|
|
|
Back to top |
|
 |
Vitor |
Posted: Thu Oct 12, 2017 5:00 am Post subject: Re: API Flow my delete method no body |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
matuwe wrote: |
What could I be doing wrong. |
Believing a delete request can contain a message body. REST API convention says that a DELETE only contains a header with the id to be deleted.
What's the requirement that drives you to have a body with a DELETE? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
matuwe |
Posted: Thu Oct 19, 2017 9:50 am Post subject: |
|
|
 Master
Joined: 05 Dec 2007 Posts: 296
|
Thanks Victor, i have moved everything into query param.
My requirements are to do a delete and the delete will come in with few parameters and reason for delete being one of the parameters.
i was hoping the body will contain the reason for delete... this works fine right now, but seems a bit clumsy since this might be a longer string.
all sorted for now. thanks |
|
Back to top |
|
 |
Vitor |
Posted: Thu Oct 19, 2017 12:03 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
matuwe wrote: |
My requirements are to do a delete and the delete will come in with few parameters and reason for delete being one of the parameters. |
If you're deleting the object, where are you storing the reason? Sounds more like you're logically deleting it with a reason for the logical delete.
But yay you for getting it sorted.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|