From 9273234de3103f3b56eb7dd4b0f878c549e744ef Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Thu, 25 Apr 2024 15:06:36 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/dto/definition/HttpResponse.java | 5 +- .../api/dto/definition/ResponseBody.java | 8 +- .../parser/api/ApiImportAbstractParser.java | 95 + .../api/PostmanAbstractParserParser.java | 329 ++ .../api/parser/api/PostmanParser.java | 65 +- .../api/parser/api/Swagger3Parser.java | 91 +- .../parser/api/postman/PostmanCollection.java | 13 + .../api/postman/PostmanCollectionInfo.java | 10 + .../api/parser/api/postman/PostmanItem.java | 19 + .../parser/api/postman/PostmanKeyValue.java | 22 + .../parser/api/postman/PostmanRequest.java | 18 + .../parser/api/postman/PostmanResponse.java | 16 + .../ApiDefinitionImportUtilService.java | 7 +- .../metersphere/api/utils/ApiDataUtils.java | 32 + .../api/utils/JsonSchemaBuilder.java | 27 +- .../ApiDefinitionControllerTests.java | 24 + .../metersphere/api/parser/ParserTests.java | 8 - .../src/test/resources/file/postman.json | 2958 +++++++++++++++++ .../src/test/resources/file/postman2.json | 2652 +++++++++++++++ 19 files changed, 6275 insertions(+), 124 deletions(-) create mode 100644 backend/services/api-test/src/main/java/io/metersphere/api/parser/api/ApiImportAbstractParser.java create mode 100644 backend/services/api-test/src/main/java/io/metersphere/api/parser/api/PostmanAbstractParserParser.java create mode 100644 backend/services/api-test/src/main/java/io/metersphere/api/parser/api/postman/PostmanCollection.java create mode 100644 backend/services/api-test/src/main/java/io/metersphere/api/parser/api/postman/PostmanCollectionInfo.java create mode 100644 backend/services/api-test/src/main/java/io/metersphere/api/parser/api/postman/PostmanItem.java create mode 100644 backend/services/api-test/src/main/java/io/metersphere/api/parser/api/postman/PostmanKeyValue.java create mode 100644 backend/services/api-test/src/main/java/io/metersphere/api/parser/api/postman/PostmanRequest.java create mode 100644 backend/services/api-test/src/main/java/io/metersphere/api/parser/api/postman/PostmanResponse.java create mode 100644 backend/services/api-test/src/test/resources/file/postman.json create mode 100644 backend/services/api-test/src/test/resources/file/postman2.json diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/HttpResponse.java b/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/HttpResponse.java index fd85e3f8a6d4..cf39da84d9b1 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/HttpResponse.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/HttpResponse.java @@ -7,6 +7,7 @@ import java.io.Serial; import java.io.Serializable; +import java.util.ArrayList; import java.util.List; /** @@ -35,10 +36,10 @@ public class HttpResponse implements Serializable { @Schema(description = "响应请求头") @Valid - private List headers; + private List headers = new ArrayList<>(); @Schema(description = "响应请求体") @Valid - private ResponseBody body; + private ResponseBody body = new ResponseBody(); } diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/ResponseBody.java b/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/ResponseBody.java index 0407a912debe..b8417fb7551a 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/ResponseBody.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/ResponseBody.java @@ -23,15 +23,15 @@ public class ResponseBody implements Serializable { private String bodyType; @Valid - private JsonBody jsonBody; + private JsonBody jsonBody = new JsonBody(); @Valid - private XmlBody xmlBody; + private XmlBody xmlBody = new XmlBody(); @Valid - private RawBody rawBody; + private RawBody rawBody = new RawBody(); @Valid - private ResponseBinaryBody binaryBody; + private ResponseBinaryBody binaryBody = new ResponseBinaryBody(); } diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/ApiImportAbstractParser.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/ApiImportAbstractParser.java new file mode 100644 index 000000000000..a9c5d851c20b --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/ApiImportAbstractParser.java @@ -0,0 +1,95 @@ +package io.metersphere.api.parser.api; + + +import io.metersphere.api.dto.converter.ApiDefinitionImportDetail; +import io.metersphere.api.dto.request.ImportRequest; +import io.metersphere.api.dto.request.http.MsHTTPConfig; +import io.metersphere.api.dto.request.http.MsHTTPElement; +import io.metersphere.api.dto.request.http.body.*; +import io.metersphere.api.parser.ImportParser; +import io.metersphere.project.dto.environment.auth.NoAuth; +import io.metersphere.sdk.exception.MSException; +import io.metersphere.sdk.util.LogUtils; +import org.apache.commons.lang3.StringUtils; + +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.URI; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; + +public abstract class ApiImportAbstractParser implements ImportParser { + + protected String projectId; + + protected String getApiTestStr(InputStream source) { + StringBuilder testStr = null; + try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(source, StandardCharsets.UTF_8))) { + testStr = new StringBuilder(); + String inputStr; + while ((inputStr = bufferedReader.readLine()) != null) { + testStr.append(inputStr); + } + source.close(); + } catch (Exception e) { + LogUtils.error(e.getMessage(), e); + throw new MSException(e.getMessage()); + } + return StringUtils.isNotBlank(testStr) ? testStr.toString() : StringUtils.EMPTY; + } + + + + protected ApiDefinitionImportDetail buildApiDefinition(String name, String path, String method,String modulePath, ImportRequest importRequest) { + ApiDefinitionImportDetail apiDefinition = new ApiDefinitionImportDetail(); + apiDefinition.setName(name); + apiDefinition.setPath(formatPath(path)); + apiDefinition.setProtocol(importRequest.getProtocol()); + apiDefinition.setMethod(method); + apiDefinition.setProjectId(this.projectId); + apiDefinition.setCreateUser(importRequest.getUserId()); + apiDefinition.setModulePath(modulePath); + apiDefinition.setResponse(new ArrayList<>()); + return apiDefinition; + } + + protected MsHTTPElement buildHttpRequest(String name, String path, String method) { + MsHTTPElement request = new MsHTTPElement(); + request.setName(name); + // 路径去掉域名/IP 地址,保留方法名称及参数 + request.setPath(formatPath(path)); + request.setMethod(method); + request.setHeaders(new ArrayList<>()); + request.setQuery(new ArrayList<>()); + request.setRest(new ArrayList<>()); + request.setBody(new Body()); + MsHTTPConfig httpConfig = new MsHTTPConfig(); + httpConfig.setConnectTimeout(60000L); + httpConfig.setResponseTimeout(60000L); + request.setOtherConfig(httpConfig); + request.setAuthConfig(new NoAuth()); + Body body = new Body(); + body.setBinaryBody(new BinaryBody()); + body.setFormDataBody(new FormDataBody()); + body.setXmlBody(new XmlBody()); + body.setRawBody(new RawBody()); + body.setNoneBody(new NoneBody()); + body.setJsonBody(new JsonBody()); + body.setWwwFormBody(new WWWFormBody()); + body.setNoneBody(new NoneBody()); + body.setBodyType(Body.BodyType.NONE.name()); + request.setBody(body); + return request; + } + + protected String formatPath(String url) { + try { + URI urlObject = new URI(url); + return StringUtils.isBlank(urlObject.getPath()) ? url : urlObject.getPath(); + } catch (Exception ex) { + //只需要返回?前的路径 + return url.split("\\?")[0]; + } + } +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/PostmanAbstractParserParser.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/PostmanAbstractParserParser.java new file mode 100644 index 000000000000..a5c970abf8f9 --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/PostmanAbstractParserParser.java @@ -0,0 +1,329 @@ +package io.metersphere.api.parser.api; + + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.BooleanNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import com.fasterxml.jackson.databind.node.TextNode; +import io.metersphere.api.dto.ApiFile; +import io.metersphere.api.dto.converter.ApiDefinitionImportDetail; +import io.metersphere.api.dto.definition.HttpResponse; +import io.metersphere.api.dto.request.ImportRequest; +import io.metersphere.api.dto.request.http.MsHTTPElement; +import io.metersphere.api.dto.request.http.MsHeader; +import io.metersphere.api.dto.request.http.QueryParam; +import io.metersphere.api.dto.request.http.RestParam; +import io.metersphere.api.dto.request.http.body.Body; +import io.metersphere.api.dto.request.http.body.BodyParamType; +import io.metersphere.api.dto.request.http.body.FormDataKV; +import io.metersphere.api.dto.request.http.body.WWWFormKV; +import io.metersphere.api.parser.api.postman.PostmanItem; +import io.metersphere.api.parser.api.postman.PostmanKeyValue; +import io.metersphere.api.parser.api.postman.PostmanRequest; +import io.metersphere.api.parser.api.postman.PostmanResponse; +import io.metersphere.project.dto.environment.auth.BasicAuth; +import io.metersphere.project.dto.environment.auth.DigestAuth; +import io.metersphere.project.dto.environment.auth.HTTPAuthConfig; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang3.BooleanUtils; +import org.apache.commons.lang3.StringUtils; +import org.jetbrains.annotations.NotNull; + +import java.util.ArrayList; +import java.util.List; + +public abstract class PostmanAbstractParserParser extends ApiImportAbstractParser { + + + private static final String POSTMAN_AUTH_TYPE_BASIC = "basic"; + private static final String POSTMAN_AUTH_TYPE_DIGEST = "digest"; + + private static final String QUERY = "query"; + private static final String PATH = "path"; + private static final String VARIABLE = "variable"; + private static final String KEY = "key"; + private static final String VALUE = "value"; + private static final String RAW = "raw"; + private static final String TYPE = "type"; + private static final String DESCRIPTION = "description"; + private static final String USERNAME = "username"; + private static final String PASSWORD = "password"; + private static final String DISABLED = "disabled"; + private static final String MODE = "mode"; + private static final String FORM_DATA = "formdata"; + private static final String URL_ENCODED = "urlencoded"; + private static final String FILE = "file"; + private static final String OPTIONS = "options"; + private static final String La = "language"; + private static final String JSON = "json"; + private static final String XML = "xml"; + + + protected ApiDefinitionImportDetail parsePostman(PostmanItem requestItem, String modulePath, ImportRequest importRequest) { + PostmanRequest requestDesc = requestItem.getRequest(); + if (requestDesc == null) { + return null; + } + String url = StringUtils.EMPTY; + JsonNode urlNode = requestDesc.getUrl(); + //获取url + url = getUrl(urlNode, url); + ApiDefinitionImportDetail detail = buildApiDefinition(requestItem.getName(), url, requestDesc.getMethod(), modulePath, importRequest); + MsHTTPElement request = buildHttpRequest(requestItem.getName(), url, requestDesc.getMethod()); + //设置认证 + setAuth(requestDesc, request); + //设置基础参数 请求头 + setHeader(requestDesc, request); + if (urlNode instanceof ObjectNode urlObject) { + //设置query参数 + setQuery(urlObject, request); + //设置rest参数 + setRest(urlObject, request); + } + //设置body参数 + setBody(requestDesc, request); + // 其他设置 + PostmanItem.ProtocolProfileBehavior protocolProfileBehavior = requestItem.getProtocolProfileBehavior(); + request.getOtherConfig().setFollowRedirects(protocolProfileBehavior != null && + BooleanUtils.isTrue(protocolProfileBehavior.getFollowRedirects())); + request.getOtherConfig().setAutoRedirects(!request.getOtherConfig().getFollowRedirects()); + + detail.setRequest(request); + + //设置response + setResponseData(requestItem, detail); + + return detail; + } + + private static void setResponseData(PostmanItem requestItem, ApiDefinitionImportDetail detail) { + List response = requestItem.getResponse(); + if (CollectionUtils.isNotEmpty(response)) { + response.forEach(r -> { + HttpResponse httpResponse = new HttpResponse(); + //httpResponse.setId(IDGenerator.nextStr()); + httpResponse.setName(r.getName()); + httpResponse.setStatusCode(r.getCode().toString()); + if (CollectionUtils.isNotEmpty(r.getHeader())) { + r.getHeader().forEach(h -> { + MsHeader msHeader = getMsHeader(h); + httpResponse.getHeaders().add(msHeader); + }); + } + httpResponse.getBody().getJsonBody().setJsonValue(r.getBody() != null && r.getBody() instanceof TextNode ? r.getBody().asText() : StringUtils.EMPTY); + httpResponse.getBody().setBodyType(Body.BodyType.RAW.name()); + detail.getResponse().add(httpResponse); + }); + } + } + + @NotNull + private static MsHeader getMsHeader(PostmanKeyValue h) { + MsHeader msHeader = new MsHeader(); + msHeader.setKey(h.getKey()); + msHeader.setValue(h.getValue()); + msHeader.setDescription(h.getDescription() != null ? h.getDescription().asText() : StringUtils.EMPTY); + msHeader.setEnable(BooleanUtils.isFalse(h.isDisabled())); + return msHeader; + } + + private static void setBody(PostmanRequest requestDesc, MsHTTPElement request) { + JsonNode bodyNode = requestDesc.getBody(); + if (bodyNode != null) { + JsonNode modeNode = bodyNode.get(MODE); + if (modeNode != null) { + switch (modeNode.asText()) { + case FORM_DATA: + setFormData(bodyNode, request); + break; + case URL_ENCODED: + setWwwData(bodyNode, request); + break; + case RAW: + setRaw(bodyNode, request); + break; + case FILE: + setBinary(bodyNode, request); + break; + default: + break; + } + } + } + } + + private static void setRaw(JsonNode bodyNode, MsHTTPElement request) { + JsonNode rawNode = bodyNode.get(RAW); + JsonNode optionNode = bodyNode.get(OPTIONS); + if (optionNode != null) { + if (optionNode instanceof ObjectNode optionObject) { + JsonNode languageNode = optionObject.get(RAW).get(La); + if (languageNode instanceof TextNode languageText) { + if (StringUtils.equals(languageText.asText(), JSON)) { + request.getBody().setBodyType(Body.BodyType.JSON.name()); + request.getBody().getJsonBody().setJsonValue(rawNode instanceof TextNode ? rawNode.asText() : StringUtils.EMPTY); + } else if (StringUtils.equals(languageText.asText(), XML)) { + request.getBody().setBodyType(Body.BodyType.XML.name()); + request.getBody().getXmlBody().setValue(rawNode instanceof TextNode ? rawNode.asText() : StringUtils.EMPTY); + } else { + request.getBody().setBodyType(Body.BodyType.RAW.name()); + request.getBody().getRawBody().setValue(rawNode instanceof TextNode ? rawNode.asText() : StringUtils.EMPTY); + } + } + } + } + } + + private static void setBinary(JsonNode bodyNode, MsHTTPElement request) { + JsonNode fileNode = bodyNode.get(FILE); + if (fileNode != null) { + request.getBody().getBinaryBody().setFile(new ApiFile()); + } + request.getBody().setBodyType(Body.BodyType.BINARY.name()); + } + + private static void setWwwData(JsonNode bodyNode, MsHTTPElement request) { + JsonNode modeNode = bodyNode.get(URL_ENCODED); + if (modeNode instanceof ArrayNode urlEncodedArray) { + urlEncodedArray.forEach(u -> { + WWWFormKV wwwFormKV = new WWWFormKV(); + wwwFormKV.setKey(u.get(KEY).asText()); + wwwFormKV.setValue(u.get(VALUE).asText()); + wwwFormKV.setDescription(u.get(DESCRIPTION) instanceof TextNode ? u.get(DESCRIPTION).asText() : StringUtils.EMPTY); + wwwFormKV.setEnable(!(u.get(DISABLED) instanceof BooleanNode) || !u.get(DISABLED).asBoolean()); + request.getBody().getWwwFormBody().getFormValues().add(wwwFormKV); + }); + } + request.getBody().setBodyType(Body.BodyType.WWW_FORM.name()); + } + + private static void setFormData(JsonNode bodyNode, MsHTTPElement request) { + JsonNode modeNode = bodyNode.get(FORM_DATA); + if (modeNode instanceof ArrayNode formArray) { + formArray.forEach(f -> { + FormDataKV formDataKV = new FormDataKV(); + formDataKV.setKey(f.get(KEY).asText()); + String type = f.get(TYPE).asText(); + if (StringUtils.equals(type, FILE)) { + formDataKV.setParamType(BodyParamType.FILE.getValue()); + formDataKV.setFiles(new ArrayList<>()); + } else { + formDataKV.setParamType(BodyParamType.STRING.getValue()); + formDataKV.setValue(f.get(VALUE).asText()); + } + formDataKV.setDescription(f.get(DESCRIPTION) instanceof TextNode ? f.get(DESCRIPTION).asText() : StringUtils.EMPTY); + formDataKV.setEnable(!(f.get(DISABLED) instanceof BooleanNode) || !f.get(DISABLED).asBoolean()); + request.getBody().getFormDataBody().getFormValues().add(formDataKV); + }); + } + request.getBody().setBodyType(Body.BodyType.FORM_DATA.name()); + } + + private static void setRest(JsonNode urlObject, MsHTTPElement request) { + JsonNode restNode = urlObject.get(VARIABLE); + if (restNode instanceof ArrayNode restArray) { + restArray.forEach(r -> { + RestParam restParam = new RestParam(); + restParam.setKey(r.get(KEY).asText()); + restParam.setValue(r.get(VALUE).asText()); + restParam.setDescription(r.get(DESCRIPTION) instanceof TextNode ? r.get(DESCRIPTION).asText() : StringUtils.EMPTY); + restParam.setEnable(!(r.get(DISABLED) instanceof BooleanNode) || !r.get(DISABLED).asBoolean()); + request.getRest().add(restParam); + }); + } + } + + private static void setQuery(JsonNode urlObject, MsHTTPElement request) { + JsonNode queryNode = urlObject.get(QUERY); + if (queryNode instanceof ArrayNode queryArray) { + queryArray.forEach(q -> { + QueryParam queryParam = new QueryParam(); + queryParam.setKey(q.get(KEY).asText()); + queryParam.setValue(q.get(VALUE).asText()); + queryParam.setDescription(q.get(DESCRIPTION) instanceof TextNode ? q.get(DESCRIPTION).asText() : StringUtils.EMPTY); + queryParam.setEnable(!(q.get(DISABLED) instanceof BooleanNode) || !q.get(DISABLED).asBoolean()); + request.getQuery().add(queryParam); + }); + } + } + + private static void setHeader(PostmanRequest requestDesc, MsHTTPElement request) { + if (CollectionUtils.isNotEmpty(requestDesc.getHeader())) { + requestDesc.getHeader().forEach(h -> { + MsHeader msHeader = getMsHeader(h); + request.getHeaders().add(msHeader); + }); + } + } + + private static String getUrl(JsonNode urlNode, String url) { + if (urlNode instanceof ObjectNode urlObject) { + JsonNode pathNode = urlObject.get(PATH); + if (pathNode instanceof ArrayNode pathArray) { + StringBuilder path = new StringBuilder(); + pathArray.forEach(p -> { + if (p instanceof TextNode pathString) { + if (pathString.asText().startsWith(":")) { + path.append(StringUtils.join("/{", pathString.asText().substring(1), "}")); + } else { + path.append(StringUtils.join("/", pathString.asText())); + } + } + }); + url = path.toString(); + } + } else if (urlNode instanceof TextNode urlText) { + url = urlText.asText(); + } + return url; + } + + + private static void setAuth(PostmanRequest requestDesc, MsHTTPElement request) { + JsonNode auth = requestDesc.getAuth(); + if (auth != null) { + JsonNode authNode = auth.get(TYPE); + HTTPAuthConfig authConfig = request.getAuthConfig(); + if (authNode != null && StringUtils.equals(authNode.asText(), POSTMAN_AUTH_TYPE_BASIC)) { + BasicAuth basicAuth = new BasicAuth(); + authConfig.setAuthType(HTTPAuthConfig.HTTPAuthType.BASIC.name()); + DigestAuth digestAuth = buildAuth(POSTMAN_AUTH_TYPE_BASIC, auth); + basicAuth.setUserName(digestAuth.getUserName()); + basicAuth.setPassword(digestAuth.getPassword()); + authConfig.setBasicAuth(basicAuth); + } else if (authNode != null && StringUtils.equals(authNode.asText(), POSTMAN_AUTH_TYPE_DIGEST)) { + DigestAuth digestAuth = buildAuth(POSTMAN_AUTH_TYPE_DIGEST, auth); + authConfig.setAuthType(HTTPAuthConfig.HTTPAuthType.DIGEST.name()); + authConfig.setDigestAuth(digestAuth); + } + request.setAuthConfig(authConfig); + } + } + + private static DigestAuth buildAuth(String type, JsonNode authNode) { + DigestAuth digestAuth = new DigestAuth(); + JsonNode digestNode = authNode.get(type); + if (digestNode != null) { + if (digestNode instanceof ObjectNode digestObject) { + JsonNode usernameNode = digestObject.get(USERNAME); + JsonNode passwordNode = digestObject.get(PASSWORD); + digestAuth.setUserName(usernameNode instanceof TextNode ? usernameNode.asText() : StringUtils.EMPTY); + digestAuth.setPassword(passwordNode instanceof TextNode ?passwordNode.asText() : StringUtils.EMPTY); + } else if (digestNode instanceof ArrayNode digestArray) { + digestArray.forEach(node -> { + JsonNode keyNode = node.get(KEY); + JsonNode valueNode = node.get(VALUE); + if (StringUtils.equals(keyNode.asText(), USERNAME)) { + digestAuth.setUserName(valueNode.asText()); + } else if (StringUtils.equals(keyNode.asText(), PASSWORD)) { + digestAuth.setPassword(valueNode.asText()); + } + }); + } + } + return digestAuth; + } + + +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/PostmanParser.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/PostmanParser.java index a9d1741cbae6..91ffededceac 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/PostmanParser.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/PostmanParser.java @@ -1,17 +1,74 @@ package io.metersphere.api.parser.api; +import com.fasterxml.jackson.core.JsonProcessingException; +import io.metersphere.api.dto.converter.ApiDefinitionImport; +import io.metersphere.api.dto.converter.ApiDefinitionImportDetail; import io.metersphere.api.dto.request.ImportRequest; -import io.metersphere.api.parser.ImportParser; +import io.metersphere.api.parser.api.postman.PostmanCollection; +import io.metersphere.api.parser.api.postman.PostmanItem; +import io.metersphere.sdk.exception.MSException; +import io.metersphere.sdk.util.JSON; import io.metersphere.sdk.util.LogUtils; +import org.apache.commons.lang3.StringUtils; +import java.io.FileInputStream; import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; -public class PostmanParser implements ImportParser { +public class PostmanParser extends PostmanAbstractParserParser { + + public static void main(String[] args) { + FileInputStream fis = null; + try { + fis = new FileInputStream("/Users/xiaogang/Downloads/json/postman.json"); + PostmanParser postmanParser = new PostmanParser(); + ImportRequest importRequest = new ImportRequest(); + importRequest.setProjectId("1"); + postmanParser.parse(fis, importRequest); + } catch (Exception e) { + e.printStackTrace(); + } + } @Override - public T parse(InputStream source, ImportRequest request) { + public ApiDefinitionImport parse(InputStream source, ImportRequest request) throws JsonProcessingException { LogUtils.info("PostmanParser parse"); - return null; + String testStr = getApiTestStr(source); + this.projectId = request.getProjectId(); + PostmanCollection postmanCollection = JSON.parseObject(testStr, PostmanCollection.class); + if (postmanCollection == null || postmanCollection.getItem() == null || postmanCollection.getItem().isEmpty() || postmanCollection.getInfo() == null){ + throw new MSException("Postman collection is empty"); + } + ApiDefinitionImport apiImport = new ApiDefinitionImport(); + List results = new ArrayList<>(); + + String modulePath = null; + if (StringUtils.isNotBlank(postmanCollection.getInfo().getName())) { + modulePath = "/" + postmanCollection.getInfo().getName(); + } + parseItem(postmanCollection.getItem(), modulePath, results, request); + apiImport.setData(results); + //apiImport.setCases(cases); + LogUtils.info("PostmanParser parse end"); + return apiImport; + } + + protected void parseItem(List items, String modulePath, List results, ImportRequest request) { + for (PostmanItem item : items) { + List childItems = item.getItem(); + if (childItems != null) { + String itemModulePath; + if (StringUtils.isNotBlank(modulePath) && StringUtils.isNotBlank(item.getName())) { + itemModulePath = modulePath + "/" + item.getName(); + } else { + itemModulePath = item.getName(); + } + parseItem(childItems, itemModulePath, results, request); + } else { + results.add(parsePostman(item, modulePath, request)); + } + } } } diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/Swagger3Parser.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/Swagger3Parser.java index 72506c315172..a6b19d826882 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/Swagger3Parser.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/Swagger3Parser.java @@ -1,21 +1,22 @@ package io.metersphere.api.parser.api; -import io.metersphere.api.constants.ApiConstants; import io.metersphere.api.dto.converter.ApiDefinitionImport; import io.metersphere.api.dto.converter.ApiDefinitionImportDetail; import io.metersphere.api.dto.definition.HttpResponse; import io.metersphere.api.dto.definition.ResponseBody; import io.metersphere.api.dto.request.ImportRequest; import io.metersphere.api.dto.request.MsCommonElement; -import io.metersphere.api.dto.request.http.*; -import io.metersphere.project.dto.environment.auth.NoAuth; +import io.metersphere.api.dto.request.http.MsHTTPElement; +import io.metersphere.api.dto.request.http.MsHeader; +import io.metersphere.api.dto.request.http.QueryParam; +import io.metersphere.api.dto.request.http.RestParam; import io.metersphere.api.dto.request.http.body.*; import io.metersphere.api.dto.schema.JsonSchemaItem; -import io.metersphere.api.parser.ImportParser; import io.metersphere.api.utils.ApiDataUtils; import io.metersphere.api.utils.JsonSchemaBuilder; import io.metersphere.plugin.api.spi.AbstractMsTestElement; import io.metersphere.project.constants.PropertyConstant; +import io.metersphere.project.dto.environment.auth.NoAuth; import io.metersphere.sdk.exception.MSException; import io.metersphere.sdk.util.JSON; import io.metersphere.sdk.util.LogUtils; @@ -35,15 +36,11 @@ import org.springframework.http.HttpMethod; import org.springframework.http.MediaType; -import java.io.BufferedReader; import java.io.InputStream; -import java.io.InputStreamReader; -import java.net.URI; -import java.nio.charset.StandardCharsets; import java.util.*; -public class Swagger3Parser implements ImportParser { +public class Swagger3Parser extends ApiImportAbstractParser { protected String projectId; private Components components; @@ -53,7 +50,6 @@ public class Swagger3Parser implements ImportParser { public static final String COOKIE = "cookie"; public static final String QUERY = "query"; - @Override public ApiDefinitionImport parse(InputStream source, ImportRequest request) throws Exception { LogUtils.info("Swagger3Parser parse"); List auths = setAuths(request); @@ -90,22 +86,6 @@ private List setAuths(ImportRequest request) { return CollectionUtils.size(auths) == 0 ? null : auths; } - protected String getApiTestStr(InputStream source) { - StringBuilder testStr = null; - try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(source, StandardCharsets.UTF_8))) { - testStr = new StringBuilder(); - String inputStr; - while ((inputStr = bufferedReader.readLine()) != null) { - testStr.append(inputStr); - } - source.close(); - } catch (Exception e) { - LogUtils.error(e.getMessage(), e); - throw new MSException(e.getMessage()); - } - return StringUtils.isNotBlank(testStr) ? testStr.toString() : StringUtils.EMPTY; - } - private List parseRequests(OpenAPI openAPI, ImportRequest importRequest) { Paths paths = openAPI.getPaths(); @@ -133,9 +113,9 @@ private List parseRequests(OpenAPI openAPI, ImportReq Operation operation = operationsMap.get(method); if (operation != null) { //构建基本请求 - ApiDefinitionImportDetail apiDefinitionDTO = buildApiDefinition(operation, pathName, method, importRequest); + ApiDefinitionImportDetail apiDefinitionDTO = buildSwaggerApiDefinition(operation, pathName, method, importRequest); //构建请求参数 - MsHTTPElement request = buildRequest(apiDefinitionDTO.getName(), pathName, method); + MsHTTPElement request = buildHttpRequest(apiDefinitionDTO.getName(), pathName, method); parseParameters(operation, request); parseParameters(pathItem, request); //构建请求体 @@ -330,7 +310,7 @@ private void setBodyData(String k, io.swagger.v3.oas.models.media.MediaType valu } } - private ApiDefinitionImportDetail buildApiDefinition(Operation operation, String path, String + private ApiDefinitionImportDetail buildSwaggerApiDefinition(Operation operation, String path, String method, ImportRequest importRequest) { String name; if (StringUtils.isNotBlank(operation.getSummary())) { @@ -340,44 +320,8 @@ private ApiDefinitionImportDetail buildApiDefinition(Operation operation, String } else { name = path; } - ApiDefinitionImportDetail apiDefinition = new ApiDefinitionImportDetail(); - apiDefinition.setName(name); - apiDefinition.setPath(formatPath(path)); - apiDefinition.setProtocol(ApiConstants.HTTP_PROTOCOL); - apiDefinition.setMethod(method); - apiDefinition.setProjectId(this.projectId); - apiDefinition.setCreateUser(importRequest.getUserId()); - apiDefinition.setModulePath(CollectionUtils.isNotEmpty(operation.getTags()) ? StringUtils.join("/", operation.getTags().get(0)) : StringUtils.EMPTY); - apiDefinition.setResponse(new ArrayList<>()); - return apiDefinition; - } - - protected MsHTTPElement buildRequest(String name, String path, String method) { - MsHTTPElement request = new MsHTTPElement(); - request.setName(name); - // 路径去掉域名/IP 地址,保留方法名称及参数 - request.setPath(formatPath(path)); - request.setMethod(method); - request.setHeaders(new ArrayList<>()); - request.setQuery(new ArrayList<>()); - request.setRest(new ArrayList<>()); - request.setBody(new Body()); - MsHTTPConfig httpConfig = new MsHTTPConfig(); - httpConfig.setConnectTimeout(60000L); - httpConfig.setResponseTimeout(60000L); - request.setOtherConfig(httpConfig); - request.setAuthConfig(new NoAuth()); - Body body = new Body(); - body.setBinaryBody(new BinaryBody()); - body.setFormDataBody(new FormDataBody()); - body.setXmlBody(new XmlBody()); - body.setRawBody(new RawBody()); - body.setNoneBody(new NoneBody()); - body.setJsonBody(new JsonBody()); - body.setWwwFormBody(new WWWFormBody()); - body.setNoneBody(new NoneBody()); - request.setBody(body); - return request; + String modulePath = CollectionUtils.isNotEmpty(operation.getTags()) ? StringUtils.join("/", operation.getTags().get(0)) : StringUtils.EMPTY; + return buildApiDefinition(name, path, method, modulePath, importRequest); } private void parseParameters(Operation operation, MsHTTPElement request) { @@ -754,17 +698,4 @@ private JsonSchemaItem parseArraySchema(Schema items, boolean onlyOnce) { return jsonSchemaArray; } - private String formatPath(String url) { - try { - URI urlObject = new URI(url); - String path = StringUtils.isBlank(urlObject.getPath()) ? url : urlObject.getPath(); - StringBuilder pathBuffer = new StringBuilder(path); - if (StringUtils.isNotEmpty(urlObject.getQuery())) { - pathBuffer.append("?").append(urlObject.getQuery()); - } - return pathBuffer.toString(); - } catch (Exception ex) { - return url; - } - } } diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/postman/PostmanCollection.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/postman/PostmanCollection.java new file mode 100644 index 000000000000..b0ca648875a8 --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/postman/PostmanCollection.java @@ -0,0 +1,13 @@ +package io.metersphere.api.parser.api.postman; + +import lombok.Data; + +import java.util.List; + +@Data +public class PostmanCollection { + + private PostmanCollectionInfo info; + private List item; + private List variable; +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/postman/PostmanCollectionInfo.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/postman/PostmanCollectionInfo.java new file mode 100644 index 000000000000..8deaed605b45 --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/postman/PostmanCollectionInfo.java @@ -0,0 +1,10 @@ +package io.metersphere.api.parser.api.postman; + +import lombok.Data; + +@Data +public class PostmanCollectionInfo { + private String postmanId; + private String name; + private String schema; +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/postman/PostmanItem.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/postman/PostmanItem.java new file mode 100644 index 000000000000..ef0385c41553 --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/postman/PostmanItem.java @@ -0,0 +1,19 @@ +package io.metersphere.api.parser.api.postman; + +import lombok.Data; + +import java.util.List; + +@Data +public class PostmanItem { + private String name; + private PostmanRequest request; + private List response; + private List item; + private ProtocolProfileBehavior protocolProfileBehavior; + + @Data + public class ProtocolProfileBehavior { + private Boolean followRedirects = true; + } +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/postman/PostmanKeyValue.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/postman/PostmanKeyValue.java new file mode 100644 index 000000000000..45ddb00c2031 --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/postman/PostmanKeyValue.java @@ -0,0 +1,22 @@ +package io.metersphere.api.parser.api.postman; + +import com.fasterxml.jackson.databind.JsonNode; +import lombok.Data; + +@Data +public class PostmanKeyValue { + private String key; + private String value; + private String type; + private JsonNode description; + private String contentType; + private boolean disabled; + + public PostmanKeyValue() { + } + + public PostmanKeyValue(String key, String value) { + this.key = key; + this.value = value; + } +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/postman/PostmanRequest.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/postman/PostmanRequest.java new file mode 100644 index 000000000000..e01cdb34af97 --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/postman/PostmanRequest.java @@ -0,0 +1,18 @@ +package io.metersphere.api.parser.api.postman; + + +import com.fasterxml.jackson.databind.JsonNode; +import lombok.Data; + +import java.util.List; + +@Data +public class PostmanRequest { + + private String method; + private String schema; + private List header; + private JsonNode body; + private JsonNode auth; + private JsonNode url; +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/postman/PostmanResponse.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/postman/PostmanResponse.java new file mode 100644 index 000000000000..d5b29e709f09 --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/postman/PostmanResponse.java @@ -0,0 +1,16 @@ +package io.metersphere.api.parser.api.postman; + +import com.fasterxml.jackson.databind.JsonNode; +import lombok.Data; + +import java.util.List; + +@Data +public class PostmanResponse { + + private Integer code; + private String name; + private String status; + private List header; + private JsonNode body; +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiDefinitionImportUtilService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiDefinitionImportUtilService.java index ffefcdbe45f8..ad189134c83e 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiDefinitionImportUtilService.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiDefinitionImportUtilService.java @@ -504,12 +504,15 @@ private void checkApiDataOnly(ImportRequest request, } } + /** + * 判断数据唯一性 通过method和path判断 有重复的数据 需要覆盖 + */ public void methodAndPath(List importData, List lists, ApiDetailWithData apiDetailWithData) { - Map apiDateMap = lists.stream().collect(Collectors.toMap(t -> t.getMethod() + t.getPath(), t -> t)); - Map importDataMap = importData.stream().collect(Collectors.toMap(t -> t.getMethod() + t.getPath(), t -> t)); + Map apiDateMap = lists.stream().collect(Collectors.toMap(t -> t.getMethod() + t.getPath(), t -> t, (oldValue, newValue) -> newValue)); + Map importDataMap = importData.stream().collect(Collectors.toMap(t -> t.getMethod() + t.getPath(), t -> t, (oldValue, newValue) -> newValue)); //判断是否重复 List orgList = apiDateMap.keySet().stream().toList(); List importList = importDataMap.keySet().stream().toList(); diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/utils/ApiDataUtils.java b/backend/services/api-test/src/main/java/io/metersphere/api/utils/ApiDataUtils.java index 178c3e6ce1ac..e58c7a2bd52d 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/utils/ApiDataUtils.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/utils/ApiDataUtils.java @@ -5,10 +5,12 @@ import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.json.JsonReadFeature; import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.databind.json.JsonMapper; import com.fasterxml.jackson.databind.jsontype.NamedType; +import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.databind.type.CollectionType; import io.metersphere.api.dto.request.MsCommonElement; import io.metersphere.api.dto.request.controller.*; @@ -53,6 +55,8 @@ private static void setObjectMapper(ObjectMapper objectMapper) { // 如果一个对象中没有任何的属性,那么在序列化的时候就会报错 objectMapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS); objectMapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true); + // 设置默认使用 BigDecimal 解析浮点数 + objectMapper.configure(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS, true); } public static String toJSONString(Object value) { @@ -133,4 +137,32 @@ public static void setResolvers(List> clazzList) { // 加入新的动态组件 clazzList.forEach(objectMapper::registerSubtypes); } + + public static JsonNode readTree(String content) { + try { + return objectMapper.readTree(content); + } catch (IOException e) { + throw new MSException(e); + } + } + + public static String writerWithDefaultPrettyPrinter(Object value) { + try { + return objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(value); + } catch (IOException e) { + throw new MSException(e); + } + } + + public static ObjectNode createObjectNode() { + return objectMapper.createObjectNode(); + } + + public static T convertValue(JsonNode jsonNode, Class valueType) { + try { + return objectMapper.convertValue(jsonNode, valueType); + } catch (Exception e) { + throw new MSException(e); + } + } } diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/utils/JsonSchemaBuilder.java b/backend/services/api-test/src/main/java/io/metersphere/api/utils/JsonSchemaBuilder.java index 620bf76a147b..58c53b096bd0 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/utils/JsonSchemaBuilder.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/utils/JsonSchemaBuilder.java @@ -1,12 +1,6 @@ package io.metersphere.api.utils; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.json.JsonReadFeature; -import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import com.fasterxml.jackson.databind.json.JsonMapper; import com.fasterxml.jackson.databind.node.*; import io.metersphere.jmeter.mock.Mock; import io.metersphere.project.constants.PropertyConstant; @@ -22,29 +16,14 @@ public class JsonSchemaBuilder { - private static final ObjectMapper objectMapper = JsonMapper.builder() - .enable(JsonReadFeature.ALLOW_UNESCAPED_CONTROL_CHARS) - .build(); - - static { - objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - // 支持json字符中带注释符 - objectMapper.configure(JsonParser.Feature.ALLOW_COMMENTS, true); - // 如果一个对象中没有任何的属性,那么在序列化的时候就会报错 - objectMapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS); - objectMapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true); - // 设置默认使用 BigDecimal 解析浮点数 - objectMapper.configure(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS, true); - } - public static String jsonSchemaToJson(String jsonSchemaString) { try { // 解析 JSON Schema 字符串为 JsonNode - JsonNode jsonSchemaNode = objectMapper.readTree(jsonSchemaString); + JsonNode jsonSchemaNode = ApiDataUtils.readTree(jsonSchemaString); Map processMap = new HashMap<>(); // 生成符合 JSON Schema 的 JSON JsonNode jsonNode = generateJson(jsonSchemaNode, processMap); - String jsonString = objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(jsonNode); + String jsonString = ApiDataUtils.writerWithDefaultPrettyPrinter(jsonNode); if (MapUtils.isNotEmpty(processMap)) { for (String str : processMap.keySet()) { jsonString = jsonString.replace(str, processMap.get(str)); @@ -58,7 +37,7 @@ public static String jsonSchemaToJson(String jsonSchemaString) { } private static JsonNode generateJson(JsonNode jsonSchemaNode, Map processMap) { - ObjectNode jsonNode = objectMapper.createObjectNode(); + ObjectNode jsonNode = ApiDataUtils.createObjectNode(); if (jsonSchemaNode instanceof NullNode) { return NullNode.getInstance(); diff --git a/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiDefinitionControllerTests.java b/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiDefinitionControllerTests.java index 803d899286fd..905ca29634d3 100644 --- a/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiDefinitionControllerTests.java +++ b/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiDefinitionControllerTests.java @@ -3,6 +3,7 @@ import io.metersphere.api.constants.ApiConstants; import io.metersphere.api.constants.ApiDefinitionDocType; import io.metersphere.api.constants.ApiDefinitionStatus; +import io.metersphere.api.constants.ApiImportPlatform; import io.metersphere.api.controller.result.ApiResultCode; import io.metersphere.api.domain.*; import io.metersphere.api.dto.ApiFile; @@ -1587,6 +1588,29 @@ public void testImport() throws Exception { paramMap.add("request", JSON.toJSONString(request)); this.requestMultipart(IMPORT, paramMap, status().is5xxServerError()); + request.setPlatform(ApiImportPlatform.Postman.name()); + request.setCoverModule(true); + request.setCoverData(true); + paramMap.clear(); + inputStream = new FileInputStream(new File( + Objects.requireNonNull(this.getClass().getClassLoader().getResource("file/postman.json")) + .getPath())); + file = new MockMultipartFile("file", "postman.json", MediaType.APPLICATION_OCTET_STREAM_VALUE, inputStream); + paramMap.add("file", file); + paramMap.add("request", JSON.toJSONString(request)); + this.requestMultipartWithOkAndReturn(IMPORT, paramMap); + paramMap.clear(); + request.setCoverModule(true); + request.setCoverData(true); + inputStream = new FileInputStream(new File( + Objects.requireNonNull(this.getClass().getClassLoader().getResource("file/postman2.json")) + .getPath())); + file = new MockMultipartFile("file", "postman2.json", MediaType.APPLICATION_OCTET_STREAM_VALUE, inputStream); + paramMap.add("file", file); + paramMap.add("request", JSON.toJSONString(request)); + this.requestMultipartWithOkAndReturn(IMPORT, paramMap); + + } protected MvcResult requestMultipart(String url, MultiValueMap paramMap, ResultMatcher resultMatcher) throws Exception { diff --git a/backend/services/api-test/src/test/java/io/metersphere/api/parser/ParserTests.java b/backend/services/api-test/src/test/java/io/metersphere/api/parser/ParserTests.java index ddcb8c1ac80a..43dd03c75a32 100644 --- a/backend/services/api-test/src/test/java/io/metersphere/api/parser/ParserTests.java +++ b/backend/services/api-test/src/test/java/io/metersphere/api/parser/ParserTests.java @@ -8,20 +8,12 @@ import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; -import java.util.Objects; - @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @TestMethodOrder(MethodOrderer.OrderAnnotation.class) @AutoConfigureMockMvc public class ParserTests { - @Test - @Order(2) - public void testImportParserPostman() throws Exception { - Objects.requireNonNull(ImportParserFactory.getImportParser(ApiImportPlatform.Postman.name())).parse(null, null); - } - @Test @Order(3) public void testImportParserMs() throws Exception { diff --git a/backend/services/api-test/src/test/resources/file/postman.json b/backend/services/api-test/src/test/resources/file/postman.json new file mode 100644 index 000000000000..c68e0bd04191 --- /dev/null +++ b/backend/services/api-test/src/test/resources/file/postman.json @@ -0,0 +1,2958 @@ +{ + "info": { + "_postman_id": "069b5a16-ea3b-4ef6-957c-5e1531515627", + "name": "Swagger Petstore - OpenAPI 3.0", + "description": "This is a sample Pet Store Server based on the OpenAPI 3.0 specification. You can find out more about\nSwagger at [https://swagger.io](https://swagger.io). In the third iteration of the pet store, we've switched to the design first approach!\nYou can now help us improve the API whether it's by making changes to the definition itself or to the code.\nThat way, with time, we can improve the API in general, and expose some of the new features in OAS3.\n\n_If you're looking for the Swagger 2.0/OAS 2.0 version of Petstore, then click [here](https://editor.swagger.io/?url=https://petstore.swagger.io/v2/swagger.yaml). Alternatively, you can load via the `Edit > Load Petstore OAS 2.0` menu option!_\n\nSome useful links:\n- [The Pet Store repository](https://github.com/swagger-api/swagger-petstore)\n- [The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)\n\nContact Support:\n Email: apiteam@swagger.io", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "8135699" + }, + "item": [ + { + "name": "pet", + "item": [ + { + "name": "findByStatus", + "item": [ + { + "name": "Finds Pets by status", + "protocolProfileBehavior": { + "disableUrlEncoding": true, + "followRedirects": false + }, + "request": { + "auth": { + "type": "basic", + "basic": [ + { + "key": "password", + "value": "312321", + "type": "string" + }, + { + "key": "username", + "value": "21321", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json", + "description": "2232132", + "disabled": true + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "12133", + "value": "2121", + "type": "text" + }, + { + "key": "21323", + "type": "file", + "src": "/Users/xiaogang/Downloads/json/循环.json" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/pet/findByStatus/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet", + "findByStatus", + ":id" + ], + "query": [ + { + "key": "status", + "value": "available", + "description": "Status values that need to be considered for filter", + "disabled": true + } + ], + "variable": [ + { + "key": "id", + "value": "" + } + ] + }, + "description": "Multiple status values can be provided with comma separated strings" + }, + "response": [ + { + "name": "successful operation", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "description": "Added as a part of security scheme: oauth2", + "key": "Authorization", + "value": "" + } + ], + "url": { + "raw": "{{baseUrl}}/pet/findByStatus?status=available", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet", + "findByStatus" + ], + "query": [ + { + "key": "status", + "value": "available", + "description": "Status values that need to be considered for filter" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "[\n {\n \"name\": \"\",\n \"photoUrls\": [\n \"\",\n \"\"\n ],\n \"id\": \"\",\n \"category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"tags\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n },\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"status\": \"sold\"\n },\n {\n \"name\": \"\",\n \"photoUrls\": [\n \"\",\n \"\"\n ],\n \"id\": \"\",\n \"category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"tags\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n },\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"status\": \"sold\"\n }\n]" + }, + { + "name": "Invalid status value", + "originalRequest": { + "method": "GET", + "header": [ + { + "description": "Added as a part of security scheme: oauth2", + "key": "Authorization", + "value": "" + } + ], + "url": { + "raw": "{{baseUrl}}/pet/findByStatus?status=available", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet", + "findByStatus" + ], + "query": [ + { + "key": "status", + "value": "available", + "description": "Status values that need to be considered for filter" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + } + ] + } + ] + }, + { + "name": "findByTags", + "item": [ + { + "name": "Finds Pets by tags", + "protocolProfileBehavior": { + "strictSSL": false, + "followOriginalHttpMethod": false, + "followAuthorizationHeader": false, + "removeRefererHeaderOnRedirect": true + }, + "request": { + "auth": { + "type": "noauth" + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/pet/findByTags?tags=&tags=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet", + "findByTags" + ], + "query": [ + { + "key": "tags", + "value": "", + "description": "Tags to filter by" + }, + { + "key": "tags", + "value": "", + "description": "Tags to filter by" + } + ] + }, + "description": "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing." + }, + "response": [ + { + "name": "successful operation", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "description": "Added as a part of security scheme: oauth2", + "key": "Authorization", + "value": "" + } + ], + "url": { + "raw": "{{baseUrl}}/pet/findByTags?tags=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet", + "findByTags" + ], + "query": [ + { + "key": "tags", + "value": "", + "description": "Tags to filter by" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "[\n {\n \"name\": \"\",\n \"photoUrls\": [\n \"\",\n \"\"\n ],\n \"id\": \"\",\n \"category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"tags\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n },\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"status\": \"sold\"\n },\n {\n \"name\": \"\",\n \"photoUrls\": [\n \"\",\n \"\"\n ],\n \"id\": \"\",\n \"category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"tags\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n },\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"status\": \"sold\"\n }\n]" + }, + { + "name": "Invalid tag value", + "originalRequest": { + "method": "GET", + "header": [ + { + "description": "Added as a part of security scheme: oauth2", + "key": "Authorization", + "value": "" + } + ], + "url": { + "raw": "{{baseUrl}}/pet/findByTags?tags=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet", + "findByTags" + ], + "query": [ + { + "key": "tags", + "value": "", + "description": "Tags to filter by" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + } + ] + } + ] + }, + { + "name": "{petId}", + "item": [ + { + "name": "uploadImage", + "item": [ + { + "name": "uploads an image", + "request": { + "auth": { + "type": "digest", + "digest": [ + { + "key": "algorithm", + "value": "MD5", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/octet-stream" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "1212", + "value": "12", + "description": "232", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/pet/:petId/uploadImage?additionalMetadata=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet", + ":petId", + "uploadImage" + ], + "query": [ + { + "key": "additionalMetadata", + "value": "", + "description": "Additional Metadata" + } + ], + "variable": [ + { + "key": "petId", + "value": "", + "description": "(Required) ID of pet to update" + } + ] + } + }, + "response": [ + { + "name": "successful operation", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/octet-stream" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "description": "Added as a part of security scheme: oauth2", + "key": "Authorization", + "value": "" + } + ], + "body": { + "mode": "file", + "file": {} + }, + "url": { + "raw": "{{baseUrl}}/pet/:petId/uploadImage?additionalMetadata=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet", + ":petId", + "uploadImage" + ], + "query": [ + { + "key": "additionalMetadata", + "value": "", + "description": "Additional Metadata" + } + ], + "variable": [ + { + "key": "petId" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"code\": \"\",\n \"type\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "Find pet by ID", + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "api_key", + "type": "string" + }, + { + "key": "value", + "value": "{{apiKey}}", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "[\n {\n \"id\": 10,\n \"name\": \"doggie\",\n \"category\": {\n \"id\": 1,\n \"name\": \"Dogs\"\n },\n \"photoUrls\": [\n \"string\"\n ],\n \"tags\": [\n {\n \"id\": 0,\n \"name\": \"string\"\n }\n ],\n \"status\": \"available\"\n }\n]", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/pet/:petId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet", + ":petId" + ], + "variable": [ + { + "key": "petId", + "value": "", + "description": "(Required) ID of pet to return" + } + ] + }, + "description": "Returns a single pet" + }, + "response": [ + { + "name": "successful operation", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "description": "Added as a part of security scheme: apikey", + "key": "api_key", + "value": "" + } + ], + "url": { + "raw": "{{baseUrl}}/pet/:petId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet", + ":petId" + ], + "variable": [ + { + "key": "petId" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"name\": \"\",\n \"photoUrls\": [\n \"\",\n \"\"\n ],\n \"id\": \"\",\n \"category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"tags\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n },\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"status\": \"sold\"\n}" + }, + { + "name": "Invalid ID supplied", + "originalRequest": { + "method": "GET", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "api_key", + "value": "" + } + ], + "url": { + "raw": "{{baseUrl}}/pet/:petId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet", + ":petId" + ], + "variable": [ + { + "key": "petId" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + }, + { + "name": "Pet not found", + "originalRequest": { + "method": "GET", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "api_key", + "value": "" + } + ], + "url": { + "raw": "{{baseUrl}}/pet/:petId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet", + ":petId" + ], + "variable": [ + { + "key": "petId" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + } + ] + }, + { + "name": "Updates a pet in the store with form data", + "request": { + "auth": { + "type": "oauth2", + "oauth2": [ + { + "key": "scope", + "value": "write:pets read:pets", + "type": "string" + }, + { + "key": "authUrl", + "value": "https://petstore3.swagger.io/oauth/authorize", + "type": "string" + }, + { + "key": "grant_type", + "value": "implicit", + "type": "string" + } + ] + }, + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "\n\n\t10\n\tdoggie\n\t\n\t\t1\n\t\tDogs\n\t\n\t\n\t\tstring\n\t\n\t\n\t\t\n\t\t\t0\n\t\t\tstring\n\t\t\n\t\n\tavailable\n", + "options": { + "raw": { + "language": "xml" + } + } + }, + "url": { + "raw": "{{baseUrl}}/pet/:petId?name=&status=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet", + ":petId" + ], + "query": [ + { + "key": "name", + "value": "", + "description": "Name of pet that needs to be updated" + }, + { + "key": "status", + "value": "", + "description": "Status of pet that needs to be updated" + } + ], + "variable": [ + { + "key": "petId", + "value": "", + "description": "(Required) ID of pet that needs to be updated" + } + ] + } + }, + "response": [ + { + "name": "Invalid input", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: oauth2", + "key": "Authorization", + "value": "" + } + ], + "url": { + "raw": "{{baseUrl}}/pet/:petId?name=&status=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet", + ":petId" + ], + "query": [ + { + "key": "name", + "value": "", + "description": "Name of pet that needs to be updated" + }, + { + "key": "status", + "value": "", + "description": "Status of pet that needs to be updated" + } + ], + "variable": [ + { + "key": "petId" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + } + ] + }, + { + "name": "Deletes a pet", + "request": { + "auth": { + "type": "oauth2", + "oauth2": [ + { + "key": "scope", + "value": "write:pets read:pets", + "type": "string" + }, + { + "key": "authUrl", + "value": "https://petstore3.swagger.io/oauth/authorize", + "type": "string" + }, + { + "key": "grant_type", + "value": "implicit", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "api_key", + "value": "" + } + ], + "body": { + "mode": "file", + "file": { + "src": "/Users/xiaogang/Downloads/json/循环.json" + } + }, + "url": { + "raw": "{{baseUrl}}/pet/:petId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet", + ":petId" + ], + "variable": [ + { + "key": "petId", + "value": "", + "description": "(Required) Pet id to delete" + } + ] + }, + "description": "delete a pet" + }, + "response": [ + { + "name": "Invalid pet value", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "api_key", + "value": "" + }, + { + "description": "Added as a part of security scheme: oauth2", + "key": "Authorization", + "value": "" + } + ], + "url": { + "raw": "{{baseUrl}}/pet/:petId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet", + ":petId" + ], + "variable": [ + { + "key": "petId" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + } + ] + } + ] + }, + { + "name": "Update an existing pet", + "request": { + "auth": { + "type": "oauth2", + "oauth2": [ + { + "key": "scope", + "value": "write:pets read:pets", + "type": "string" + }, + { + "key": "authUrl", + "value": "https://petstore3.swagger.io/oauth/authorize", + "type": "string" + }, + { + "key": "grant_type", + "value": "implicit", + "type": "string" + } + ] + }, + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "name", + "value": "", + "description": "(Required) " + }, + { + "key": "photoUrls", + "value": "", + "description": "(Required) " + }, + { + "key": "photoUrls", + "value": "", + "description": "(Required) " + }, + { + "key": "id", + "value": "" + }, + { + "key": "id", + "value": "" + }, + { + "key": "name", + "value": "" + }, + { + "key": "tags", + "value": "[object Object]" + }, + { + "key": "tags", + "value": "[object Object]" + }, + { + "key": "status", + "value": "sold", + "description": "pet status in the store" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/pet?qqq=qwwew", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet" + ], + "query": [ + { + "key": "qqq", + "value": "qwwew" + } + ] + }, + "description": "Update an existing pet by Id" + }, + "response": [ + { + "name": "Successful operation", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "description": "Added as a part of security scheme: oauth2", + "key": "Authorization", + "value": "" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "name", + "value": "", + "description": "(Required) " + }, + { + "key": "photoUrls", + "value": "", + "description": "(Required) " + }, + { + "key": "photoUrls", + "value": "", + "description": "(Required) " + }, + { + "key": "id", + "value": "" + }, + { + "key": "id", + "value": "" + }, + { + "key": "name", + "value": "" + }, + { + "key": "tags", + "value": "[object Object]" + }, + { + "key": "tags", + "value": "[object Object]" + }, + { + "key": "status", + "value": "sold", + "description": "pet status in the store" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/pet", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"name\": \"\",\n \"photoUrls\": [\n \"\",\n \"\"\n ],\n \"id\": \"\",\n \"category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"tags\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n },\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"status\": \"sold\"\n}" + }, + { + "name": "Invalid ID supplied", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + }, + { + "description": "Added as a part of security scheme: oauth2", + "key": "Authorization", + "value": "" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "name", + "value": "", + "description": "(Required) " + }, + { + "key": "photoUrls", + "value": "", + "description": "(Required) " + }, + { + "key": "photoUrls", + "value": "", + "description": "(Required) " + }, + { + "key": "id", + "value": "" + }, + { + "key": "id", + "value": "" + }, + { + "key": "name", + "value": "" + }, + { + "key": "tags", + "value": "[object Object]" + }, + { + "key": "tags", + "value": "[object Object]" + }, + { + "key": "status", + "value": "sold", + "description": "pet status in the store" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/pet", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + }, + { + "name": "Pet not found", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + }, + { + "description": "Added as a part of security scheme: oauth2", + "key": "Authorization", + "value": "" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "name", + "value": "", + "description": "(Required) " + }, + { + "key": "photoUrls", + "value": "", + "description": "(Required) " + }, + { + "key": "photoUrls", + "value": "", + "description": "(Required) " + }, + { + "key": "id", + "value": "" + }, + { + "key": "id", + "value": "" + }, + { + "key": "name", + "value": "" + }, + { + "key": "tags", + "value": "[object Object]" + }, + { + "key": "tags", + "value": "[object Object]" + }, + { + "key": "status", + "value": "sold", + "description": "pet status in the store" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/pet", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet" + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + }, + { + "name": "Validation exception", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + }, + { + "description": "Added as a part of security scheme: oauth2", + "key": "Authorization", + "value": "" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "name", + "value": "", + "description": "(Required) " + }, + { + "key": "photoUrls", + "value": "", + "description": "(Required) " + }, + { + "key": "photoUrls", + "value": "", + "description": "(Required) " + }, + { + "key": "id", + "value": "" + }, + { + "key": "id", + "value": "" + }, + { + "key": "name", + "value": "" + }, + { + "key": "tags", + "value": "[object Object]" + }, + { + "key": "tags", + "value": "[object Object]" + }, + { + "key": "status", + "value": "sold", + "description": "pet status in the store" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/pet", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet" + ] + } + }, + "status": "Unprocessable Entity (WebDAV) (RFC 4918)", + "code": 422, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + } + ] + }, + { + "name": "Add a new pet to the store", + "request": { + "auth": { + "type": "oauth2", + "oauth2": [ + { + "key": "scope", + "value": "write:pets read:pets", + "type": "string" + }, + { + "key": "authUrl", + "value": "https://petstore3.swagger.io/oauth/authorize", + "type": "string" + }, + { + "key": "grant_type", + "value": "implicit", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "name", + "value": "", + "description": "(Required) " + }, + { + "key": "photoUrls", + "value": "", + "description": "(Required) " + }, + { + "key": "photoUrls", + "value": "", + "description": "(Required) " + }, + { + "key": "id", + "value": "" + }, + { + "key": "id", + "value": "" + }, + { + "key": "name", + "value": "" + }, + { + "key": "tags", + "value": "[object Object]" + }, + { + "key": "tags", + "value": "[object Object]" + }, + { + "key": "status", + "value": "sold", + "description": "pet status in the store" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/pet", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet" + ] + }, + "description": "Add a new pet to the store" + }, + "response": [ + { + "name": "Successful operation", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "description": "Added as a part of security scheme: oauth2", + "key": "Authorization", + "value": "" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "name", + "value": "", + "description": "(Required) " + }, + { + "key": "photoUrls", + "value": "", + "description": "(Required) " + }, + { + "key": "photoUrls", + "value": "", + "description": "(Required) " + }, + { + "key": "id", + "value": "" + }, + { + "key": "id", + "value": "" + }, + { + "key": "name", + "value": "" + }, + { + "key": "tags", + "value": "[object Object]" + }, + { + "key": "tags", + "value": "[object Object]" + }, + { + "key": "status", + "value": "sold", + "description": "pet status in the store" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/pet", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"name\": \"\",\n \"photoUrls\": [\n \"\",\n \"\"\n ],\n \"id\": \"\",\n \"category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"tags\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n },\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"status\": \"sold\"\n}" + }, + { + "name": "Invalid input", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + }, + { + "description": "Added as a part of security scheme: oauth2", + "key": "Authorization", + "value": "" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "name", + "value": "", + "description": "(Required) " + }, + { + "key": "photoUrls", + "value": "", + "description": "(Required) " + }, + { + "key": "photoUrls", + "value": "", + "description": "(Required) " + }, + { + "key": "id", + "value": "" + }, + { + "key": "id", + "value": "" + }, + { + "key": "name", + "value": "" + }, + { + "key": "tags", + "value": "[object Object]" + }, + { + "key": "tags", + "value": "[object Object]" + }, + { + "key": "status", + "value": "sold", + "description": "pet status in the store" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/pet", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + }, + { + "name": "Validation exception", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + }, + { + "description": "Added as a part of security scheme: oauth2", + "key": "Authorization", + "value": "" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "name", + "value": "", + "description": "(Required) " + }, + { + "key": "photoUrls", + "value": "", + "description": "(Required) " + }, + { + "key": "photoUrls", + "value": "", + "description": "(Required) " + }, + { + "key": "id", + "value": "" + }, + { + "key": "id", + "value": "" + }, + { + "key": "name", + "value": "" + }, + { + "key": "tags", + "value": "[object Object]" + }, + { + "key": "tags", + "value": "[object Object]" + }, + { + "key": "status", + "value": "sold", + "description": "pet status in the store" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/pet", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet" + ] + } + }, + "status": "Unprocessable Entity (WebDAV) (RFC 4918)", + "code": 422, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + } + ] + } + ] + }, + { + "name": "store", + "item": [ + { + "name": "inventory", + "item": [ + { + "name": "Returns pet inventories by status", + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "api_key", + "type": "string" + }, + { + "key": "value", + "value": "{{apiKey}}", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/store/inventory", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "store", + "inventory" + ] + }, + "description": "Returns a map of status codes to quantities" + }, + "response": [ + { + "name": "successful operation", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "description": "Added as a part of security scheme: apikey", + "key": "api_key", + "value": "" + } + ], + "url": { + "raw": "{{baseUrl}}/store/inventory", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "store", + "inventory" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"do6\": \"\",\n \"culpac37\": \"\",\n \"ad_611\": \"\",\n \"laboris_1\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "order", + "item": [ + { + "name": "{orderId}", + "item": [ + { + "name": "Find purchase order by ID", + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/store/order/:orderId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "store", + "order", + ":orderId" + ], + "variable": [ + { + "key": "orderId", + "value": "", + "description": "(Required) ID of order that needs to be fetched" + } + ] + }, + "description": "For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions." + }, + "response": [ + { + "name": "successful operation", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/store/order/:orderId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "store", + "order", + ":orderId" + ], + "variable": [ + { + "key": "orderId" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"\",\n \"petId\": \"\",\n \"quantity\": \"\",\n \"shipDate\": \"\",\n \"status\": \"placed\",\n \"complete\": \"\"\n}" + }, + { + "name": "Invalid ID supplied", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/store/order/:orderId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "store", + "order", + ":orderId" + ], + "variable": [ + { + "key": "orderId" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + }, + { + "name": "Order not found", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/store/order/:orderId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "store", + "order", + ":orderId" + ], + "variable": [ + { + "key": "orderId" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + } + ] + }, + { + "name": "Delete purchase order by ID", + "request": { + "method": "DELETE", + "header": [], + "url": { + "raw": "{{baseUrl}}/store/order/:orderId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "store", + "order", + ":orderId" + ], + "variable": [ + { + "key": "orderId", + "value": "", + "description": "(Required) ID of the order that needs to be deleted" + } + ] + }, + "description": "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors" + }, + "response": [ + { + "name": "Invalid ID supplied", + "originalRequest": { + "method": "DELETE", + "header": [], + "url": { + "raw": "{{baseUrl}}/store/order/:orderId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "store", + "order", + ":orderId" + ], + "variable": [ + { + "key": "orderId" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + }, + { + "name": "Order not found", + "originalRequest": { + "method": "DELETE", + "header": [], + "url": { + "raw": "{{baseUrl}}/store/order/:orderId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "store", + "order", + ":orderId" + ], + "variable": [ + { + "key": "orderId" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + } + ] + } + ] + }, + { + "name": "Place an order for a pet", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "id", + "value": "" + }, + { + "key": "petId", + "value": "" + }, + { + "key": "quantity", + "value": "" + }, + { + "key": "shipDate", + "value": "" + }, + { + "key": "status", + "value": "placed", + "description": "Order Status" + }, + { + "key": "complete", + "value": "" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/store/order", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "store", + "order" + ] + }, + "description": "Place a new order in the store" + }, + "response": [ + { + "name": "successful operation", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "id", + "value": "" + }, + { + "key": "petId", + "value": "" + }, + { + "key": "quantity", + "value": "" + }, + { + "key": "shipDate", + "value": "" + }, + { + "key": "status", + "value": "placed", + "description": "Order Status" + }, + { + "key": "complete", + "value": "" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/store/order", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "store", + "order" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"\",\n \"petId\": \"\",\n \"quantity\": \"\",\n \"shipDate\": \"\",\n \"status\": \"placed\",\n \"complete\": \"\"\n}" + }, + { + "name": "Invalid input", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "id", + "value": "" + }, + { + "key": "petId", + "value": "" + }, + { + "key": "quantity", + "value": "" + }, + { + "key": "shipDate", + "value": "" + }, + { + "key": "status", + "value": "placed", + "description": "Order Status" + }, + { + "key": "complete", + "value": "" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/store/order", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "store", + "order" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + }, + { + "name": "Validation exception", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "id", + "value": "" + }, + { + "key": "petId", + "value": "" + }, + { + "key": "quantity", + "value": "" + }, + { + "key": "shipDate", + "value": "" + }, + { + "key": "status", + "value": "placed", + "description": "Order Status" + }, + { + "key": "complete", + "value": "" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/store/order", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "store", + "order" + ] + } + }, + "status": "Unprocessable Entity (WebDAV) (RFC 4918)", + "code": 422, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + } + ] + } + ] + } + ] + }, + { + "name": "user", + "item": [ + { + "name": "createWithList", + "item": [ + { + "name": "Creates list of users with given input array", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "[\n {\n \"id\": \"\",\n \"username\": \"\",\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"email\": \"\",\n \"password\": \"\",\n \"phone\": \"\",\n \"userStatus\": \"\"\n },\n {\n \"id\": \"\",\n \"username\": \"\",\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"email\": \"\",\n \"password\": \"\",\n \"phone\": \"\",\n \"userStatus\": \"\"\n }\n]", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/user/createWithList", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "user", + "createWithList" + ] + }, + "description": "Creates list of users with given input array" + }, + "response": [ + { + "name": "Successful operation", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "[\n {\n \"id\": \"\",\n \"username\": \"\",\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"email\": \"\",\n \"password\": \"\",\n \"phone\": \"\",\n \"userStatus\": \"\"\n },\n {\n \"id\": \"\",\n \"username\": \"\",\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"email\": \"\",\n \"password\": \"\",\n \"phone\": \"\",\n \"userStatus\": \"\"\n }\n]", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/user/createWithList", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "user", + "createWithList" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"\",\n \"username\": \"\",\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"email\": \"\",\n \"password\": \"\",\n \"phone\": \"\",\n \"userStatus\": \"\"\n}" + }, + { + "name": "successful operation", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "[\n {\n \"id\": \"\",\n \"username\": \"\",\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"email\": \"\",\n \"password\": \"\",\n \"phone\": \"\",\n \"userStatus\": \"\"\n },\n {\n \"id\": \"\",\n \"username\": \"\",\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"email\": \"\",\n \"password\": \"\",\n \"phone\": \"\",\n \"userStatus\": \"\"\n }\n]", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/user/createWithList", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "user", + "createWithList" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + } + ] + } + ] + }, + { + "name": "login", + "item": [ + { + "name": "Logs user into the system", + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/xml" + } + ], + "url": { + "raw": "{{baseUrl}}/user/login?username=&password=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "user", + "login" + ], + "query": [ + { + "key": "username", + "value": "", + "description": "The user name for login" + }, + { + "key": "password", + "value": "", + "description": "The password for login in clear text" + } + ] + } + }, + "response": [ + { + "name": "successful operation", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/xml" + } + ], + "url": { + "raw": "{{baseUrl}}/user/login?username=&password=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "user", + "login" + ], + "query": [ + { + "key": "username", + "value": "", + "description": "The user name for login" + }, + { + "key": "password", + "value": "", + "description": "The password for login in clear text" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Rate-Limit", + "value": "", + "description": { + "content": "calls per hour allowed by the user", + "type": "text/plain" + } + }, + { + "key": "X-Expires-After", + "value": "", + "description": { + "content": "date in UTC when token expires", + "type": "text/plain" + } + } + ], + "cookie": [], + "body": "" + }, + { + "name": "Invalid username/password supplied", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/user/login?username=&password=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "user", + "login" + ], + "query": [ + { + "key": "username", + "value": "", + "description": "The user name for login" + }, + { + "key": "password", + "value": "", + "description": "The password for login in clear text" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + } + ] + } + ] + }, + { + "name": "logout", + "item": [ + { + "name": "Logs out current logged in user session", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/user/logout", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "user", + "logout" + ] + } + }, + "response": [ + { + "name": "successful operation", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/user/logout?aa", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "user", + "logout" + ], + "query": [ + { + "key": "aa", + "value": null + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + } + ] + } + ] + }, + { + "name": "{username}", + "item": [ + { + "name": "Get user by user name", + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/user/:username", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "user", + ":username" + ], + "variable": [ + { + "key": "username", + "value": "", + "description": "(Required) The name that needs to be fetched. Use user1 for testing. " + } + ] + } + }, + "response": [ + { + "name": "successful operation", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/user/:username", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "user", + ":username" + ], + "variable": [ + { + "key": "username" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"\",\n \"username\": \"\",\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"email\": \"\",\n \"password\": \"\",\n \"phone\": \"\",\n \"userStatus\": \"\"\n}" + }, + { + "name": "Invalid username supplied", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/user/:username", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "user", + ":username" + ], + "variable": [ + { + "key": "username" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + }, + { + "name": "User not found", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/user/:username", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "user", + ":username" + ], + "variable": [ + { + "key": "username" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + } + ] + }, + { + "name": "Update user", + "request": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "id", + "value": "" + }, + { + "key": "username", + "value": "" + }, + { + "key": "firstName", + "value": "" + }, + { + "key": "lastName", + "value": "" + }, + { + "key": "email", + "value": "" + }, + { + "key": "password", + "value": "" + }, + { + "key": "phone", + "value": "" + }, + { + "key": "userStatus", + "value": "", + "description": "User Status" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/user/:username", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "user", + ":username" + ], + "variable": [ + { + "key": "username", + "value": "", + "description": "(Required) name that need to be deleted" + } + ] + }, + "description": "This can only be done by the logged in user." + }, + "response": [ + { + "name": "successful operation", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "id", + "value": "" + }, + { + "key": "username", + "value": "" + }, + { + "key": "firstName", + "value": "" + }, + { + "key": "lastName", + "value": "" + }, + { + "key": "email", + "value": "" + }, + { + "key": "password", + "value": "" + }, + { + "key": "phone", + "value": "" + }, + { + "key": "userStatus", + "value": "", + "description": "User Status" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/user/:username", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "user", + ":username" + ], + "variable": [ + { + "key": "username" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + } + ] + }, + { + "name": "Delete user", + "request": { + "method": "DELETE", + "header": [], + "url": { + "raw": "{{baseUrl}}/user/:username", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "user", + ":username" + ], + "variable": [ + { + "key": "username", + "value": "", + "description": "(Required) The name that needs to be deleted" + } + ] + }, + "description": "This can only be done by the logged in user." + }, + "response": [ + { + "name": "Invalid username supplied", + "originalRequest": { + "method": "DELETE", + "header": [], + "url": { + "raw": "{{baseUrl}}/user/:username", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "user", + ":username" + ], + "variable": [ + { + "key": "username" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + }, + { + "name": "User not found", + "originalRequest": { + "method": "DELETE", + "header": [], + "url": { + "raw": "{{baseUrl}}/user/:username", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "user", + ":username" + ], + "variable": [ + { + "key": "username" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + } + ] + } + ] + }, + { + "name": "Create user", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "id", + "value": "" + }, + { + "key": "username", + "value": "" + }, + { + "key": "firstName", + "value": "" + }, + { + "key": "lastName", + "value": "" + }, + { + "key": "email", + "value": "" + }, + { + "key": "password", + "value": "" + }, + { + "key": "phone", + "value": "" + }, + { + "key": "userStatus", + "value": "", + "description": "User Status" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/user", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "user" + ] + }, + "description": "This can only be done by the logged in user." + }, + "response": [ + { + "name": "successful operation", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "id", + "value": "" + }, + { + "key": "username", + "value": "" + }, + { + "key": "firstName", + "value": "" + }, + { + "key": "lastName", + "value": "" + }, + { + "key": "email", + "value": "" + }, + { + "key": "password", + "value": "" + }, + { + "key": "phone", + "value": "" + }, + { + "key": "userStatus", + "value": "", + "description": "User Status" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/user", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "user" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"\",\n \"username\": \"\",\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"email\": \"\",\n \"password\": \"\",\n \"phone\": \"\",\n \"userStatus\": \"\"\n}" + } + ] + } + ] + } + ], + "variable": [ + { + "key": "baseUrl", + "value": "https://petstore3.swagger.io/api/v3" + } + ] +} \ No newline at end of file diff --git a/backend/services/api-test/src/test/resources/file/postman2.json b/backend/services/api-test/src/test/resources/file/postman2.json new file mode 100644 index 000000000000..992a17ba8c22 --- /dev/null +++ b/backend/services/api-test/src/test/resources/file/postman2.json @@ -0,0 +1,2652 @@ +{ + "info": { + "_postman_id": "069b5a16-ea3b-4ef6-957c-5e1531515627", + "name": "Swagger Petstore - OpenAPI 3.0", + "description": "This is a sample Pet Store Server based on the OpenAPI 3.0 specification. You can find out more about\nSwagger at [https://swagger.io](https://swagger.io). In the third iteration of the pet store, we've switched to the design first approach!\nYou can now help us improve the API whether it's by making changes to the definition itself or to the code.\nThat way, with time, we can improve the API in general, and expose some of the new features in OAS3.\n\n_If you're looking for the Swagger 2.0/OAS 2.0 version of Petstore, then click [here](https://editor.swagger.io/?url=https://petstore.swagger.io/v2/swagger.yaml). Alternatively, you can load via the `Edit > Load Petstore OAS 2.0` menu option!_\n\nSome useful links:\n- [The Pet Store repository](https://github.com/swagger-api/swagger-petstore)\n- [The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)\n\nContact Support:\n Email: apiteam@swagger.io", + "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json", + "_exporter_id": "8135699" + }, + "item": [ + { + "name": "pet", + "item": [ + { + "name": "findByStatus", + "item": [ + { + "name": "Finds Pets by status", + "request": { + "auth": { + "type": "basic", + "basic": { + "password": "312321", + "username": "21321" + } + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json", + "description": "2232132", + "disabled": true + } + ], + "url": { + "raw": "{{baseUrl}}/pet/findByStatus/?aaa=112", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet", + "findByStatus", + "" + ], + "query": [ + { + "key": "status", + "value": "available", + "description": "Status values that need to be considered for filter", + "disabled": true + }, + { + "key": "aaa", + "value": "112" + } + ] + }, + "description": "Multiple status values can be provided with comma separated strings" + }, + "response": [ + { + "name": "successful operation", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "description": "Added as a part of security scheme: oauth2", + "key": "Authorization", + "value": "" + } + ], + "url": { + "raw": "{{baseUrl}}/pet/findByStatus?status=available", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet", + "findByStatus" + ], + "query": [ + { + "key": "status", + "value": "available", + "description": "Status values that need to be considered for filter" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "[\n {\n \"name\": \"\",\n \"photoUrls\": [\n \"\",\n \"\"\n ],\n \"id\": \"\",\n \"category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"tags\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n },\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"status\": \"sold\"\n },\n {\n \"name\": \"\",\n \"photoUrls\": [\n \"\",\n \"\"\n ],\n \"id\": \"\",\n \"category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"tags\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n },\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"status\": \"sold\"\n }\n]" + }, + { + "name": "Invalid status value", + "originalRequest": { + "method": "GET", + "header": [ + { + "description": "Added as a part of security scheme: oauth2", + "key": "Authorization", + "value": "" + } + ], + "url": { + "raw": "{{baseUrl}}/pet/findByStatus?status=available", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet", + "findByStatus" + ], + "query": [ + { + "key": "status", + "value": "available", + "description": "Status values that need to be considered for filter" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + } + ] + } + ] + }, + { + "name": "findByTags", + "item": [ + { + "name": "Finds Pets by tags", + "protocolProfileBehavior": { + "strictSSL": false, + "followOriginalHttpMethod": false, + "followAuthorizationHeader": false, + "removeRefererHeaderOnRedirect": true + }, + "request": { + "auth": { + "type": "noauth" + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/pet/findByTags?tags=&tags=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet", + "findByTags" + ], + "query": [ + { + "key": "tags", + "value": "", + "description": "Tags to filter by" + }, + { + "key": "tags", + "value": "", + "description": "Tags to filter by" + } + ] + }, + "description": "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing." + }, + "response": [ + { + "name": "successful operation", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "description": "Added as a part of security scheme: oauth2", + "key": "Authorization", + "value": "" + } + ], + "url": { + "raw": "{{baseUrl}}/pet/findByTags?tags=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet", + "findByTags" + ], + "query": [ + { + "key": "tags", + "value": "", + "description": "Tags to filter by" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "[\n {\n \"name\": \"\",\n \"photoUrls\": [\n \"\",\n \"\"\n ],\n \"id\": \"\",\n \"category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"tags\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n },\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"status\": \"sold\"\n },\n {\n \"name\": \"\",\n \"photoUrls\": [\n \"\",\n \"\"\n ],\n \"id\": \"\",\n \"category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"tags\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n },\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"status\": \"sold\"\n }\n]" + }, + { + "name": "Invalid tag value", + "originalRequest": { + "method": "GET", + "header": [ + { + "description": "Added as a part of security scheme: oauth2", + "key": "Authorization", + "value": "" + } + ], + "url": { + "raw": "{{baseUrl}}/pet/findByTags?tags=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet", + "findByTags" + ], + "query": [ + { + "key": "tags", + "value": "", + "description": "Tags to filter by" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + } + ] + } + ] + }, + { + "name": "{petId}", + "item": [ + { + "name": "uploadImage", + "item": [ + { + "name": "uploads an image", + "request": { + "auth": { + "type": "digest", + "digest": { + "algorithm": "MD5" + } + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/octet-stream" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "file", + "file": {} + }, + "url": { + "raw": "{{baseUrl}}/pet/:petId/uploadImage?additionalMetadata=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet", + ":petId", + "uploadImage" + ], + "query": [ + { + "key": "additionalMetadata", + "value": "", + "description": "Additional Metadata" + } + ], + "variable": [ + { + "key": "petId", + "value": "", + "description": "(Required) ID of pet to update" + } + ] + } + }, + "response": [ + { + "name": "successful operation", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/octet-stream" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "description": "Added as a part of security scheme: oauth2", + "key": "Authorization", + "value": "" + } + ], + "body": { + "mode": "file", + "file": {} + }, + "url": { + "raw": "{{baseUrl}}/pet/:petId/uploadImage?additionalMetadata=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet", + ":petId", + "uploadImage" + ], + "query": [ + { + "key": "additionalMetadata", + "value": "", + "description": "Additional Metadata" + } + ], + "variable": [ + { + "key": "petId" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"code\": \"\",\n \"type\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "Find pet by ID", + "request": { + "auth": { + "type": "apikey", + "apikey": { + "key": "api_key", + "value": "{{apiKey}}", + "in": "header" + } + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/pet/:petId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet", + ":petId" + ], + "variable": [ + { + "key": "petId", + "value": "", + "description": "(Required) ID of pet to return" + } + ] + }, + "description": "Returns a single pet" + }, + "response": [ + { + "name": "successful operation", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "description": "Added as a part of security scheme: apikey", + "key": "api_key", + "value": "" + } + ], + "url": { + "raw": "{{baseUrl}}/pet/:petId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet", + ":petId" + ], + "variable": [ + { + "key": "petId" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"name\": \"\",\n \"photoUrls\": [\n \"\",\n \"\"\n ],\n \"id\": \"\",\n \"category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"tags\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n },\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"status\": \"sold\"\n}" + }, + { + "name": "Invalid ID supplied", + "originalRequest": { + "method": "GET", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "api_key", + "value": "" + } + ], + "url": { + "raw": "{{baseUrl}}/pet/:petId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet", + ":petId" + ], + "variable": [ + { + "key": "petId" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + }, + { + "name": "Pet not found", + "originalRequest": { + "method": "GET", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "api_key", + "value": "" + } + ], + "url": { + "raw": "{{baseUrl}}/pet/:petId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet", + ":petId" + ], + "variable": [ + { + "key": "petId" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + } + ] + }, + { + "name": "Updates a pet in the store with form data", + "request": { + "auth": { + "type": "oauth2", + "oauth2": { + "scope": "write:pets read:pets", + "authUrl": "https://petstore3.swagger.io/oauth/authorize", + "grant_type": "implicit" + } + }, + "method": "POST", + "header": [], + "url": { + "raw": "{{baseUrl}}/pet/:petId?name=&status=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet", + ":petId" + ], + "query": [ + { + "key": "name", + "value": "", + "description": "Name of pet that needs to be updated" + }, + { + "key": "status", + "value": "", + "description": "Status of pet that needs to be updated" + } + ], + "variable": [ + { + "key": "petId", + "value": "", + "description": "(Required) ID of pet that needs to be updated" + } + ] + } + }, + "response": [ + { + "name": "Invalid input", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: oauth2", + "key": "Authorization", + "value": "" + } + ], + "url": { + "raw": "{{baseUrl}}/pet/:petId?name=&status=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet", + ":petId" + ], + "query": [ + { + "key": "name", + "value": "", + "description": "Name of pet that needs to be updated" + }, + { + "key": "status", + "value": "", + "description": "Status of pet that needs to be updated" + } + ], + "variable": [ + { + "key": "petId" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + } + ] + }, + { + "name": "Deletes a pet", + "request": { + "auth": { + "type": "oauth2", + "oauth2": { + "scope": "write:pets read:pets", + "authUrl": "https://petstore3.swagger.io/oauth/authorize", + "grant_type": "implicit" + } + }, + "method": "DELETE", + "header": [ + { + "key": "api_key", + "value": "" + } + ], + "url": { + "raw": "{{baseUrl}}/pet/:petId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet", + ":petId" + ], + "variable": [ + { + "key": "petId", + "value": "", + "description": "(Required) Pet id to delete" + } + ] + }, + "description": "delete a pet" + }, + "response": [ + { + "name": "Invalid pet value", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "api_key", + "value": "" + }, + { + "description": "Added as a part of security scheme: oauth2", + "key": "Authorization", + "value": "" + } + ], + "url": { + "raw": "{{baseUrl}}/pet/:petId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet", + ":petId" + ], + "variable": [ + { + "key": "petId" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + } + ] + } + ] + }, + { + "name": "Update an existing pet", + "request": { + "auth": { + "type": "oauth2", + "oauth2": { + "scope": "write:pets read:pets", + "authUrl": "https://petstore3.swagger.io/oauth/authorize", + "grant_type": "implicit" + } + }, + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "name", + "value": "", + "description": "(Required) " + }, + { + "key": "photoUrls", + "value": "", + "description": "(Required) " + }, + { + "key": "photoUrls", + "value": "", + "description": "(Required) " + }, + { + "key": "id", + "value": "" + }, + { + "key": "id", + "value": "" + }, + { + "key": "name", + "value": "" + }, + { + "key": "tags", + "value": "[object Object]" + }, + { + "key": "tags", + "value": "[object Object]" + }, + { + "key": "status", + "value": "sold", + "description": "pet status in the store" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/pet?qqq=qwwew", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "pet" + ], + "query": [ + { + "key": "qqq", + "value": "qwwew" + } + ] + }, + "description": "Update an existing pet by Id" + }, + "response": [ + { + "name": "Successful operation", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "description": "Added as a part of security scheme: oauth2", + "key": "Authorization", + "value": "" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "name", + "value": "", + "description": "(Required) " + }, + { + "key": "photoUrls", + "value": "", + "description": "(Required) " + }, + { + "key": "photoUrls", + "value": "", + "description": "(Required) " + }, + { + "key": "id", + "value": "" + }, + { + "key": "id", + "value": "" + }, + { + "key": "name", + "value": "" + }, + { + "key": "tags", + "value": "[object Object]" + }, + { + "key": "tags", + "value": "[object Object]" + }, + { + "key": "status", + "value": "sold", + "description": "pet status in the store" + } + ] + }, + "url": "{{baseUrl}}/pet" + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"name\": \"\",\n \"photoUrls\": [\n \"\",\n \"\"\n ],\n \"id\": \"\",\n \"category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"tags\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n },\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"status\": \"sold\"\n}" + }, + { + "name": "Invalid ID supplied", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + }, + { + "description": "Added as a part of security scheme: oauth2", + "key": "Authorization", + "value": "" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "name", + "value": "", + "description": "(Required) " + }, + { + "key": "photoUrls", + "value": "", + "description": "(Required) " + }, + { + "key": "photoUrls", + "value": "", + "description": "(Required) " + }, + { + "key": "id", + "value": "" + }, + { + "key": "id", + "value": "" + }, + { + "key": "name", + "value": "" + }, + { + "key": "tags", + "value": "[object Object]" + }, + { + "key": "tags", + "value": "[object Object]" + }, + { + "key": "status", + "value": "sold", + "description": "pet status in the store" + } + ] + }, + "url": "{{baseUrl}}/pet" + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + }, + { + "name": "Pet not found", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + }, + { + "description": "Added as a part of security scheme: oauth2", + "key": "Authorization", + "value": "" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "name", + "value": "", + "description": "(Required) " + }, + { + "key": "photoUrls", + "value": "", + "description": "(Required) " + }, + { + "key": "photoUrls", + "value": "", + "description": "(Required) " + }, + { + "key": "id", + "value": "" + }, + { + "key": "id", + "value": "" + }, + { + "key": "name", + "value": "" + }, + { + "key": "tags", + "value": "[object Object]" + }, + { + "key": "tags", + "value": "[object Object]" + }, + { + "key": "status", + "value": "sold", + "description": "pet status in the store" + } + ] + }, + "url": "{{baseUrl}}/pet" + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + }, + { + "name": "Validation exception", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + }, + { + "description": "Added as a part of security scheme: oauth2", + "key": "Authorization", + "value": "" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "name", + "value": "", + "description": "(Required) " + }, + { + "key": "photoUrls", + "value": "", + "description": "(Required) " + }, + { + "key": "photoUrls", + "value": "", + "description": "(Required) " + }, + { + "key": "id", + "value": "" + }, + { + "key": "id", + "value": "" + }, + { + "key": "name", + "value": "" + }, + { + "key": "tags", + "value": "[object Object]" + }, + { + "key": "tags", + "value": "[object Object]" + }, + { + "key": "status", + "value": "sold", + "description": "pet status in the store" + } + ] + }, + "url": "{{baseUrl}}/pet" + }, + "status": "Unprocessable Entity (WebDAV) (RFC 4918)", + "code": 422, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + } + ] + }, + { + "name": "Add a new pet to the store", + "request": { + "auth": { + "type": "oauth2", + "oauth2": { + "scope": "write:pets read:pets", + "authUrl": "https://petstore3.swagger.io/oauth/authorize", + "grant_type": "implicit" + } + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "name", + "value": "", + "description": "(Required) " + }, + { + "key": "photoUrls", + "value": "", + "description": "(Required) " + }, + { + "key": "photoUrls", + "value": "", + "description": "(Required) " + }, + { + "key": "id", + "value": "" + }, + { + "key": "id", + "value": "" + }, + { + "key": "name", + "value": "" + }, + { + "key": "tags", + "value": "[object Object]" + }, + { + "key": "tags", + "value": "[object Object]" + }, + { + "key": "status", + "value": "sold", + "description": "pet status in the store" + } + ] + }, + "url": "{{baseUrl}}/pet", + "description": "Add a new pet to the store" + }, + "response": [ + { + "name": "Successful operation", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "description": "Added as a part of security scheme: oauth2", + "key": "Authorization", + "value": "" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "name", + "value": "", + "description": "(Required) " + }, + { + "key": "photoUrls", + "value": "", + "description": "(Required) " + }, + { + "key": "photoUrls", + "value": "", + "description": "(Required) " + }, + { + "key": "id", + "value": "" + }, + { + "key": "id", + "value": "" + }, + { + "key": "name", + "value": "" + }, + { + "key": "tags", + "value": "[object Object]" + }, + { + "key": "tags", + "value": "[object Object]" + }, + { + "key": "status", + "value": "sold", + "description": "pet status in the store" + } + ] + }, + "url": "{{baseUrl}}/pet" + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"name\": \"\",\n \"photoUrls\": [\n \"\",\n \"\"\n ],\n \"id\": \"\",\n \"category\": {\n \"id\": \"\",\n \"name\": \"\"\n },\n \"tags\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n },\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"status\": \"sold\"\n}" + }, + { + "name": "Invalid input", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + }, + { + "description": "Added as a part of security scheme: oauth2", + "key": "Authorization", + "value": "" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "name", + "value": "", + "description": "(Required) " + }, + { + "key": "photoUrls", + "value": "", + "description": "(Required) " + }, + { + "key": "photoUrls", + "value": "", + "description": "(Required) " + }, + { + "key": "id", + "value": "" + }, + { + "key": "id", + "value": "" + }, + { + "key": "name", + "value": "" + }, + { + "key": "tags", + "value": "[object Object]" + }, + { + "key": "tags", + "value": "[object Object]" + }, + { + "key": "status", + "value": "sold", + "description": "pet status in the store" + } + ] + }, + "url": "{{baseUrl}}/pet" + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + }, + { + "name": "Validation exception", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + }, + { + "description": "Added as a part of security scheme: oauth2", + "key": "Authorization", + "value": "" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "name", + "value": "", + "description": "(Required) " + }, + { + "key": "photoUrls", + "value": "", + "description": "(Required) " + }, + { + "key": "photoUrls", + "value": "", + "description": "(Required) " + }, + { + "key": "id", + "value": "" + }, + { + "key": "id", + "value": "" + }, + { + "key": "name", + "value": "" + }, + { + "key": "tags", + "value": "[object Object]" + }, + { + "key": "tags", + "value": "[object Object]" + }, + { + "key": "status", + "value": "sold", + "description": "pet status in the store" + } + ] + }, + "url": "{{baseUrl}}/pet" + }, + "status": "Unprocessable Entity (WebDAV) (RFC 4918)", + "code": 422, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + } + ] + } + ] + }, + { + "name": "store", + "item": [ + { + "name": "inventory", + "item": [ + { + "name": "Returns pet inventories by status", + "request": { + "auth": { + "type": "apikey", + "apikey": { + "key": "api_key", + "value": "{{apiKey}}", + "in": "header" + } + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": "{{baseUrl}}/store/inventory", + "description": "Returns a map of status codes to quantities" + }, + "response": [ + { + "name": "successful operation", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "description": "Added as a part of security scheme: apikey", + "key": "api_key", + "value": "" + } + ], + "url": "{{baseUrl}}/store/inventory" + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"do6\": \"\",\n \"culpac37\": \"\",\n \"ad_611\": \"\",\n \"laboris_1\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "order", + "item": [ + { + "name": "{orderId}", + "item": [ + { + "name": "Find purchase order by ID", + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/store/order/:orderId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "store", + "order", + ":orderId" + ], + "variable": [ + { + "key": "orderId", + "value": "", + "description": "(Required) ID of order that needs to be fetched" + } + ] + }, + "description": "For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions." + }, + "response": [ + { + "name": "successful operation", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/store/order/:orderId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "store", + "order", + ":orderId" + ], + "variable": [ + { + "key": "orderId" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"\",\n \"petId\": \"\",\n \"quantity\": \"\",\n \"shipDate\": \"\",\n \"status\": \"placed\",\n \"complete\": \"\"\n}" + }, + { + "name": "Invalid ID supplied", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/store/order/:orderId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "store", + "order", + ":orderId" + ], + "variable": [ + { + "key": "orderId" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + }, + { + "name": "Order not found", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/store/order/:orderId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "store", + "order", + ":orderId" + ], + "variable": [ + { + "key": "orderId" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + } + ] + }, + { + "name": "Delete purchase order by ID", + "request": { + "method": "DELETE", + "header": [], + "url": { + "raw": "{{baseUrl}}/store/order/:orderId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "store", + "order", + ":orderId" + ], + "variable": [ + { + "key": "orderId", + "value": "", + "description": "(Required) ID of the order that needs to be deleted" + } + ] + }, + "description": "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors" + }, + "response": [ + { + "name": "Invalid ID supplied", + "originalRequest": { + "method": "DELETE", + "header": [], + "url": { + "raw": "{{baseUrl}}/store/order/:orderId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "store", + "order", + ":orderId" + ], + "variable": [ + { + "key": "orderId" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + }, + { + "name": "Order not found", + "originalRequest": { + "method": "DELETE", + "header": [], + "url": { + "raw": "{{baseUrl}}/store/order/:orderId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "store", + "order", + ":orderId" + ], + "variable": [ + { + "key": "orderId" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + } + ] + } + ] + }, + { + "name": "Place an order for a pet", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "id", + "value": "" + }, + { + "key": "petId", + "value": "" + }, + { + "key": "quantity", + "value": "" + }, + { + "key": "shipDate", + "value": "" + }, + { + "key": "status", + "value": "placed", + "description": "Order Status" + }, + { + "key": "complete", + "value": "" + } + ] + }, + "url": "{{baseUrl}}/store/order", + "description": "Place a new order in the store" + }, + "response": [ + { + "name": "successful operation", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "id", + "value": "" + }, + { + "key": "petId", + "value": "" + }, + { + "key": "quantity", + "value": "" + }, + { + "key": "shipDate", + "value": "" + }, + { + "key": "status", + "value": "placed", + "description": "Order Status" + }, + { + "key": "complete", + "value": "" + } + ] + }, + "url": "{{baseUrl}}/store/order" + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"\",\n \"petId\": \"\",\n \"quantity\": \"\",\n \"shipDate\": \"\",\n \"status\": \"placed\",\n \"complete\": \"\"\n}" + }, + { + "name": "Invalid input", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "id", + "value": "" + }, + { + "key": "petId", + "value": "" + }, + { + "key": "quantity", + "value": "" + }, + { + "key": "shipDate", + "value": "" + }, + { + "key": "status", + "value": "placed", + "description": "Order Status" + }, + { + "key": "complete", + "value": "" + } + ] + }, + "url": "{{baseUrl}}/store/order" + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + }, + { + "name": "Validation exception", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "id", + "value": "" + }, + { + "key": "petId", + "value": "" + }, + { + "key": "quantity", + "value": "" + }, + { + "key": "shipDate", + "value": "" + }, + { + "key": "status", + "value": "placed", + "description": "Order Status" + }, + { + "key": "complete", + "value": "" + } + ] + }, + "url": "{{baseUrl}}/store/order" + }, + "status": "Unprocessable Entity (WebDAV) (RFC 4918)", + "code": 422, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + } + ] + } + ] + } + ] + }, + { + "name": "user", + "item": [ + { + "name": "createWithList", + "item": [ + { + "name": "Creates list of users with given input array", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "[\n {\n \"id\": \"\",\n \"username\": \"\",\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"email\": \"\",\n \"password\": \"\",\n \"phone\": \"\",\n \"userStatus\": \"\"\n },\n {\n \"id\": \"\",\n \"username\": \"\",\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"email\": \"\",\n \"password\": \"\",\n \"phone\": \"\",\n \"userStatus\": \"\"\n }\n]", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": "{{baseUrl}}/user/createWithList", + "description": "Creates list of users with given input array" + }, + "response": [ + { + "name": "Successful operation", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "[\n {\n \"id\": \"\",\n \"username\": \"\",\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"email\": \"\",\n \"password\": \"\",\n \"phone\": \"\",\n \"userStatus\": \"\"\n },\n {\n \"id\": \"\",\n \"username\": \"\",\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"email\": \"\",\n \"password\": \"\",\n \"phone\": \"\",\n \"userStatus\": \"\"\n }\n]", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": "{{baseUrl}}/user/createWithList" + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"\",\n \"username\": \"\",\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"email\": \"\",\n \"password\": \"\",\n \"phone\": \"\",\n \"userStatus\": \"\"\n}" + }, + { + "name": "successful operation", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "[\n {\n \"id\": \"\",\n \"username\": \"\",\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"email\": \"\",\n \"password\": \"\",\n \"phone\": \"\",\n \"userStatus\": \"\"\n },\n {\n \"id\": \"\",\n \"username\": \"\",\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"email\": \"\",\n \"password\": \"\",\n \"phone\": \"\",\n \"userStatus\": \"\"\n }\n]", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": "{{baseUrl}}/user/createWithList" + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + } + ] + } + ] + }, + { + "name": "login", + "item": [ + { + "name": "Logs user into the system", + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/xml" + } + ], + "url": { + "raw": "{{baseUrl}}/user/login?username=&password=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "user", + "login" + ], + "query": [ + { + "key": "username", + "value": "", + "description": "The user name for login" + }, + { + "key": "password", + "value": "", + "description": "The password for login in clear text" + } + ] + } + }, + "response": [ + { + "name": "successful operation", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/xml" + } + ], + "url": { + "raw": "{{baseUrl}}/user/login?username=&password=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "user", + "login" + ], + "query": [ + { + "key": "username", + "value": "", + "description": "The user name for login" + }, + { + "key": "password", + "value": "", + "description": "The password for login in clear text" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Rate-Limit", + "value": "", + "description": { + "content": "calls per hour allowed by the user", + "type": "text/plain" + } + }, + { + "key": "X-Expires-After", + "value": "", + "description": { + "content": "date in UTC when token expires", + "type": "text/plain" + } + } + ], + "cookie": [], + "body": "" + }, + { + "name": "Invalid username/password supplied", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/user/login?username=&password=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "user", + "login" + ], + "query": [ + { + "key": "username", + "value": "", + "description": "The user name for login" + }, + { + "key": "password", + "value": "", + "description": "The password for login in clear text" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + } + ] + } + ] + }, + { + "name": "logout", + "item": [ + { + "name": "Logs out current logged in user session", + "request": { + "method": "GET", + "header": [], + "url": "{{baseUrl}}/user/logout" + }, + "response": [ + { + "name": "successful operation", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/user/logout?aa", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "user", + "logout" + ], + "query": [ + { + "key": "aa", + "value": null + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + } + ] + } + ] + }, + { + "name": "{username}", + "item": [ + { + "name": "Get user by user name", + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/user/:username", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "user", + ":username" + ], + "variable": [ + { + "key": "username", + "value": "", + "description": "(Required) The name that needs to be fetched. Use user1 for testing. " + } + ] + } + }, + "response": [ + { + "name": "successful operation", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/user/:username", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "user", + ":username" + ], + "variable": [ + { + "key": "username" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"\",\n \"username\": \"\",\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"email\": \"\",\n \"password\": \"\",\n \"phone\": \"\",\n \"userStatus\": \"\"\n}" + }, + { + "name": "Invalid username supplied", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/user/:username", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "user", + ":username" + ], + "variable": [ + { + "key": "username" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + }, + { + "name": "User not found", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/user/:username", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "user", + ":username" + ], + "variable": [ + { + "key": "username" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + } + ] + }, + { + "name": "Update user", + "request": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "id", + "value": "" + }, + { + "key": "username", + "value": "" + }, + { + "key": "firstName", + "value": "" + }, + { + "key": "lastName", + "value": "" + }, + { + "key": "email", + "value": "" + }, + { + "key": "password", + "value": "" + }, + { + "key": "phone", + "value": "" + }, + { + "key": "userStatus", + "value": "", + "description": "User Status" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/user/:username", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "user", + ":username" + ], + "variable": [ + { + "key": "username", + "value": "", + "description": "(Required) name that need to be deleted" + } + ] + }, + "description": "This can only be done by the logged in user." + }, + "response": [ + { + "name": "successful operation", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "id", + "value": "" + }, + { + "key": "username", + "value": "" + }, + { + "key": "firstName", + "value": "" + }, + { + "key": "lastName", + "value": "" + }, + { + "key": "email", + "value": "" + }, + { + "key": "password", + "value": "" + }, + { + "key": "phone", + "value": "" + }, + { + "key": "userStatus", + "value": "", + "description": "User Status" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/user/:username", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "user", + ":username" + ], + "variable": [ + { + "key": "username" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + } + ] + }, + { + "name": "Delete user", + "request": { + "method": "DELETE", + "header": [], + "url": { + "raw": "{{baseUrl}}/user/:username", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "user", + ":username" + ], + "variable": [ + { + "key": "username", + "value": "", + "description": "(Required) The name that needs to be deleted" + } + ] + }, + "description": "This can only be done by the logged in user." + }, + "response": [ + { + "name": "Invalid username supplied", + "originalRequest": { + "method": "DELETE", + "header": [], + "url": { + "raw": "{{baseUrl}}/user/:username", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "user", + ":username" + ], + "variable": [ + { + "key": "username" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + }, + { + "name": "User not found", + "originalRequest": { + "method": "DELETE", + "header": [], + "url": { + "raw": "{{baseUrl}}/user/:username", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "user", + ":username" + ], + "variable": [ + { + "key": "username" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + } + ] + } + ] + }, + { + "name": "Create user", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "id", + "value": "" + }, + { + "key": "username", + "value": "" + }, + { + "key": "firstName", + "value": "" + }, + { + "key": "lastName", + "value": "" + }, + { + "key": "email", + "value": "" + }, + { + "key": "password", + "value": "" + }, + { + "key": "phone", + "value": "" + }, + { + "key": "userStatus", + "value": "", + "description": "User Status" + } + ] + }, + "url": "{{baseUrl}}/user", + "description": "This can only be done by the logged in user." + }, + "response": [ + { + "name": "successful operation", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "id", + "value": "" + }, + { + "key": "username", + "value": "" + }, + { + "key": "firstName", + "value": "" + }, + { + "key": "lastName", + "value": "" + }, + { + "key": "email", + "value": "" + }, + { + "key": "password", + "value": "" + }, + { + "key": "phone", + "value": "" + }, + { + "key": "userStatus", + "value": "", + "description": "User Status" + } + ] + }, + "url": "{{baseUrl}}/user" + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"\",\n \"username\": \"\",\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"email\": \"\",\n \"password\": \"\",\n \"phone\": \"\",\n \"userStatus\": \"\"\n}" + } + ] + } + ] + } + ], + "variable": [ + { + "key": "baseUrl", + "value": "https://petstore3.swagger.io/api/v3" + } + ] +} \ No newline at end of file