{"swaggerDoc":{"openapi":"3.0.0","info":{"title":"Mockiato","description":"","contact":{},"version":"1.0.0"},"servers":[{"url":"{mockiatoUrl}/api","variables":{"mockiatoUrl":{"default":"http://mockiato.optum.com"}}}],"paths":{"/login":{"post":{"tags":["token"],"description":"returns an access token for the user","parameters":[],"requestBody":{"description":"your MS credentials","content":{"application/json":{"schema":{"description":"your MS credentials","$ref":"#/components/requestBodies/AuthReq"}}},"required":true},"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"description":"successful response","$ref":"#/components/responses/AuthRes"}}}},"401":{"description":"authentication failure","content":{"application/json":{"schema":{"$ref":"#/components/responses/AuthRes"}}}}}}},"/services":{"get":{"tags":["services"],"description":"retrieves the virtual services","parameters":[{"name":"sut","in":"query","description":"name of system under test","required":false,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"user","in":"query","description":"name of user","required":false,"style":"simple","explode":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Service"},"description":"successful response"}}}}}},"post":{"tags":["services"],"description":"creates a new virtual service","security":{"JWT":[]},"parameters":[{"name":"x-access-token","in":"header","required":true,"description":"your access token","style":"simple","explode":false,"schema":{"type":"string"}}],"requestBody":{"description":"the service to create","content":{"application/json":{"schema":{"description":"the service to create","$ref":"#/components/schemas/Service"}}},"required":false},"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"description":"successful response","$ref":"#/components/schemas/Service"}}}}}}},"/services/search":{"get":{"tags":["services"],"description":"retrieves the virtual services","parameters":[{"name":"requestContains","in":"query","description":"Filters only services that have rr pairs that contain this string in their request","required":false,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"responseContains","in":"query","description":"Filters only services that have rr pairs that contain this string in their response","required":false,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"name","in":"query","description":"Filters on name of service","required":false,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"sortBy","in":"query","description":"created sorts on created datetime, updated sorts on updated datetime","required":false,"style":"simple","explode":false,"schema":{"type":"string","example":"created"}},{"name":"asc","in":"query","description":"if set (any value or none), sort ascending instead of descending","required":false,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"authorizedOnly","in":"query","description":"When passed a username, restricts results to only services that user is authorized to edit.","required":false,"style":"simple","explode":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Service"},"description":"successful response"}}}}}}},"/services/{id}":{"get":{"tags":["services"],"description":"retrieves a virtual service","parameters":[{"name":"id","in":"path","description":"ID of service to fetch","required":true,"style":"simple","explode":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"description":"successful response","$ref":"#/components/schemas/Service"}}}}}},"put":{"tags":["services"],"description":"updates a virtual service","security":{"JWT":[]},"parameters":[{"name":"id","in":"path","description":"ID of service to update","required":true,"style":"simple","explode":false,"schema":{"type":"integer","format":"int64"}},{"name":"x-access-token","in":"header","required":true,"description":"your access token","style":"simple","explode":false,"schema":{"type":"string"}}],"requestBody":{"description":"the service to update","content":{"application/json":{"schema":{"description":"the service to update","$ref":"#/components/schemas/Service"}}},"required":false},"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"description":"successful response","$ref":"#/components/schemas/Service"}}}}}},"delete":{"tags":["services"],"description":"removes a virtual service","security":{"JWT":[]},"parameters":[{"name":"id","in":"path","description":"ID of service to remove","required":true,"style":"simple","explode":false,"schema":{"type":"integer","format":"int64"}},{"name":"x-access-token","in":"header","required":true,"description":"your access token","style":"simple","explode":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"description":"successful response"}}}}}}},"/services/{id}/rrpairs":{"get":{"tags":["services"],"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RRPair"},"description":"successful response"}}}}}},"patch":{"tags":["services"],"requestBody":{"description":"An RR pair to add to this service","content":{"application/json":{"schema":{"description":"the service to update","$ref":"#/components/schemas/RRPair"}}}},"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RRPair"},"description":"successful response"}}}}}}},"/services/{id}/recorded":{"get":{"description":"Gets all recorded pairs from Live Invocation recording for this service","tags":["services"],"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RRPair"},"description":"successful response"}}}}}}},"/services/{id}/recorded/{rrPaidId}":{"patch":{"description":"Merges a recorded RR pair into the service","tags":["services"],"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RRPair"},"description":"successful response"}}}}}},"delete":{"description":"Deletes a recorded RR pair","tags":["services"],"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RRPair"},"description":"successful response"}}}}}}},"/services/fromSpec/upload":{"post":{"tags":["services"],"security":{"JWT":[]},"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"type":"string","description":"the ID of the uploaded file"}}}}}}},"/services/fromSpec/publish":{"post":{"tags":["services"],"description":"creates a virtual service from OpenAPI or WSDL","security":{"JWT":[]},"parameters":[{"name":"x-access-token","in":"header","required":true,"description":"your access token","style":"simple","explode":false,"schema":{"type":"string"}},{"name":"name","in":"query","description":"name of service to create","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"type","in":"query","description":"type of spec (e.g. openapi, wsdl)","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"group","in":"query","description":"group to add the service to","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"url","in":"query","description":"the url to the spec","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"base","in":"query","description":"use this to overwrite the base path defined in the spec","required":false,"style":"simple","explode":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"description":"successful response","$ref":"#/components/schemas/Service"}}}}}}},"/services/fromPairs/upload":{"post":{"tags":["services"],"security":{"JWT":[]},"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"type":"string","description":"the ID of the uploaded file"}}}}}}},"/services/fromPairs/publish":{"post":{"tags":["services"],"security":{"JWT":[]},"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Service"},"description":"successful response"}}}}}}},"/services/{id}/toggle":{"post":{"tags":["services"],"description":"toggles a virtual service on / off","security":{"JWT":[]},"parameters":[{"name":"id","in":"path","description":"ID of service to update","required":true,"style":"simple","explode":false,"schema":{"type":"integer","format":"int64"}},{"name":"x-access-token","in":"header","required":true,"description":"your access token","style":"simple","explode":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"toggle response","content":{"application/json":{"schema":{"description":"toggle response","$ref":"#/components/responses/ToggleResponse"}}}}}}},"/services/sut/{name}":{"get":{"tags":["services"],"description":"retrieves virtual services by system under test","parameters":[{"name":"name","in":"path","description":"name of system under test","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Service"},"description":"successful response"}}}}}}},"/services/user/{name}":{"get":{"tags":["services"],"description":"retrieves virtual services by owner","parameters":[{"name":"name","in":"path","description":"name of user / owner","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Service"},"description":"successful response"}}}}}}},"/services/archive":{"get":{"tags":["archives"],"description":"retrieves virtual services by owner","parameters":[{"name":"user","in":"path","description":"name of user / owner","required":false,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"sut","in":"path","description":"name of system under test","required":false,"style":"simple","explode":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Service"},"description":"successful response"}}}}}}},"/services/archive/{id}":{"delete":{"tags":["archives"],"description":"retrieves a virtual service","security":{"JWT":[]},"parameters":[{"name":"id","in":"path","description":"ID of service to fetch","required":true,"style":"simple","explode":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"description":"successful response","$ref":"#/components/schemas/Service"}}}}}}},"/services/archive/{id}/restore":{"post":{"tags":["archives"],"security":{"JWT":[]},"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Service"},"description":"successful response"}}}}}}},"/services/sut/{name}/archive":{"get":{"tags":["archives"],"description":"retrieves archived services by system under test","parameters":[{"name":"name","in":"path","description":"name of system under test","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Service"},"description":"successful response"}}}}}}},"/services/user/{name}/archive":{"get":{"tags":["archives"],"description":"retrieves archived services by owner","parameters":[{"name":"name","in":"path","description":"name of user / owner","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Service"},"description":"successful response"}}}}}}},"/recording":{"get":{"tags":["recordings"],"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Recording"},"description":"successful response"}}}}}},"put":{"tags":["recordings"],"security":{"JWT":[]},"requestBody":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Recording"},"description":"the recording to create"}}}},"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Recording"},"description":"successful response"}}}}}}},"/recording/{id}":{"get":{"tags":["recordings"],"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Recording"},"description":"successful response"}}}}}},"delete":{"tags":["recordings"],"security":{"JWT":[]},"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Recording"},"description":"successful response"}}}}}}},"/recording/{id}/{index}":{"get":{"tags":["recordings"],"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Recording"},"description":"successful response"}}}}}}},"/recording/{id}/stop":{"patch":{"description":"Stops a recorder. A stopped recorder will not be deleted, but will not accept any more incoming requests.","parameters":[{"name":"id","in":"path","description":"id of Recording","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"tags":["recordings"],"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Recording"},"description":"successful response"}}}}}}},"/recording/{id}/start":{"patch":{"parameters":[{"name":"id","in":"path","description":"id of Recording","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"description":"Start a recorder, and make it accept incoming requests again.","tags":["recordings"],"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Recording"},"description":"successful response"}}}}}}},"/systems":{"get":{"tags":["systems"],"description":"retrieves all systems under test","parameters":[],"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/System"},"description":"successful response"}}}}}},"post":{"tags":["systems"],"description":"creates a new system under test","security":{"JWT":[]},"parameters":[],"requestBody":{"description":"the SUT to create","content":{"application/json":{"schema":{"description":"the SUT to create","$ref":"#/components/schemas/System"}}},"required":false},"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"description":"successful response","$ref":"#/components/schemas/System"}}}}}}},"/systems/{name}":{"get":{"tags":["systems"],"description":"retrieves a systems under test by name","parameters":[],"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"description":"successful response","$ref":"#/components/schemas/System"}}}}}},"put":{"tags":["systems"],"security":{"JWT":[]},"description":"updates a systems under test","requestBody":{"description":"the updated SUT","content":{"application/json":{"schema":{"description":"the updated SUT","$ref":"#/components/schemas/System"}}}},"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"description":"successful response","$ref":"#/components/schemas/System"}}}}}},"delete":{"tags":["systems"],"description":"removes a system under test","security":{"JWT":[]},"parameters":[{"name":"name","in":"path","description":"name of system to remove","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"x-access-token","in":"header","required":true,"description":"your access token","style":"simple","explode":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"description":"successful response"}}}}}}},"/users":{"get":{"tags":["users"],"description":"retrieves all users","parameters":[],"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/User"},"description":"successful response"}}}}}}},"/users/{name}":{"delete":{"tags":["users"],"description":"removes a system under test","security":{"JWT":[]},"parameters":[{"name":"name","in":"path","description":"uid of user to remove","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"x-access-token","in":"header","required":true,"description":"your access token","style":"simple","explode":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"successful response","content":{"application/json":{"schema":{"description":"successful response"}}}}}}},"/report":{"get":{"tags":["report"],"description":"retrieves a report of total services, users, etc","responses":{"200":{"description":"report","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Report"},"description":"report"}}}}}}}},"components":{"securitySchemes":{"JWT":{"type":"apiKey","description":"Access token retrieved by POSTing credentials to /api/login","name":"x-access-token","in":"header"}},"requestBodies":{"AuthReq":{"title":"AuthReq","required":["username","password"],"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string","format":"password"}}}},"responses":{"AuthRes":{"title":"AuthRes","type":"object","properties":{"success":{"type":"boolean"},"token":{"type":"string"},"message":{"type":"string"}}},"ToggleResponse":{"title":"ToggleResponse","type":"object","properties":{"message":{"type":"string"},"service":{"$ref":"#/components/schemas/Service"}}}},"schemas":{"Service":{"title":"Service","type":"object","properties":{"sut":{"$ref":"#/components/schemas/System"},"user":{"$ref":"#/components/schemas/User"},"name":{"type":"string"},"type":{"type":"string"},"basePath":{"type":"string"},"matchTemplates":{"type":"array","items":{"type":"string"}},"rrpairs":{"type":"array","items":{"$ref":"#/components/schemas/RRPair"},"description":""},"delay":{"type":"integer","format":"int64"},"running":{"type":"boolean"}}},"System":{"title":"System","type":"object","properties":{"name":{"type":"string"},"members":{"type":"array","items":{"$ref":"#/components/schemas/User"}}}},"RRPair":{"title":"RRPair","type":"object","properties":{"verb":{"type":"string"},"path":{"type":"string"},"payloadType":{"type":"string"},"reqHeaders":{"type":"object"},"reqData":{"type":"object"},"resStatus":{"type":"integer","format":"int64"},"resHeaders":{"type":"object"},"resData":{"type":"object"}}},"User":{"title":"User","type":"object","properties":{"uid":{"type":"string"},"mail":{"type":"string"}}},"Recording":{"title":"Recording","type":"object","properties":{"service":{"$ref":"#/components/schemas/Service"},"sut":{"$ref":"#/components/schemas/System"},"path":{"type":"string"},"remoteHost":{"type":"string"},"remotePort":{"type":"integer","format":"int64"},"payloadType":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"ssl":{"type":"boolean"},"headerMask":{"type":"array","items":{"type":"string"}}}},"Report":{"title":"Report","type":"object","properties":{"totalServices":{"type":"integer"},"activeServices":{"type":"integer"},"draftServices":{"type":"integer"},"archiveServices":{"type":"integer"},"users":{"type":"integer"},"systems":{"type":"integer"},"totalTransactions":{"type":"integer"}}}}},"tags":[{"name":"services","description":""},{"name":"recordings","description":""},{"name":"archives","description":""},{"name":"systems","description":""},{"name":"users","description":""},{"name":"token","description":""}]},"customOptions":{}}