OpenAPI
Push OpenAPI document to Git
Mock APIs
Teams
Organisations
Data sources
Database connections
Usage
Access control
Stub Mappings
- GETGet all stub mappings
- POSTCreate a new stub mapping
- DELDelete all stub mappings
- POSTReset stub mappings
- POSTPersist stub mappings
- POSTImport stub mappings
- GETGet stub mapping by ID
- PUTUpdate a stub mapping
- DELDelete a stub mapping
- POSTFind stub mappings matching metadata
- POSTDelete stub mappings matching metadata
Requests
OpenAPI
Imports
OpenAPI
Push OpenAPI document to Git
PUT
/
v1
/
mock-apis
/
{mockApiId}
/
open-api
/
push
curl --request PUT \
--url https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/open-api/push \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '{
"push": {
"outOfSyncPolicy": "abort"
}
}'
{
"job": {
"id": "5947aff3-947b-4dfb-90f5-d324684e97db",
"jobType": "open-api-git-pull",
"status": "ERROR",
"started": "2024-09-05T10:20:46.143759190Z",
"links": {
"self": "/v1/mock-apis/0ozge/__admin/etc/jobs/5947aff3-947b-4dfb-90f5-d324684e97db"
},
"finished": "2024-09-05T10:20:46.200386224Z",
"elapsed": "PT0.056627034S",
"outcome": {
"errorCode": "NO_LOCAL_HEAD",
"errors": [
{
"code": 112,
"title": "No previous pull",
"detail": "This is the first time pulling from Git."
}
]
}
}
}
Authorizations
Basic authentication header of the form Basic <encoded-value>
, where <encoded-value>
is the base64-encoded string username:password
.
Path Parameters
The ID of the Mock API
Required string length:
5 - 10
Body
application/json
curl --request PUT \
--url https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/open-api/push \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '{
"push": {
"outOfSyncPolicy": "abort"
}
}'
{
"job": {
"id": "5947aff3-947b-4dfb-90f5-d324684e97db",
"jobType": "open-api-git-pull",
"status": "ERROR",
"started": "2024-09-05T10:20:46.143759190Z",
"links": {
"self": "/v1/mock-apis/0ozge/__admin/etc/jobs/5947aff3-947b-4dfb-90f5-d324684e97db"
},
"finished": "2024-09-05T10:20:46.200386224Z",
"elapsed": "PT0.056627034S",
"outcome": {
"errorCode": "NO_LOCAL_HEAD",
"errors": [
{
"code": 112,
"title": "No previous pull",
"detail": "This is the first time pulling from Git."
}
]
}
}
}