Hi! I've been looking into <WireMock Cloud's Provi...
# wiremock-cloud
b
Hi! I've been looking into WireMock Cloud's Provisioning API, and I have noticed a few things. As for _Create a new mock API_: • the schema and example in the documentation are not up-to-date (I meanwhile figured out the correct structure:
{ "mockApi": { "name": "..." } }
), • the responses I received from the endpoint expose the FQNs of internal classes, e.g.
mocklab.api.user.NewMockApiRequest
and
mocklab.api.user.NewMockApiRequestBody
.
Copy code
POST <https://api.wiremock.cloud/v1/mock-apis>
Authorization: Basic <credentials>
Content-Type: application/json

{
  "name": "Mock API for some service",
  "hostname": "a-custom-hostname"
}
Response:
Copy code
HTTP/2 400 Bad Request
{
  "code": 400,
  "message": "Unable to process JSON",
  "details": "Instantiation of [simple type, class mocklab.api.user.NewMockApiRequest] value failed for JSON property mockApi due to missing (therefore NULL) value for creator parameter mockApi which is a non-nullable type"
}
-----------------------------------------------------
Copy code
POST <https://api.wiremock.cloud/v1/mock-apis>
Authorization: Basic <credentials>
Content-Type: application/json

{
  "mockApi": "Mock API for some service",
  "hostname": "a-custom-hostname"
}
Response:
Copy code
HTTP/2 400 Bad Request
{
  "code": 400,
  "message": "Unable to process JSON",
  "details": "Cannot construct instance of `mocklab.api.user.NewMockApiRequestBody` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('Mock API for some service')"
}
----------------------------------------------------- As for the collaborator related endpoints: • Get and Add collaborators: Error 404 is returned for the free account for a valid API ID. It may be as expected but I personally expected at least my user to be returned for the 'Get all collaborators' endpoint, or a more meaningful error message for any of them, if the 'issue' is that collaborators are not supported on the free account. • Add collaborator: there is no schema mentioned in the documentation, only an example snippet. Does the example cover all available properties, or is there more to it?
Copy code
GET <https://api.wiremock.cloud/v1/mock-apis/><apiId>/collaborators
Authorization: Basic <credentials>
Response:
Copy code
HTTP/2 404 Not Found
{
  "code": 404,
  "message": "HTTP 404 Not Found"
}
t
The docs for this are in a terrible state, but we’re working on it right now. Probably a few weeks off publishing it but we can sneak you out some drafts in the meantime if that would help.
The class names in responses is dodgy though, so thanks for flagging that
👍 1
b
At the moment, the only questionable one is the 'Add new collaborator' endpoint but I can disable it for now and make a new release without that. I can revisit it once the docs are updated. Also, unless there are other endpoints not currently mentioned in the docs, I don't think the drafts will be necessary, but thank you though.
t
Yep, collaborators are no longer a thing. We’ve got a totally new ACL API now that’s a lot more flexible.
b
Oh, alright. In that case I'll disable support for all collaborators endpoints, and replace them later.
👍 1