@@ -4,7 +4,7 @@ servers:
4 - url: 'https://localhost:1080/'
4 - url: 'https://localhost:1080/'
6 title: MockServer API
6 title: MockServer API
7− version: 5.15.x
7+ version: 5.13.x
8 description: >-
8 description: >-
9 MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below).
9 MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below).
@@ -18,7 +18,7 @@ info:
18 name: Apache 2.0
18 name: Apache 2.0
20 - name: expectation
20 - name: expectation
21− description: Create or update expectations - updates if the id matches an existing expectations (only supported by MockServer)
21+ description: Create or update expectations - updates if the id matches an existing expecations (only supported by MockServer)
22 - name: verify
22 - name: verify
23 description: Verify requests (both MockServer & MockServer Proxy)
23 description: Verify requests (both MockServer & MockServer Proxy)
24 - name: control
24 - name: control
@@ -36,7 +36,7 @@ paths:
37 application/json:
37 application/json:
39− title: list of upserted expectations
39+ description: "list of upserted expectations"
40 type: array
40 type: array
41 additionalProperties: false
41 additionalProperties: false
@@ -63,7 +63,7 @@ paths:
64 application/json:
64 application/json:
66− title: list of upserted expectations
66+ description: "list of upserted expectations"
67 type: array
67 type: array
68 additionalProperties: false
68 additionalProperties: false
@@ -89,6 +89,15 @@ paths:
89 description: expectations and recorded requests cleared
89 description: expectations and recorded requests cleared
91 description: incorrect request format
91 description: incorrect request format
97+ enum: ["all", "log", "expectations"]
100+ description: specifies the type of information to clear, default if not specified is "all", supported values are "all", "log", "expectations"
92 requestBody:
101 requestBody:
94 application/json:
103 application/json:
@@ -96,7 +105,7 @@ paths:
97 - $ref: "#/components/schemas/RequestDefinition"
106 - $ref: "#/components/schemas/RequestDefinition"
98 - $ref: "#/components/schemas/ExpectationId"
107 - $ref: "#/components/schemas/ExpectationId"
99− description: request used to match expectations and record requests to clear
108+ description: request used to match expectations and recored requests to clear
100 /mockserver/reset:
109 /mockserver/reset:
@@ -116,12 +125,14 @@ paths:
117 type: string
126 type: string
118 enum: [ "java", "json", "log_entries" ]
127 enum: [ "java", "json", "log_entries" ]
119− description: changes response format, default if not specified is "json", supported values are "java", "json", "log_entries"
129+ description: changes response format, default if not specificed is "json", supported values are "java", "json", "log_entries"
120 - in: query
130 - in: query
121 name: type
131 name: type
123 type: string
133 type: string
124 enum: [ "logs", "requests", "request_responses", "recorded_expectations", "active_expectations" ]
134 enum: [ "logs", "requests", "request_responses", "recorded_expectations", "active_expectations" ]
125 description: specifies the type of object that is retrieve, default if not specified is "requests", supported values are "logs", "requests", "recorded_expectations", "active_expectations"
136 description: specifies the type of object that is retrieve, default if not specified is "requests", supported values are "logs", "requests", "recorded_expectations", "active_expectations"
126 responses:
137 responses:
@@ -137,7 +148,11 @@ paths:
137 - type: array
148 - type: array
138 additionalProperties: false
149 additionalProperties: false
140− $ref: "#/components/schemas/HttpResponse"
151+ $ref: "#/components/schemas/HttpRequest"
153+ additionalProperties: false
155+ $ref: "#/components/schemas/HttpRequestAndHttpResponse"
141 application/java:
156 application/java:
143 type: string
158 type: string
@@ -257,7 +272,7 @@ paths:
257components:
272components:
259 Expectations:
274 Expectations:
260− title: "list of expectations"
275+ description: "list of expectations"
262 - $ref: "#/components/schemas/Expectation"
277 - $ref: "#/components/schemas/Expectation"
263 - type: array
278 - type: array
@@ -265,7 +280,7 @@ components:
266 $ref: "#/components/schemas/Expectation"
281 $ref: "#/components/schemas/Expectation"
267 Expectation:
282 Expectation:
268− title: "expectation"
283+ description: "expectation"
269 type: object
284 type: object
270 additionalProperties: false
285 additionalProperties: false
271 properties:
286 properties:
@@ -275,8 +290,6 @@ components:
275 type: integer
290 type: integer
276 httpRequest:
291 httpRequest:
277 $ref: "#/components/schemas/RequestDefinition"
292 $ref: "#/components/schemas/RequestDefinition"
279− $ref: "#/components/schemas/OpenAPIDefinition"
280 httpResponse:
293 httpResponse:
281 $ref: "#/components/schemas/HttpResponse"
294 $ref: "#/components/schemas/HttpResponse"
282 httpResponseTemplate:
295 httpResponseTemplate:
@@ -301,8 +314,29 @@ components:
301 $ref: "#/components/schemas/Times"
314 $ref: "#/components/schemas/Times"
302 timeToLive:
315 timeToLive:
303 $ref: "#/components/schemas/TimeToLive"
316 $ref: "#/components/schemas/TimeToLive"
321+ - httpResponseTemplate
323+ - httpResponseClassCallback
325+ - httpResponseObjectCallback
329+ - httpForwardTemplate
331+ - httpForwardClassCallback
333+ - httpForwardObjectCallback
335+ - httpOverrideForwardedRequest
304 ExpectationId:
338 ExpectationId:
305− title: "pointer to existing expectation"
339+ description: "pointer to existing expectation"
306 type: object
340 type: object
307 additionalProperties: false
341 additionalProperties: false
308 properties:
342 properties:
@@ -311,7 +345,7 @@ components:
311 required:
345 required:
313 OpenAPIExpectations:
347 OpenAPIExpectations:
314− title: "list of open api expectations"
348+ description: "list of open api expectations"
316 - $ref: "#/components/schemas/OpenAPIExpectation"
350 - $ref: "#/components/schemas/OpenAPIExpectation"
317 - type: array
351 - type: array
@@ -319,7 +353,7 @@ components:
320 $ref: "#/components/schemas/OpenAPIExpectation"
354 $ref: "#/components/schemas/OpenAPIExpectation"
321 OpenAPIExpectation:
355 OpenAPIExpectation:
322− title: "open api or swagger expectation"
356+ description: "open api or swagger expectation"
323 type: object
357 type: object
324 additionalProperties: false
358 additionalProperties: false
325 properties:
359 properties:
@@ -334,12 +368,12 @@ components:
334 required:
368 required:
335 - specUrlOrPayload
369 - specUrlOrPayload
336 RequestDefinition:
370 RequestDefinition:
337− title: "request definition"
371+ description: "request definition"
339 - $ref: "#/components/schemas/HttpRequest"
373 - $ref: "#/components/schemas/HttpRequest"
340 - $ref: "#/components/schemas/OpenAPIDefinition"
374 - $ref: "#/components/schemas/OpenAPIDefinition"
341 HttpRequest:
375 HttpRequest:
342− title: "request properties matcher"
376+ description: "request properties matcher"
343 type: object
377 type: object
344 additionalProperties: false
378 additionalProperties: false
345 properties:
379 properties:
@@ -363,10 +397,8 @@ components:
363 $ref: "#/components/schemas/KeyToValue"
397 $ref: "#/components/schemas/KeyToValue"
364 socketAddress:
398 socketAddress:
365 $ref: "#/components/schemas/SocketAddress"
399 $ref: "#/components/schemas/SocketAddress"
367− $ref: "#/components/schemas/Protocol"
368 OpenAPIDefinition:
400 OpenAPIDefinition:
369− title: "open api or swagger request matcher"
401+ description: "open api or swagger request matcher"
370 type: object
402 type: object
371 additionalProperties: false
403 additionalProperties: false
372 properties:
404 properties:
@@ -375,7 +407,7 @@ components:
375 operationId:
407 operationId:
376 type: string
408 type: string
377 HttpResponse:
409 HttpResponse:
378− title: "response to return"
410+ description: "response to return"
379 type: object
411 type: object
380 additionalProperties: false
412 additionalProperties: false
381 properties:
413 properties:
@@ -394,7 +426,7 @@ components:
394 reasonPhrase:
426 reasonPhrase:
395 type: string
427 type: string
396 HttpTemplate:
428 HttpTemplate:
397− title: "template to generate response / request"
429+ description: "template to generate response / request"
398 type: object
430 type: object
399 additionalProperties: false
431 additionalProperties: false
400 properties:
432 properties:
@@ -408,7 +440,7 @@ components:
408 template:
440 template:
409 type: string
441 type: string
410 HttpForward:
442 HttpForward:
411− title: host and port to forward to
443+ description: "host and port to forward to"
412 type: object
444 type: object
413 additionalProperties: false
445 additionalProperties: false
414 properties:
446 properties:
@@ -423,7 +455,7 @@ components:
425 HttpClassCallback:
457 HttpClassCallback:
426− title: class callback
458+ description: "class callback"
427 type: object
459 type: object
428 additionalProperties: false
460 additionalProperties: false
429 properties:
461 properties:
@@ -432,7 +464,7 @@ components:
432 callbackClass:
464 callbackClass:
433 type: string
465 type: string
434 HttpObjectCallback:
466 HttpObjectCallback:
435− title: object / method callback
467+ description: "object / method callback"
436 type: object
468 type: object
437 additionalProperties: false
469 additionalProperties: false
438 properties:
470 properties:
@@ -443,7 +475,7 @@ components:
443 responseCallback:
475 responseCallback:
444 type: boolean
476 type: boolean
445 HttpOverrideForwardedRequest:
477 HttpOverrideForwardedRequest:
446− title: override forwarded request
478+ description: "override forwarded request"
448 - type: object
480 - type: object
449 additionalProperties: false
481 additionalProperties: false
@@ -545,7 +577,7 @@ components:
545 httpResponse:
577 httpResponse:
546 "$ref": "#/components/schemas/HttpResponse"
578 "$ref": "#/components/schemas/HttpResponse"
547 HttpError:
579 HttpError:
548− title: error behaviour
580+ description: "error behaviour"
549 type: object
581 type: object
550 additionalProperties: false
582 additionalProperties: false
551 properties:
583 properties:
@@ -556,7 +588,7 @@ components:
556 responseBytes:
588 responseBytes:
557 type: string
589 type: string
559− title: "number of responses"
591+ description: "number of responses"
560 type: object
592 type: object
561 additionalProperties: false
593 additionalProperties: false
562 properties:
594 properties:
@@ -565,7 +597,7 @@ components:
565 unlimited:
597 unlimited:
566 type: boolean
598 type: boolean
567 TimeToLive:
599 TimeToLive:
568− title: "time expectation is valid for"
600+ description: "time expectation is valid for"
569 type: object
601 type: object
570 additionalProperties: false
602 additionalProperties: false
571 properties:
603 properties:
@@ -655,7 +687,7 @@ components:
655 # "^\\S+$":
687 # "^\\S+$":
656 # $ref: "#/components/schemas/StringOrJsonSchema"
688 # $ref: "#/components/schemas/StringOrJsonSchema"
657 StringOrJsonSchema:
689 StringOrJsonSchema:
658− title: string value that can be support nottable, optional or a json schema
690+ description: "string value that can be support nottable, optional or a json schema"
660 - type: string
692 - type: string
661 - type: object
693 - type: object
@@ -686,7 +718,7 @@ components:
686 - PIPE_DELIMITED
718 - PIPE_DELIMITED
687 - DEEP_OBJECT
719 - DEEP_OBJECT
688 SocketAddress:
720 SocketAddress:
689− title: remote address to send request to
721+ description: "remote address to send request to, only used for request overrides"
690 type: object
722 type: object
691 additionalProperties: false
723 additionalProperties: false
692 properties:
724 properties:
@@ -698,239 +730,198 @@ components:
703− description: "binary body matcher"
704− additionalProperties: false
717− description: "json body matcher"
718− additionalProperties: false
732− - ONLY_MATCHING_FIELDS
735− description: "json matching fields body matcher"
736− additionalProperties: true
737− JsonSchemaBodyMatcher:
739− description: "json schema body matcher"
740− additionalProperties: false
748− $ref: http://json-schema.org/draft-04/schema
749− JsonPathBodyMatcher:
751− description: "JSON path body matcher"
752− additionalProperties: false
761− ParameterBodyMatcher:
763− description: "parameter body matcher"
764− additionalProperties: false
772− $ref: "#/components/schemas/KeyToMultiValue"
775− description: "regex body matcher"
776− additionalProperties: false
787− description: "string body matcher"
788− additionalProperties: false
801− RawStringBodyMatcher:
803− description: "substring body matcher"
806− description: "xml body matcher"
807− additionalProperties: false
818− XmlSchemaBodyMatcher:
820− description: "xml schema body matcher"
821− additionalProperties: false
832− description: "xpath body matcher"
833− additionalProperties: false
843− description: "protocol matcher"
848 description: "request body matcher"
734 description: "request body matcher"
850− - $ref: "#/components/schemas/BinaryBodyMatcher"
851− - $ref: "#/components/schemas/JsonBodyMatcher"
852− - $ref: "#/components/schemas/RawJsonBodyMatcher"
853− - $ref: "#/components/schemas/JsonSchemaBodyMatcher"
854− - $ref: "#/components/schemas/JsonPathBodyMatcher"
855− - $ref: "#/components/schemas/ParameterBodyMatcher"
856− - $ref: "#/components/schemas/RegexBodyMatcher"
857− - $ref: "#/components/schemas/StringBodyMatcher"
858− - $ref: "#/components/schemas/RawStringBodyMatcher"
859− - $ref: "#/components/schemas/XmlBodyMatcher"
860− - $ref: "#/components/schemas/XmlSchemaBodyMatcher"
861− - $ref: "#/components/schemas/XpathBodyMatcher"
863− type: object
736+ - type: object
864− description: "binary response body"
737+ description: "binary body matcher"
865− additionalProperties: false
738+ additionalProperties: false
866− properties:
739+ properties:
868− type: boolean
741+ type: boolean
871− - BINARY
744+ - BINARY
872− base64Bytes:
745+ base64Bytes:
873− type: string
746+ type: string
874− contentType:
747+ contentType:
875− type: string
748+ type: string
877− type: object
749+ - type: object
878− description: "json response body"
750+ description: "json body matcher"
879− additionalProperties: false
751+ additionalProperties: false
880− properties:
752+ properties:
882− type: boolean
754+ type: boolean
887− type: string
759+ type: string
888− contentType:
760+ contentType:
889− type: string
761+ type: string
890− RawJsonResponseBody:
762+ matchType:
765+ - ONLY_MATCHING_FIELDS
891− type: object
766+ - type: object
892− description: "json response body"
767+ description: "json matching fields body matcher"
893− additionalProperties: true
768+ additionalProperties: true
894− StringResponseBody:
769+ - type: object
770+ description: "json schema body matcher"
771+ additionalProperties: false
779+ $ref: http://json-schema.org/draft-04/schema
895− type: object
780+ - type: object
896− description: "string response body"
781+ description: "JSON path body matcher"
782+ additionalProperties: false
792+ description: "parameter body matcher"
897− additionalProperties: false
793+ additionalProperties: false
898− properties:
794+ properties:
900− type: boolean
796+ type: boolean
801+ $ref: "#/components/schemas/KeyToMultiValue"
901− type:
802+ - type: object
803+ description: "regex body matcher"
804+ additionalProperties: false
814+ description: "string body matcher"
815+ additionalProperties: false
903− - STRING
821+ - STRING
905− type: string
823+ type: string
906− contentType:
824+ contentType:
907− type: string
825+ type: string
908− RawStringResponseBody:
826+ subString:
909− type: string
828+ - type: string
910− description: "string response body"
829+ description: "substring body matcher"
912− type: object
830+ - type: object
913− description: "xml response body"
831+ description: "xml body matcher"
914− additionalProperties: false
832+ additionalProperties: false
915− properties:
833+ properties:
917− type: boolean
835+ type: boolean
844+ description: "xml schema body matcher"
845+ additionalProperties: false
922− type: string
853+ type: string
923− contentType:
854+ - type: object
855+ description: "xpath body matcher"
856+ additionalProperties: false
924− type: string
864+ type: string
925 BodyWithContentType:
865 BodyWithContentType:
926 description: "response body"
866 description: "response body"
928− - $ref: "#/components/schemas/BinaryBodyResponse"
868+ - type: object
929− - $ref: "#/components/schemas/JsonResponseBody"
869+ description: "binary response body"
930− - $ref: "#/components/schemas/RawJsonResponseBody"
870+ additionalProperties: false
931− - $ref: "#/components/schemas/StringResponseBody"
871+ properties:
932− - $ref: "#/components/schemas/RawStringResponseBody"
872+ not:
933− - $ref: "#/components/schemas/XmlResponseBody"
873+ type: boolean
882+ description: "json response body"
883+ additionalProperties: false
895+ description: "json response body"
896+ additionalProperties: true
898+ description: "string response body"
899+ additionalProperties: false
911+ description: "string response body"
913+ description: "xml response body"
914+ additionalProperties: false
935 description: "response delay"
926 description: "response delay"
936 type: object
927 type: object
@@ -972,6 +963,11 @@ components:
972 $ref: "#/components/schemas/VerificationTimes"
963 $ref: "#/components/schemas/VerificationTimes"
973 maximumNumberOfRequestToReturnInVerificationFailure:
964 maximumNumberOfRequestToReturnInVerificationFailure:
974 type: integer
965 type: integer
975 VerificationTimes:
971 VerificationTimes:
976 description: "number of request to verify"
972 description: "number of request to verify"
977 type: object
973 type: object
@@ -997,6 +993,11 @@ components:
997 $ref: "#/components/schemas/RequestDefinition"
993 $ref: "#/components/schemas/RequestDefinition"
998 maximumNumberOfRequestToReturnInVerificationFailure:
994 maximumNumberOfRequestToReturnInVerificationFailure:
999 type: integer
995 type: integer
1001 description: "list of ports"
1002 description: "list of ports"
1002 type: object
1003 type: object
@@ -1006,3 +1007,14 @@ components:
1007 type: number
1008 type: number
1008 type: array
1009 type: array
1010+ HttpRequestAndHttpResponse:
1011+ description: "request and response"
1013+ additionalProperties: false
1016+ $ref: "#/components/schemas/HttpRequest"
1018+ $ref: "#/components/schemas/HttpResponse"