@@ -4,7 +4,7 @@ servers:
44 - url: 'https://localhost:1080/'
55info:
66 title: MockServer API
7− version: 5.15.x
7+ version: 5.13.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 expectations (only supported by MockServer)
21+ description: Create or update expectations - updates if the id matches an existing expecations (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− title: list of upserted expectations
39+ description: "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− title: list of upserted expectations
66+ description: "list of upserted expectations"
6767 type: array
6868 additionalProperties: false
6969 items:
@@ -89,6 +89,15 @@ 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"
92101 requestBody:
93102 content:
94103 application/json:
@@ -96,7 +105,7 @@ paths:
96105 oneOf:
97106 - $ref: "#/components/schemas/RequestDefinition"
98107 - $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
100109 /mockserver/reset:
101110 put:
102111 tags:
@@ -116,12 +125,14 @@ paths:
116125 schema:
117126 type: string
118127 enum: [ "java", "json", "log_entries" ]
119− description: changes response format, default if not specified is "json", supported values are "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"
120130 - in: query
121131 name: type
122132 schema:
123133 type: string
124134 enum: [ "logs", "requests", "request_responses", "recorded_expectations", "active_expectations" ]
135+ required: false
125136 description: specifies the type of object that is retrieve, default if not specified is "requests", supported values are "logs", "requests", "recorded_expectations", "active_expectations"
126137 responses:
127138 '200':
@@ -137,7 +148,11 @@ paths:
137148 - type: array
138149 additionalProperties: false
139150 items:
140− $ref: "#/components/schemas/HttpResponse"
151+ $ref: "#/components/schemas/HttpRequest"
152+ - type: array
153+ additionalProperties: false
154+ items:
155+ $ref: "#/components/schemas/HttpRequestAndHttpResponse"
141156 application/java:
142157 schema:
143158 type: string
@@ -257,7 +272,7 @@ paths:
257272components:
258273 schemas:
259274 Expectations:
260− title: "list of expectations"
275+ description: "list of expectations"
261276 oneOf:
262277 - $ref: "#/components/schemas/Expectation"
263278 - type: array
@@ -265,7 +280,7 @@ components:
265280 items:
266281 $ref: "#/components/schemas/Expectation"
267282 Expectation:
268− title: "expectation"
283+ description: "expectation"
269284 type: object
270285 additionalProperties: false
271286 properties:
@@ -275,8 +290,6 @@ components:
275290 type: integer
276291 httpRequest:
277292 $ref: "#/components/schemas/RequestDefinition"
278− openAPIDefinition:
279− $ref: "#/components/schemas/OpenAPIDefinition"
280293 httpResponse:
281294 $ref: "#/components/schemas/HttpResponse"
282295 httpResponseTemplate:
@@ -301,8 +314,29 @@ components:
301314 $ref: "#/components/schemas/Times"
302315 timeToLive:
303316 $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
304338 ExpectationId:
305− title: "pointer to existing expectation"
339+ description: "pointer to existing expectation"
306340 type: object
307341 additionalProperties: false
308342 properties:
@@ -311,7 +345,7 @@ components:
311345 required:
312346 - id
313347 OpenAPIExpectations:
314− title: "list of open api expectations"
348+ description: "list of open api expectations"
315349 oneOf:
316350 - $ref: "#/components/schemas/OpenAPIExpectation"
317351 - type: array
@@ -319,7 +353,7 @@ components:
319353 items:
320354 $ref: "#/components/schemas/OpenAPIExpectation"
321355 OpenAPIExpectation:
322− title: "open api or swagger expectation"
356+ description: "open api or swagger expectation"
323357 type: object
324358 additionalProperties: false
325359 properties:
@@ -334,12 +368,12 @@ components:
334368 required:
335369 - specUrlOrPayload
336370 RequestDefinition:
337− title: "request definition"
371+ description: "request definition"
338372 oneOf:
339373 - $ref: "#/components/schemas/HttpRequest"
340374 - $ref: "#/components/schemas/OpenAPIDefinition"
341375 HttpRequest:
342− title: "request properties matcher"
376+ description: "request properties matcher"
343377 type: object
344378 additionalProperties: false
345379 properties:
@@ -363,10 +397,8 @@ components:
363397 $ref: "#/components/schemas/KeyToValue"
364398 socketAddress:
365399 $ref: "#/components/schemas/SocketAddress"
366− protocol:
367− $ref: "#/components/schemas/Protocol"
368400 OpenAPIDefinition:
369− title: "open api or swagger request matcher"
401+ description: "open api or swagger request matcher"
370402 type: object
371403 additionalProperties: false
372404 properties:
@@ -375,7 +407,7 @@ components:
375407 operationId:
376408 type: string
377409 HttpResponse:
378− title: "response to return"
410+ description: "response to return"
379411 type: object
380412 additionalProperties: false
381413 properties:
@@ -394,7 +426,7 @@ components:
394426 reasonPhrase:
395427 type: string
396428 HttpTemplate:
397− title: "template to generate response / request"
429+ description: "template to generate response / request"
398430 type: object
399431 additionalProperties: false
400432 properties:
@@ -408,7 +440,7 @@ components:
408440 template:
409441 type: string
410442 HttpForward:
411− title: host and port to forward to
443+ description: "host and port to forward to"
412444 type: object
413445 additionalProperties: false
414446 properties:
@@ -423,7 +455,7 @@ components:
423455 - HTTP
424456 - HTTPS
425457 HttpClassCallback:
426− title: class callback
458+ description: "class callback"
427459 type: object
428460 additionalProperties: false
429461 properties:
@@ -432,7 +464,7 @@ components:
432464 callbackClass:
433465 type: string
434466 HttpObjectCallback:
435− title: object / method callback
467+ description: "object / method callback"
436468 type: object
437469 additionalProperties: false
438470 properties:
@@ -443,7 +475,7 @@ components:
443475 responseCallback:
444476 type: boolean
445477 HttpOverrideForwardedRequest:
446− title: override forwarded request
478+ description: "override forwarded request"
447479 oneOf:
448480 - type: object
449481 additionalProperties: false
@@ -545,7 +577,7 @@ components:
545577 httpResponse:
546578 "$ref": "#/components/schemas/HttpResponse"
547579 HttpError:
548− title: error behaviour
580+ description: "error behaviour"
549581 type: object
550582 additionalProperties: false
551583 properties:
@@ -556,7 +588,7 @@ components:
556588 responseBytes:
557589 type: string
558590 Times:
559− title: "number of responses"
591+ description: "number of responses"
560592 type: object
561593 additionalProperties: false
562594 properties:
@@ -565,7 +597,7 @@ components:
565597 unlimited:
566598 type: boolean
567599 TimeToLive:
568− title: "time expectation is valid for"
600+ description: "time expectation is valid for"
569601 type: object
570602 additionalProperties: false
571603 properties:
@@ -655,7 +687,7 @@ components:
655687 # "^\\S+$":
656688 # $ref: "#/components/schemas/StringOrJsonSchema"
657689 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"
659691 oneOf:
660692 - type: string
661693 - type: object
@@ -686,7 +718,7 @@ components:
686718 - PIPE_DELIMITED
687719 - DEEP_OBJECT
688720 SocketAddress:
689− title: remote address to send request to
721+ description: "remote address to send request to, only used for request overrides"
690722 type: object
691723 additionalProperties: false
692724 properties:
@@ -698,239 +730,198 @@ components:
698730 enum:
699731 - HTTP
700732 - 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
847733 Body:
848734 description: "request body matcher"
849735 anyOf:
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
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
925865 BodyWithContentType:
926866 description: "response body"
927867 anyOf:
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"
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
934925 Delay:
935926 description: "response delay"
936927 type: object
@@ -972,6 +963,11 @@ components:
972963 $ref: "#/components/schemas/VerificationTimes"
973964 maximumNumberOfRequestToReturnInVerificationFailure:
974965 type: integer
966+ oneOf:
967+ - required:
968+ - expectationId
969+ - required:
970+ - httpRequest
975971 VerificationTimes:
976972 description: "number of request to verify"
977973 type: object
@@ -997,6 +993,11 @@ components:
997993 $ref: "#/components/schemas/RequestDefinition"
998994 maximumNumberOfRequestToReturnInVerificationFailure:
999995 type: integer
996+ oneOf:
997+ - required:
998+ - expectationIds
999+ - required:
1000+ - httpRequests
10001001 Ports:
10011002 description: "list of ports"
10021003 type: object
@@ -1006,3 +1007,14 @@ components:
10061007 items:
10071008 type: number
10081009 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