Mock POST or PUT with empty response #682
-
Hello, is it possible to mock an empty POST or PUT response on Microcks 1.6.x? For example with this endpoint: /users:
post:
summary: Create a user
operationId: createUser
responses:
'201':
description: Created
headers:
Location:
schema:
type: string
description: Url of the newly created user resource
description: It creates a new user
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/User'
examples:
user:
value:
name: John Doe
loginType: basic
password: mySecretPassword I would like to have a working endpoint in Microcks, but I don't see the Mock URL available for this type of request. I tried x-microcks-operation, but with no success. x-microcks-operation:
dispatcher: SCRIPT
dispatcherRules: |
return "Accepted" Thanks for any advice |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hey! Not sure if we're currently able to do that... Have you tried to add - at least - an empty response example with responses:
'201':
content:
application/json:
examples:
user:
value: Maybe it could do the trick to allow Microcks to assemble a valid request/response pair? |
Beta Was this translation helpful? Give feedback.
Hey! Not sure if we're currently able to do that...
I think it has nothing to do with the dispatcher but with the way we gather example fragments to build a request/response pair.
Have you tried to add - at least - an empty response example with
user
has a key? Something like:Maybe it could do the trick to allow Microcks to assemble a valid request/response pair?