Importing and exporting mock APIs between WireMock and WireMock Cloud.
example-stubs.json
:
Note
A current limitation of this approach is that response bodies represented as
files under the __files
directory will not be imported.
See how this can be worked around by uploading a WireMock project folder
and via the WireMock Java API.
example-stubs.json
into the mappings
directory
under your WireMock root and either restart WireMock or make a POST
request to the
reset API:
Note
If any of your stubs make use of response templating then you’ll need to ensure WireMock
is started with the --local-response-templating
CLI parameter
or Java equivalent.
Note It is not currently possible to import stubs that use the JWT and JWKS template helpers into WireMock.
mappings
directory that refer to response body files under __files
you can import this by dragging and dropping the project folder into the dialog.
Unlike the method involving a single JSON file described above, this will cause the
response bodies under __files
to be inlined.
__files
directory is to push it using WireMock’s Java API.
This method also inlines response bodies before sending them to WireMock Cloud: