@@ -4,7 +4,7 @@ servers:
44 - url: 'https://localhost:1080/'
55info:
66 title: MockServer API
7− version: 5.13.x
7+ version: 5.15.x
88 description: >-
99 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).
1010
@@ -18,7 +18,7 @@ info:
1818 name: Apache 2.0
1919tags:
2020 - name: expectation
21− description: Create or update expectations - updates if the id matches an existing expecations (only supported by MockServer)
21+ description: Create or update expectations - updates if the id matches an existing expectations (only supported by MockServer)
2222 - name: verify
2323 description: Verify requests (both MockServer & MockServer Proxy)
2424 - name: control
@@ -36,7 +36,7 @@ paths:
3636 content:
3737 application/json:
3838 schema:
39− description: "list of upserted expectations"
39+ title: list of upserted expectations
4040 type: array
4141 additionalProperties: false
4242 items:
@@ -63,7 +63,7 @@ paths:
6363 content:
6464 application/json:
6565 schema:
66− description: "list of upserted expectations"
66+ title: list of upserted expectations
6767 type: array
6868 additionalProperties: false
6969 items:
@@ -89,15 +89,6 @@ paths:
8989 description: expectations and recorded requests cleared
9090 '400':
9191 description: incorrect request format
92− parameters:
93− - in: query
94− name: type
95− schema:
96− type: string
97− enum: ["all", "log", "expectations"]
98− default: "all"
99− required: false
100− description: specifies the type of information to clear, default if not specified is "all", supported values are "all", "log", "expectations"
10192 requestBody:
10293 content:
10394 application/json:
@@ -105,7 +96,7 @@ paths:
10596 oneOf:
10697 - $ref: "#/components/schemas/RequestDefinition"
10798 - $ref: "#/components/schemas/ExpectationId"
108− description: request used to match expectations and recored requests to clear
99+ description: request used to match expectations and record requests to clear
109100 /mockserver/reset:
110101 put:
111102 tags:
@@ -125,14 +116,12 @@ paths:
125116 schema:
126117 type: string
127118 enum: [ "java", "json", "log_entries" ]
128− required: false
129− description: changes response format, default if not specificed is "json", supported values are "java", "json", "log_entries"
119+ description: changes response format, default if not specified is "json", supported values are "java", "json", "log_entries"
130120 - in: query
131121 name: type
132122 schema:
133123 type: string
134124 enum: [ "logs", "requests", "request_responses", "recorded_expectations", "active_expectations" ]
135− required: false
136125 description: specifies the type of object that is retrieve, default if not specified is "requests", supported values are "logs", "requests", "recorded_expectations", "active_expectations"
137126 responses:
138127 '200':
@@ -148,11 +137,7 @@ paths:
148137 - type: array
149138 additionalProperties: false
150139 items:
151− $ref: "#/components/schemas/HttpRequest"
152− - type: array
153− additionalProperties: false
154− items:
155− $ref: "#/components/schemas/HttpRequestAndHttpResponse"
140+ $ref: "#/components/schemas/HttpResponse"
156141 application/java:
157142 schema:
158143 type: string
@@ -272,7 +257,7 @@ paths:
272257components:
273258 schemas:
274259 Expectations:
275− description: "list of expectations"
260+ title: "list of expectations"
276261 oneOf:
277262 - $ref: "#/components/schemas/Expectation"
278263 - type: array
@@ -280,7 +265,7 @@ components:
280265 items:
281266 $ref: "#/components/schemas/Expectation"
282267 Expectation:
283− description: "expectation"
268+ title: "expectation"
284269 type: object
285270 additionalProperties: false
286271 properties:
@@ -290,6 +275,8 @@ components:
290275 type: integer
291276 httpRequest:
292277 $ref: "#/components/schemas/RequestDefinition"
278+ openAPIDefinition:
279+ $ref: "#/components/schemas/OpenAPIDefinition"
293280 httpResponse:
294281 $ref: "#/components/schemas/HttpResponse"
295282 httpResponseTemplate:
@@ -314,29 +301,8 @@ components:
314301 $ref: "#/components/schemas/Times"
315302 timeToLive:
316303 $ref: "#/components/schemas/TimeToLive"
317− oneOf:
318− - required:
319− - httpResponse
320− - required:
321− - httpResponseTemplate
322− - required:
323− - httpResponseClassCallback
324− - required:
325− - httpResponseObjectCallback
326− - required:
327− - httpForward
328− - required:
329− - httpForwardTemplate
330− - required:
331− - httpForwardClassCallback
332− - required:
333− - httpForwardObjectCallback
334− - required:
335− - httpOverrideForwardedRequest
336− - required:
337− - httpError
338304 ExpectationId:
339− description: "pointer to existing expectation"
305+ title: "pointer to existing expectation"
340306 type: object
341307 additionalProperties: false
342308 properties:
@@ -345,7 +311,7 @@ components:
345311 required:
346312 - id
347313 OpenAPIExpectations:
348− description: "list of open api expectations"
314+ title: "list of open api expectations"
349315 oneOf:
350316 - $ref: "#/components/schemas/OpenAPIExpectation"
351317 - type: array
@@ -353,7 +319,7 @@ components:
353319 items:
354320 $ref: "#/components/schemas/OpenAPIExpectation"
355321 OpenAPIExpectation:
356− description: "open api or swagger expectation"
322+ title: "open api or swagger expectation"
357323 type: object
358324 additionalProperties: false
359325 properties:
@@ -368,12 +334,12 @@ components:
368334 required:
369335 - specUrlOrPayload
370336 RequestDefinition:
371− description: "request definition"
337+ title: "request definition"
372338 oneOf:
373339 - $ref: "#/components/schemas/HttpRequest"
374340 - $ref: "#/components/schemas/OpenAPIDefinition"
375341 HttpRequest:
376− description: "request properties matcher"
342+ title: "request properties matcher"
377343 type: object
378344 additionalProperties: false
379345 properties:
@@ -397,8 +363,10 @@ components:
397363 $ref: "#/components/schemas/KeyToValue"
398364 socketAddress:
399365 $ref: "#/components/schemas/SocketAddress"
366+ protocol:
367+ $ref: "#/components/schemas/Protocol"
400368 OpenAPIDefinition:
401− description: "open api or swagger request matcher"
369+ title: "open api or swagger request matcher"
402370 type: object
403371 additionalProperties: false
404372 properties:
@@ -407,7 +375,7 @@ components:
407375 operationId:
408376 type: string
409377 HttpResponse:
410− description: "response to return"
378+ title: "response to return"
411379 type: object
412380 additionalProperties: false
413381 properties:
@@ -426,7 +394,7 @@ components:
426394 reasonPhrase:
427395 type: string
428396 HttpTemplate:
429− description: "template to generate response / request"
397+ title: "template to generate response / request"
430398 type: object
431399 additionalProperties: false
432400 properties:
@@ -440,7 +408,7 @@ components:
440408 template:
441409 type: string
442410 HttpForward:
443− description: "host and port to forward to"
411+ title: host and port to forward to
444412 type: object
445413 additionalProperties: false
446414 properties:
@@ -455,7 +423,7 @@ components:
455423 - HTTP
456424 - HTTPS
457425 HttpClassCallback:
458− description: "class callback"
426+ title: class callback
459427 type: object
460428 additionalProperties: false
461429 properties:
@@ -464,7 +432,7 @@ components:
464432 callbackClass:
465433 type: string
466434 HttpObjectCallback:
467− description: "object / method callback"
435+ title: object / method callback
468436 type: object
469437 additionalProperties: false
470438 properties:
@@ -475,7 +443,7 @@ components:
475443 responseCallback:
476444 type: boolean
477445 HttpOverrideForwardedRequest:
478− description: "override forwarded request"
446+ title: override forwarded request
479447 oneOf:
480448 - type: object
481449 additionalProperties: false
@@ -577,7 +545,7 @@ components:
577545 httpResponse:
578546 "$ref": "#/components/schemas/HttpResponse"
579547 HttpError:
580− description: "error behaviour"
548+ title: error behaviour
581549 type: object
582550 additionalProperties: false
583551 properties:
@@ -588,7 +556,7 @@ components:
588556 responseBytes:
589557 type: string
590558 Times:
591− description: "number of responses"
559+ title: "number of responses"
592560 type: object
593561 additionalProperties: false
594562 properties:
@@ -597,7 +565,7 @@ components:
597565 unlimited:
598566 type: boolean
599567 TimeToLive:
600− description: "time expectation is valid for"
568+ title: "time expectation is valid for"
601569 type: object
602570 additionalProperties: false
603571 properties:
@@ -687,7 +655,7 @@ components:
687655 # "^\\S+$":
688656 # $ref: "#/components/schemas/StringOrJsonSchema"
689657 StringOrJsonSchema:
690− description: "string value that can be support nottable, optional or a json schema"
658+ title: string value that can be support nottable, optional or a json schema
691659 oneOf:
692660 - type: string
693661 - type: object
@@ -718,7 +686,7 @@ components:
718686 - PIPE_DELIMITED
719687 - DEEP_OBJECT
720688 SocketAddress:
721− description: "remote address to send request to, only used for request overrides"
689+ title: remote address to send request to
722690 type: object
723691 additionalProperties: false
724692 properties:
@@ -730,198 +698,239 @@ components:
730698 enum:
731699 - HTTP
732700 - HTTPS
701+ BinaryBodyMatcher:
702+ type: object
703+ description: "binary body matcher"
704+ additionalProperties: false
705+ properties:
706+ not:
707+ type: boolean
708+ type:
709+ enum:
710+ - BINARY
711+ base64Bytes:
712+ type: string
713+ contentType:
714+ type: string
715+ JsonBodyMatcher:
716+ type: object
717+ description: "json body matcher"
718+ additionalProperties: false
719+ properties:
720+ not:
721+ type: boolean
722+ type:
723+ enum:
724+ - JSON
725+ json:
726+ type: string
727+ contentType:
728+ type: string
729+ matchType:
730+ enum:
731+ - STRICT
732+ - ONLY_MATCHING_FIELDS
733+ RawJsonBodyMatcher:
734+ type: object
735+ description: "json matching fields body matcher"
736+ additionalProperties: true
737+ JsonSchemaBodyMatcher:
738+ type: object
739+ description: "json schema body matcher"
740+ additionalProperties: false
741+ properties:
742+ not:
743+ type: boolean
744+ type:
745+ enum:
746+ - JSON_SCHEMA
747+ jsonSchema:
748+ $ref: http://json-schema.org/draft-04/schema
749+ JsonPathBodyMatcher:
750+ type: object
751+ description: "JSON path body matcher"
752+ additionalProperties: false
753+ properties:
754+ not:
755+ type: boolean
756+ type:
757+ enum:
758+ - JSON_PATH
759+ jsonPath:
760+ type: string
761+ ParameterBodyMatcher:
762+ type: object
763+ description: "parameter body matcher"
764+ additionalProperties: false
765+ properties:
766+ not:
767+ type: boolean
768+ type:
769+ enum:
770+ - PARAMETERS
771+ parameters:
772+ $ref: "#/components/schemas/KeyToMultiValue"
773+ RegexBodyMatcher:
774+ type: object
775+ description: "regex body matcher"
776+ additionalProperties: false
777+ properties:
778+ not:
779+ type: boolean
780+ type:
781+ enum:
782+ - REGEX
783+ regex:
784+ type: string
785+ StringBodyMatcher:
786+ type: object
787+ description: "string body matcher"
788+ additionalProperties: false
789+ properties:
790+ not:
791+ type: boolean
792+ type:
793+ enum:
794+ - STRING
795+ string:
796+ type: string
797+ contentType:
798+ type: string
799+ subString:
800+ type: boolean
801+ RawStringBodyMatcher:
802+ type: string
803+ description: "substring body matcher"
804+ XmlBodyMatcher:
805+ type: object
806+ description: "xml body matcher"
807+ additionalProperties: false
808+ properties:
809+ not:
810+ type: boolean
811+ type:
812+ enum:
813+ - XML
814+ xml:
815+ type: string
816+ contentType:
817+ type: string
818+ XmlSchemaBodyMatcher:
819+ type: object
820+ description: "xml schema body matcher"
821+ additionalProperties: false
822+ properties:
823+ not:
824+ type: boolean
825+ type:
826+ enum:
827+ - XML_SCHEMA
828+ xmlSchema:
829+ type: string
830+ XpathBodyMatcher:
831+ type: object
832+ description: "xpath body matcher"
833+ additionalProperties: false
834+ properties:
835+ not:
836+ type: boolean
837+ type:
838+ enum:
839+ - XPATH
840+ xpath:
841+ type: string
842+ Protocol:
843+ description: "protocol matcher"
844+ enum:
845+ - HTTP_1_1
846+ - HTTP_2
733847 Body:
734848 description: "request body matcher"
735849 anyOf:
736− - type: object
737− description: "binary body matcher"
738− additionalProperties: false
739− properties:
740− not:
741− type: boolean
742− type:
743− enum:
744− - BINARY
745− base64Bytes:
746− type: string
747− contentType:
748− type: string
749− - type: object
750− description: "json body matcher"
751− additionalProperties: false
752− properties:
753− not:
754− type: boolean
755− type:
756− enum:
757− - JSON
758− json:
759− type: string
760− contentType:
761− type: string
762− matchType:
763− enum:
764− - STRICT
765− - ONLY_MATCHING_FIELDS
766− - type: object
767− description: "json matching fields body matcher"
768− additionalProperties: true
769− - type: object
770− description: "json schema body matcher"
771− additionalProperties: false
772− properties:
773− not:
774− type: boolean
775− type:
776− enum:
777− - JSON_SCHEMA
778− jsonSchema:
779− $ref: http://json-schema.org/draft-04/schema
780− - type: object
781− description: "JSON path body matcher"
782− additionalProperties: false
783− properties:
784− not:
785− type: boolean
786− type:
787− enum:
788− - JSON_PATH
789− jsonPath:
790− type: string
791− - type: object
792− description: "parameter body matcher"
793− additionalProperties: false
794− properties:
795− not:
796− type: boolean
797− type:
798− enum:
799− - PARAMETERS
800− parameters:
801− $ref: "#/components/schemas/KeyToMultiValue"
802− - type: object
803− description: "regex body matcher"
804− additionalProperties: false
805− properties:
806− not:
807− type: boolean
808− type:
809− enum:
810− - REGEX
811− regex:
812− type: string
813− - type: object
814− description: "string body matcher"
815− additionalProperties: false
816− properties:
817− not:
818− type: boolean
819− type:
820− enum:
821− - STRING
822− string:
823− type: string
824− contentType:
825− type: string
826− subString:
827− type: boolean
828− - type: string
829− description: "substring body matcher"
830− - type: object
831− description: "xml body matcher"
832− additionalProperties: false
833− properties:
834− not:
835− type: boolean
836− type:
837− enum:
838− - XML
839− xml:
840− type: string
841− contentType:
842− type: string
843− - type: object
844− description: "xml schema body matcher"
845− additionalProperties: false
846− properties:
847− not:
848− type: boolean
849− type:
850− enum:
851− - XML_SCHEMA
852− xmlSchema:
853− type: string
854− - type: object
855− description: "xpath body matcher"
856− additionalProperties: false
857− properties:
858− not:
859− type: boolean
860− type:
861− enum:
862− - XPATH
863− xpath:
864− type: string
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"
862+ BinaryBodyResponse:
863+ type: object
864+ description: "binary response body"
865+ additionalProperties: false
866+ properties:
867+ not:
868+ type: boolean
869+ type:
870+ enum:
871+ - BINARY
872+ base64Bytes:
873+ type: string
874+ contentType:
875+ type: string
876+ JsonResponseBody:
877+ type: object
878+ description: "json response body"
879+ additionalProperties: false
880+ properties:
881+ not:
882+ type: boolean
883+ type:
884+ enum:
885+ - JSON
886+ json:
887+ type: string
888+ contentType:
889+ type: string
890+ RawJsonResponseBody:
891+ type: object
892+ description: "json response body"
893+ additionalProperties: true
894+ StringResponseBody:
895+ type: object
896+ description: "string response body"
897+ additionalProperties: false
898+ properties:
899+ not:
900+ type: boolean
901+ type:
902+ enum:
903+ - STRING
904+ string:
905+ type: string
906+ contentType:
907+ type: string
908+ RawStringResponseBody:
909+ type: string
910+ description: "string response body"
911+ XmlResponseBody:
912+ type: object
913+ description: "xml response body"
914+ additionalProperties: false
915+ properties:
916+ not:
917+ type: boolean
918+ type:
919+ enum:
920+ - XML
921+ xml:
922+ type: string
923+ contentType:
924+ type: string
865925 BodyWithContentType:
866926 description: "response body"
867927 anyOf:
868− - type: object
869− description: "binary response body"
870− additionalProperties: false
871− properties:
872− not:
873− type: boolean
874− type:
875− enum:
876− - BINARY
877− base64Bytes:
878− type: string
879− contentType:
880− type: string
881− - type: object
882− description: "json response body"
883− additionalProperties: false
884− properties:
885− not:
886− type: boolean
887− type:
888− enum:
889− - JSON
890− json:
891− type: string
892− contentType:
893− type: string
894− - type: object
895− description: "json response body"
896− additionalProperties: true
897− - type: object
898− description: "string response body"
899− additionalProperties: false
900− properties:
901− not:
902− type: boolean
903− type:
904− enum:
905− - STRING
906− string:
907− type: string
908− contentType:
909− type: string
910− - type: string
911− description: "string response body"
912− - type: object
913− description: "xml response body"
914− additionalProperties: false
915− properties:
916− not:
917− type: boolean
918− type:
919− enum:
920− - XML
921− xml:
922− type: string
923− contentType:
924− type: string
928+ - $ref: "#/components/schemas/BinaryBodyResponse"
929+ - $ref: "#/components/schemas/JsonResponseBody"
930+ - $ref: "#/components/schemas/RawJsonResponseBody"
931+ - $ref: "#/components/schemas/StringResponseBody"
932+ - $ref: "#/components/schemas/RawStringResponseBody"
933+ - $ref: "#/components/schemas/XmlResponseBody"
925934 Delay:
926935 description: "response delay"
927936 type: object
@@ -963,11 +972,6 @@ components:
963972 $ref: "#/components/schemas/VerificationTimes"
964973 maximumNumberOfRequestToReturnInVerificationFailure:
965974 type: integer
966− oneOf:
967− - required:
968− - expectationId
969− - required:
970− - httpRequest
971975 VerificationTimes:
972976 description: "number of request to verify"
973977 type: object
@@ -993,11 +997,6 @@ components:
993997 $ref: "#/components/schemas/RequestDefinition"
994998 maximumNumberOfRequestToReturnInVerificationFailure:
995999 type: integer
996− oneOf:
997− - required:
998− - expectationIds
999− - required:
1000− - httpRequests
10011000 Ports:
10021001 description: "list of ports"
10031002 type: object
@@ -1007,14 +1006,3 @@ components:
10071006 items:
10081007 type: number
10091008 type: array
1010− HttpRequestAndHttpResponse:
1011− description: "request and response"
1012− type: object
1013− additionalProperties: false
1014− properties:
1015− httpRequest:
1016− $ref: "#/components/schemas/HttpRequest"
1017− httpResponse:
1018− $ref: "#/components/schemas/HttpResponse"
1019− timestamp:
1020− type: string