From ec14440a67d87116ae535f3c91db289f0c67c372 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christof=20Sch=C3=B6ll?= Date: Thu, 12 Oct 2023 21:16:38 +0200 Subject: [PATCH] Restructure project into separate modules --- bruno-model/pom.xml | 40 + .../java/org/cschoell/bruno/model/Assert.java | 0 .../java/org/cschoell/bruno/model/Auth.java | 0 .../org/cschoell/bruno/model/AuthType.java | 0 .../java/org/cschoell/bruno/model/Body.java | 0 .../org/cschoell/bruno/model/BodyType.java | 0 .../cschoell/bruno/model/BrunoCollection.java | 0 .../cschoell/bruno/model/BrunoModelBase.java | 0 .../bruno/model/BrunoModelComponentRoot.java | 0 .../bruno/model/BrunoRequestFile.java | 0 .../cschoell/bruno/model/BrunoValueBase.java | 0 .../java/org/cschoell/bruno/model/Folder.java | 2 +- .../org/cschoell/bruno/model/FormBody.java | 0 .../org/cschoell/bruno/model/Headers.java | 0 .../java/org/cschoell/bruno/model/Meta.java | 0 .../bruno/model/PostResponseScript.java | 0 .../bruno/model/PostResponseVars.java | 0 .../bruno/model/PreRequestScript.java | 0 .../cschoell/bruno/model/PreRequestVars.java | 0 .../java/org/cschoell/bruno/model/Query.java | 0 .../org/cschoell/bruno/model/RawBody.java | 0 .../org/cschoell/bruno/model/Request.java | 0 .../java/org/cschoell/bruno/model/Tests.java | 0 pom.xml | 104 +- postman-bruno-converter/pom.xml | 76 ++ .../cschoell/bruno/BrunoCollectionWriter.java | 0 .../cschoell/bruno/RequestContentBuilder.java | 13 +- .../PostmanToBrunoCollectionMapper.java | 0 .../PostmanObjectMapperBuilder.java | 2 +- .../cschoell/postman/schematoobject/Readme.md | 1 + .../postmanconverter/JsonConverter.java | 2 +- .../postmanconverter/LombokAnnotator.java | 2 +- .../src/main}/resources/TestCollection1.json | 0 .../src/main}/resources/postmanecho.json | 0 .../bruno/BrunoCollectionWriterTest.java | 0 .../bruno/RequestContentBuilderTest.java | 0 .../postmanconverter/ConverterRunner.java | 0 .../testsupport/TestCollectionProvider.java | 2 +- postman-model/pom.xml | 31 + .../postman/model/AdditionalProperty.java | 0 .../java/org/cschoell/postman/model/Auth.java | 0 .../cschoell/postman/model/AuthAttribute.java | 0 .../java/org/cschoell/postman/model/Body.java | 0 .../java/org/cschoell/postman/model/Cert.java | 0 .../cschoell/postman/model/Certificate.java | 0 .../org/cschoell/postman/model/Cookie.java | 0 .../cschoell/postman/model/Description.java | 0 .../org/cschoell/postman/model/Event.java | 0 .../java/org/cschoell/postman/model/File.java | 0 .../org/cschoell/postman/model/Formdatum.java | 0 .../org/cschoell/postman/model/Graphql.java | 0 .../org/cschoell/postman/model/Header.java | 0 .../java/org/cschoell/postman/model/Info.java | 0 .../java/org/cschoell/postman/model/Item.java | 0 .../org/cschoell/postman/model/ItemBase.java | 0 .../java/org/cschoell/postman/model/Key.java | 0 .../org/cschoell/postman/model/Options.java | 0 .../postman/model/PostmanCollection.java | 0 .../postman/model/PostmanPolymorphicBase.java | 0 .../model/ProtocolProfileBehavior.java | 0 .../cschoell/postman/model/ProxyConfig.java | 0 .../org/cschoell/postman/model/Query.java | 0 .../org/cschoell/postman/model/Request.java | 0 .../org/cschoell/postman/model/Response.java | 0 .../org/cschoell/postman/model/Script.java | 0 .../org/cschoell/postman/model/Timings.java | 0 .../java/org/cschoell/postman/model/Url.java | 0 .../cschoell/postman/model/Urlencoded.java | 0 .../org/cschoell/postman/model/Variable.java | 0 .../org/cschoell/postman/model/Version.java | 0 .../cschoell/postman/model/VirtualFolder.java | 0 src/main/resources/application.properties | 1 - src/main/resources/postmanschema.json | 1187 ----------------- src/main/resources/postmanschemaNoOneOf.json | 940 ------------- 74 files changed, 205 insertions(+), 2198 deletions(-) create mode 100644 bruno-model/pom.xml rename {src => bruno-model/src}/main/java/org/cschoell/bruno/model/Assert.java (100%) rename {src => bruno-model/src}/main/java/org/cschoell/bruno/model/Auth.java (100%) rename {src => bruno-model/src}/main/java/org/cschoell/bruno/model/AuthType.java (100%) rename {src => bruno-model/src}/main/java/org/cschoell/bruno/model/Body.java (100%) rename {src => bruno-model/src}/main/java/org/cschoell/bruno/model/BodyType.java (100%) rename {src => bruno-model/src}/main/java/org/cschoell/bruno/model/BrunoCollection.java (100%) rename {src => bruno-model/src}/main/java/org/cschoell/bruno/model/BrunoModelBase.java (100%) rename {src => bruno-model/src}/main/java/org/cschoell/bruno/model/BrunoModelComponentRoot.java (100%) rename {src => bruno-model/src}/main/java/org/cschoell/bruno/model/BrunoRequestFile.java (100%) rename {src => bruno-model/src}/main/java/org/cschoell/bruno/model/BrunoValueBase.java (100%) rename {src => bruno-model/src}/main/java/org/cschoell/bruno/model/Folder.java (83%) rename {src => bruno-model/src}/main/java/org/cschoell/bruno/model/FormBody.java (100%) rename {src => bruno-model/src}/main/java/org/cschoell/bruno/model/Headers.java (100%) rename {src => bruno-model/src}/main/java/org/cschoell/bruno/model/Meta.java (100%) rename {src => bruno-model/src}/main/java/org/cschoell/bruno/model/PostResponseScript.java (100%) rename {src => bruno-model/src}/main/java/org/cschoell/bruno/model/PostResponseVars.java (100%) rename {src => bruno-model/src}/main/java/org/cschoell/bruno/model/PreRequestScript.java (100%) rename {src => bruno-model/src}/main/java/org/cschoell/bruno/model/PreRequestVars.java (100%) rename {src => bruno-model/src}/main/java/org/cschoell/bruno/model/Query.java (100%) rename {src => bruno-model/src}/main/java/org/cschoell/bruno/model/RawBody.java (100%) rename {src => bruno-model/src}/main/java/org/cschoell/bruno/model/Request.java (100%) rename {src => bruno-model/src}/main/java/org/cschoell/bruno/model/Tests.java (100%) create mode 100644 postman-bruno-converter/pom.xml rename {src => postman-bruno-converter/src}/main/java/org/cschoell/bruno/BrunoCollectionWriter.java (100%) rename {src => postman-bruno-converter/src}/main/java/org/cschoell/bruno/RequestContentBuilder.java (85%) rename {src => postman-bruno-converter/src}/main/java/org/cschoell/bruno/mapper/PostmanToBrunoCollectionMapper.java (100%) rename {src/main/java/org/cschoell/postman/converter => postman-bruno-converter/src/main/java/org/cschoell/postman/schematoobject}/PostmanObjectMapperBuilder.java (98%) create mode 100644 postman-bruno-converter/src/main/java/org/cschoell/postman/schematoobject/Readme.md rename {src/main/java/org/cschoell/postman/converter => postman-bruno-converter/src/main/java/org/cschoell/postman/schematoobject}/postmanconverter/JsonConverter.java (96%) rename {src/main/java/org/cschoell/postman/converter => postman-bruno-converter/src/main/java/org/cschoell/postman/schematoobject}/postmanconverter/LombokAnnotator.java (89%) rename {src/test => postman-bruno-converter/src/main}/resources/TestCollection1.json (100%) rename {src/test => postman-bruno-converter/src/main}/resources/postmanecho.json (100%) rename {src => postman-bruno-converter/src}/test/java/org/cschoell/bruno/BrunoCollectionWriterTest.java (100%) rename {src => postman-bruno-converter/src}/test/java/org/cschoell/bruno/RequestContentBuilderTest.java (100%) rename {src => postman-bruno-converter/src}/test/java/org/cschoell/postman/converter/postmanconverter/ConverterRunner.java (100%) rename {src => postman-bruno-converter/src}/test/java/org/cschoell/testsupport/TestCollectionProvider.java (92%) create mode 100644 postman-model/pom.xml rename {src => postman-model/src}/main/java/org/cschoell/postman/model/AdditionalProperty.java (100%) rename {src => postman-model/src}/main/java/org/cschoell/postman/model/Auth.java (100%) rename {src => postman-model/src}/main/java/org/cschoell/postman/model/AuthAttribute.java (100%) rename {src => postman-model/src}/main/java/org/cschoell/postman/model/Body.java (100%) rename {src => postman-model/src}/main/java/org/cschoell/postman/model/Cert.java (100%) rename {src => postman-model/src}/main/java/org/cschoell/postman/model/Certificate.java (100%) rename {src => postman-model/src}/main/java/org/cschoell/postman/model/Cookie.java (100%) rename {src => postman-model/src}/main/java/org/cschoell/postman/model/Description.java (100%) rename {src => postman-model/src}/main/java/org/cschoell/postman/model/Event.java (100%) rename {src => postman-model/src}/main/java/org/cschoell/postman/model/File.java (100%) rename {src => postman-model/src}/main/java/org/cschoell/postman/model/Formdatum.java (100%) rename {src => postman-model/src}/main/java/org/cschoell/postman/model/Graphql.java (100%) rename {src => postman-model/src}/main/java/org/cschoell/postman/model/Header.java (100%) rename {src => postman-model/src}/main/java/org/cschoell/postman/model/Info.java (100%) rename {src => postman-model/src}/main/java/org/cschoell/postman/model/Item.java (100%) rename {src => postman-model/src}/main/java/org/cschoell/postman/model/ItemBase.java (100%) rename {src => postman-model/src}/main/java/org/cschoell/postman/model/Key.java (100%) rename {src => postman-model/src}/main/java/org/cschoell/postman/model/Options.java (100%) rename {src => postman-model/src}/main/java/org/cschoell/postman/model/PostmanCollection.java (100%) rename {src => postman-model/src}/main/java/org/cschoell/postman/model/PostmanPolymorphicBase.java (100%) rename {src => postman-model/src}/main/java/org/cschoell/postman/model/ProtocolProfileBehavior.java (100%) rename {src => postman-model/src}/main/java/org/cschoell/postman/model/ProxyConfig.java (100%) rename {src => postman-model/src}/main/java/org/cschoell/postman/model/Query.java (100%) rename {src => postman-model/src}/main/java/org/cschoell/postman/model/Request.java (100%) rename {src => postman-model/src}/main/java/org/cschoell/postman/model/Response.java (100%) rename {src => postman-model/src}/main/java/org/cschoell/postman/model/Script.java (100%) rename {src => postman-model/src}/main/java/org/cschoell/postman/model/Timings.java (100%) rename {src => postman-model/src}/main/java/org/cschoell/postman/model/Url.java (100%) rename {src => postman-model/src}/main/java/org/cschoell/postman/model/Urlencoded.java (100%) rename {src => postman-model/src}/main/java/org/cschoell/postman/model/Variable.java (100%) rename {src => postman-model/src}/main/java/org/cschoell/postman/model/Version.java (100%) rename {src => postman-model/src}/main/java/org/cschoell/postman/model/VirtualFolder.java (100%) delete mode 100644 src/main/resources/application.properties delete mode 100644 src/main/resources/postmanschema.json delete mode 100644 src/main/resources/postmanschemaNoOneOf.json diff --git a/bruno-model/pom.xml b/bruno-model/pom.xml new file mode 100644 index 0000000..1d22497 --- /dev/null +++ b/bruno-model/pom.xml @@ -0,0 +1,40 @@ + + + 4.0.0 + + org.cschoell.apiclient.converter + apiclient-converter-parent + 0.0.1-SNAPSHOT + ../pom.xml + + + bruno-model + 0.0.1-SNAPSHOT + bruno-model + Bruno Model description + + 17 + 1.5.5.Final + + + + org.projectlombok + lombok + compile + + + commons-io + commons-io + + + org.apache.commons + commons-lang3 + + + com.fasterxml.jackson.core + jackson-annotations + + + + diff --git a/src/main/java/org/cschoell/bruno/model/Assert.java b/bruno-model/src/main/java/org/cschoell/bruno/model/Assert.java similarity index 100% rename from src/main/java/org/cschoell/bruno/model/Assert.java rename to bruno-model/src/main/java/org/cschoell/bruno/model/Assert.java diff --git a/src/main/java/org/cschoell/bruno/model/Auth.java b/bruno-model/src/main/java/org/cschoell/bruno/model/Auth.java similarity index 100% rename from src/main/java/org/cschoell/bruno/model/Auth.java rename to bruno-model/src/main/java/org/cschoell/bruno/model/Auth.java diff --git a/src/main/java/org/cschoell/bruno/model/AuthType.java b/bruno-model/src/main/java/org/cschoell/bruno/model/AuthType.java similarity index 100% rename from src/main/java/org/cschoell/bruno/model/AuthType.java rename to bruno-model/src/main/java/org/cschoell/bruno/model/AuthType.java diff --git a/src/main/java/org/cschoell/bruno/model/Body.java b/bruno-model/src/main/java/org/cschoell/bruno/model/Body.java similarity index 100% rename from src/main/java/org/cschoell/bruno/model/Body.java rename to bruno-model/src/main/java/org/cschoell/bruno/model/Body.java diff --git a/src/main/java/org/cschoell/bruno/model/BodyType.java b/bruno-model/src/main/java/org/cschoell/bruno/model/BodyType.java similarity index 100% rename from src/main/java/org/cschoell/bruno/model/BodyType.java rename to bruno-model/src/main/java/org/cschoell/bruno/model/BodyType.java diff --git a/src/main/java/org/cschoell/bruno/model/BrunoCollection.java b/bruno-model/src/main/java/org/cschoell/bruno/model/BrunoCollection.java similarity index 100% rename from src/main/java/org/cschoell/bruno/model/BrunoCollection.java rename to bruno-model/src/main/java/org/cschoell/bruno/model/BrunoCollection.java diff --git a/src/main/java/org/cschoell/bruno/model/BrunoModelBase.java b/bruno-model/src/main/java/org/cschoell/bruno/model/BrunoModelBase.java similarity index 100% rename from src/main/java/org/cschoell/bruno/model/BrunoModelBase.java rename to bruno-model/src/main/java/org/cschoell/bruno/model/BrunoModelBase.java diff --git a/src/main/java/org/cschoell/bruno/model/BrunoModelComponentRoot.java b/bruno-model/src/main/java/org/cschoell/bruno/model/BrunoModelComponentRoot.java similarity index 100% rename from src/main/java/org/cschoell/bruno/model/BrunoModelComponentRoot.java rename to bruno-model/src/main/java/org/cschoell/bruno/model/BrunoModelComponentRoot.java diff --git a/src/main/java/org/cschoell/bruno/model/BrunoRequestFile.java b/bruno-model/src/main/java/org/cschoell/bruno/model/BrunoRequestFile.java similarity index 100% rename from src/main/java/org/cschoell/bruno/model/BrunoRequestFile.java rename to bruno-model/src/main/java/org/cschoell/bruno/model/BrunoRequestFile.java diff --git a/src/main/java/org/cschoell/bruno/model/BrunoValueBase.java b/bruno-model/src/main/java/org/cschoell/bruno/model/BrunoValueBase.java similarity index 100% rename from src/main/java/org/cschoell/bruno/model/BrunoValueBase.java rename to bruno-model/src/main/java/org/cschoell/bruno/model/BrunoValueBase.java diff --git a/src/main/java/org/cschoell/bruno/model/Folder.java b/bruno-model/src/main/java/org/cschoell/bruno/model/Folder.java similarity index 83% rename from src/main/java/org/cschoell/bruno/model/Folder.java rename to bruno-model/src/main/java/org/cschoell/bruno/model/Folder.java index 985d6d5..352424f 100644 --- a/src/main/java/org/cschoell/bruno/model/Folder.java +++ b/bruno-model/src/main/java/org/cschoell/bruno/model/Folder.java @@ -18,7 +18,7 @@ public Folder(String name) { } public String getFolderName() { - return FileSystem.getCurrent().toLegalFileName(name, '_'); + return org.apache.commons.io.FileSystem.getCurrent().toLegalFileName(name, '_'); } List requests = new LinkedList<>(); diff --git a/src/main/java/org/cschoell/bruno/model/FormBody.java b/bruno-model/src/main/java/org/cschoell/bruno/model/FormBody.java similarity index 100% rename from src/main/java/org/cschoell/bruno/model/FormBody.java rename to bruno-model/src/main/java/org/cschoell/bruno/model/FormBody.java diff --git a/src/main/java/org/cschoell/bruno/model/Headers.java b/bruno-model/src/main/java/org/cschoell/bruno/model/Headers.java similarity index 100% rename from src/main/java/org/cschoell/bruno/model/Headers.java rename to bruno-model/src/main/java/org/cschoell/bruno/model/Headers.java diff --git a/src/main/java/org/cschoell/bruno/model/Meta.java b/bruno-model/src/main/java/org/cschoell/bruno/model/Meta.java similarity index 100% rename from src/main/java/org/cschoell/bruno/model/Meta.java rename to bruno-model/src/main/java/org/cschoell/bruno/model/Meta.java diff --git a/src/main/java/org/cschoell/bruno/model/PostResponseScript.java b/bruno-model/src/main/java/org/cschoell/bruno/model/PostResponseScript.java similarity index 100% rename from src/main/java/org/cschoell/bruno/model/PostResponseScript.java rename to bruno-model/src/main/java/org/cschoell/bruno/model/PostResponseScript.java diff --git a/src/main/java/org/cschoell/bruno/model/PostResponseVars.java b/bruno-model/src/main/java/org/cschoell/bruno/model/PostResponseVars.java similarity index 100% rename from src/main/java/org/cschoell/bruno/model/PostResponseVars.java rename to bruno-model/src/main/java/org/cschoell/bruno/model/PostResponseVars.java diff --git a/src/main/java/org/cschoell/bruno/model/PreRequestScript.java b/bruno-model/src/main/java/org/cschoell/bruno/model/PreRequestScript.java similarity index 100% rename from src/main/java/org/cschoell/bruno/model/PreRequestScript.java rename to bruno-model/src/main/java/org/cschoell/bruno/model/PreRequestScript.java diff --git a/src/main/java/org/cschoell/bruno/model/PreRequestVars.java b/bruno-model/src/main/java/org/cschoell/bruno/model/PreRequestVars.java similarity index 100% rename from src/main/java/org/cschoell/bruno/model/PreRequestVars.java rename to bruno-model/src/main/java/org/cschoell/bruno/model/PreRequestVars.java diff --git a/src/main/java/org/cschoell/bruno/model/Query.java b/bruno-model/src/main/java/org/cschoell/bruno/model/Query.java similarity index 100% rename from src/main/java/org/cschoell/bruno/model/Query.java rename to bruno-model/src/main/java/org/cschoell/bruno/model/Query.java diff --git a/src/main/java/org/cschoell/bruno/model/RawBody.java b/bruno-model/src/main/java/org/cschoell/bruno/model/RawBody.java similarity index 100% rename from src/main/java/org/cschoell/bruno/model/RawBody.java rename to bruno-model/src/main/java/org/cschoell/bruno/model/RawBody.java diff --git a/src/main/java/org/cschoell/bruno/model/Request.java b/bruno-model/src/main/java/org/cschoell/bruno/model/Request.java similarity index 100% rename from src/main/java/org/cschoell/bruno/model/Request.java rename to bruno-model/src/main/java/org/cschoell/bruno/model/Request.java diff --git a/src/main/java/org/cschoell/bruno/model/Tests.java b/bruno-model/src/main/java/org/cschoell/bruno/model/Tests.java similarity index 100% rename from src/main/java/org/cschoell/bruno/model/Tests.java rename to bruno-model/src/main/java/org/cschoell/bruno/model/Tests.java diff --git a/pom.xml b/pom.xml index abb9953..bc99293 100644 --- a/pom.xml +++ b/pom.xml @@ -2,74 +2,66 @@ 4.0.0 + pom org.springframework.boot spring-boot-starter-parent 3.1.4 - chris.postman.converter - postman-converter + + org.cschoell.apiclient.converter + apiclient-converter-parent 0.0.1-SNAPSHOT postman-converter - Tool to convert postman collections into different formats (e.g. Bruno) + Parent for the Tool to convert postman collections into different formats (e.g. Bruno) 17 1.5.5.Final + 2.14.0 - - - org.projectlombok - lombok - compile - - - org.mapstruct - mapstruct - ${org.mapstruct.version} - - - com.fasterxml.jackson.dataformat - jackson-dataformat-xml - - - org.jsonschema2pojo - jsonschema2pojo-core - 1.2.1 - - - org.springframework.boot - spring-boot-starter-test - test - - - org.apache.commons - commons-collections4 - 4.4 - - - commons-beanutils - commons-beanutils - 1.9.4 - - - commons-collections - commons-collections - - - commons-logging - commons-logging - - - - + + + + org.mapstruct + mapstruct + ${org.mapstruct.version} + + + commons-io + commons-io + ${commons-io.version} + + + org.jsonschema2pojo + jsonschema2pojo-core + 1.2.1 + + + org.apache.commons + commons-collections4 + 4.4 + + + commons-beanutils + commons-beanutils + 1.9.4 + + + commons-collections + commons-collections + + + commons-logging + commons-logging + + + + + - - org.springframework.boot - spring-boot-maven-plugin - maven-compiler-plugin @@ -92,4 +84,10 @@ + + bruno-model + postman-model + postman-bruno-converter + + diff --git a/postman-bruno-converter/pom.xml b/postman-bruno-converter/pom.xml new file mode 100644 index 0000000..179d50a --- /dev/null +++ b/postman-bruno-converter/pom.xml @@ -0,0 +1,76 @@ + + + 4.0.0 + + org.cschoell.apiclient.converter + apiclient-converter-parent + 0.0.1-SNAPSHOT + ../pom.xml + + + postman-bruno-converter + 0.0.1-SNAPSHOT + postman-bruno-converter + Bruno Model description + + 17 + 1.5.5.Final + + + + org.projectlombok + lombok + compile + + + org.cschoell.apiclient.converter + postman-model + 0.0.1-SNAPSHOT + + + org.cschoell.apiclient.converter + bruno-model + 0.0.1-SNAPSHOT + + + org.mapstruct + mapstruct + ${org.mapstruct.version} + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + + + org.jsonschema2pojo + jsonschema2pojo-core + 1.2.1 + + + org.springframework.boot + spring-boot-starter-test + test + + + org.apache.commons + commons-collections4 + 4.4 + + + commons-beanutils + commons-beanutils + 1.9.4 + + + commons-collections + commons-collections + + + commons-logging + commons-logging + + + + + diff --git a/src/main/java/org/cschoell/bruno/BrunoCollectionWriter.java b/postman-bruno-converter/src/main/java/org/cschoell/bruno/BrunoCollectionWriter.java similarity index 100% rename from src/main/java/org/cschoell/bruno/BrunoCollectionWriter.java rename to postman-bruno-converter/src/main/java/org/cschoell/bruno/BrunoCollectionWriter.java diff --git a/src/main/java/org/cschoell/bruno/RequestContentBuilder.java b/postman-bruno-converter/src/main/java/org/cschoell/bruno/RequestContentBuilder.java similarity index 85% rename from src/main/java/org/cschoell/bruno/RequestContentBuilder.java rename to postman-bruno-converter/src/main/java/org/cschoell/bruno/RequestContentBuilder.java index f6b138a..5507fad 100644 --- a/src/main/java/org/cschoell/bruno/RequestContentBuilder.java +++ b/postman-bruno-converter/src/main/java/org/cschoell/bruno/RequestContentBuilder.java @@ -17,7 +17,6 @@ import java.util.stream.Collectors; public class RequestContentBuilder { - public static final String DEFAULT_BODY_JSON = "json"; BrunoRequestFile brunoRequestFile; StringBuilder content = new StringBuilder(); @@ -78,17 +77,7 @@ private List getPropertyDescriptors(Class clazz) { } return sorted; } - return Arrays.asList(PropertyUtils.getPropertyDescriptors(clazz)).stream().filter(propertyDescriptor -> !propertyDescriptor.getReadMethod().isAnnotationPresent(JsonIgnore.class)).toList(); - } - - private String getComponentName(PropertyDescriptor propertyDescriptor, Map mapBean) throws IllegalAccessException, InvocationTargetException { - String componentName = propertyDescriptor.getName().toLowerCase(); - try { - componentName = (String) PropertyUtils.getProperty(mapBean, "componentRootName"); - } catch (NoSuchMethodException e) { - throw new RuntimeException(e); - } - return componentName; + return Arrays.stream(PropertyUtils.getPropertyDescriptors(clazz)).filter(propertyDescriptor -> !propertyDescriptor.getReadMethod().isAnnotationPresent(JsonIgnore.class)).toList(); } diff --git a/src/main/java/org/cschoell/bruno/mapper/PostmanToBrunoCollectionMapper.java b/postman-bruno-converter/src/main/java/org/cschoell/bruno/mapper/PostmanToBrunoCollectionMapper.java similarity index 100% rename from src/main/java/org/cschoell/bruno/mapper/PostmanToBrunoCollectionMapper.java rename to postman-bruno-converter/src/main/java/org/cschoell/bruno/mapper/PostmanToBrunoCollectionMapper.java diff --git a/src/main/java/org/cschoell/postman/converter/PostmanObjectMapperBuilder.java b/postman-bruno-converter/src/main/java/org/cschoell/postman/schematoobject/PostmanObjectMapperBuilder.java similarity index 98% rename from src/main/java/org/cschoell/postman/converter/PostmanObjectMapperBuilder.java rename to postman-bruno-converter/src/main/java/org/cschoell/postman/schematoobject/PostmanObjectMapperBuilder.java index 55e703b..d05f3d4 100644 --- a/src/main/java/org/cschoell/postman/converter/PostmanObjectMapperBuilder.java +++ b/postman-bruno-converter/src/main/java/org/cschoell/postman/schematoobject/PostmanObjectMapperBuilder.java @@ -1,4 +1,4 @@ -package org.cschoell.postman.converter; +package org.cschoell.postman.schematoobject; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; diff --git a/postman-bruno-converter/src/main/java/org/cschoell/postman/schematoobject/Readme.md b/postman-bruno-converter/src/main/java/org/cschoell/postman/schematoobject/Readme.md new file mode 100644 index 0000000..375a042 --- /dev/null +++ b/postman-bruno-converter/src/main/java/org/cschoell/postman/schematoobject/Readme.md @@ -0,0 +1 @@ +Helper package to convert a postman collection json schema into Java Mappable Json Objects. \ No newline at end of file diff --git a/src/main/java/org/cschoell/postman/converter/postmanconverter/JsonConverter.java b/postman-bruno-converter/src/main/java/org/cschoell/postman/schematoobject/postmanconverter/JsonConverter.java similarity index 96% rename from src/main/java/org/cschoell/postman/converter/postmanconverter/JsonConverter.java rename to postman-bruno-converter/src/main/java/org/cschoell/postman/schematoobject/postmanconverter/JsonConverter.java index 062f491..d9e87c2 100644 --- a/src/main/java/org/cschoell/postman/converter/postmanconverter/JsonConverter.java +++ b/postman-bruno-converter/src/main/java/org/cschoell/postman/schematoobject/postmanconverter/JsonConverter.java @@ -1,4 +1,4 @@ -package org.cschoell.postman.converter.postmanconverter; +package org.cschoell.postman.schematoobject.postmanconverter; import com.sun.codemodel.JCodeModel; import org.jsonschema2pojo.*; diff --git a/src/main/java/org/cschoell/postman/converter/postmanconverter/LombokAnnotator.java b/postman-bruno-converter/src/main/java/org/cschoell/postman/schematoobject/postmanconverter/LombokAnnotator.java similarity index 89% rename from src/main/java/org/cschoell/postman/converter/postmanconverter/LombokAnnotator.java rename to postman-bruno-converter/src/main/java/org/cschoell/postman/schematoobject/postmanconverter/LombokAnnotator.java index 4817d3a..aaf344b 100644 --- a/src/main/java/org/cschoell/postman/converter/postmanconverter/LombokAnnotator.java +++ b/postman-bruno-converter/src/main/java/org/cschoell/postman/schematoobject/postmanconverter/LombokAnnotator.java @@ -1,4 +1,4 @@ -package org.cschoell.postman.converter.postmanconverter; +package org.cschoell.postman.schematoobject.postmanconverter; import com.fasterxml.jackson.databind.JsonNode; import com.sun.codemodel.JDefinedClass; diff --git a/src/test/resources/TestCollection1.json b/postman-bruno-converter/src/main/resources/TestCollection1.json similarity index 100% rename from src/test/resources/TestCollection1.json rename to postman-bruno-converter/src/main/resources/TestCollection1.json diff --git a/src/test/resources/postmanecho.json b/postman-bruno-converter/src/main/resources/postmanecho.json similarity index 100% rename from src/test/resources/postmanecho.json rename to postman-bruno-converter/src/main/resources/postmanecho.json diff --git a/src/test/java/org/cschoell/bruno/BrunoCollectionWriterTest.java b/postman-bruno-converter/src/test/java/org/cschoell/bruno/BrunoCollectionWriterTest.java similarity index 100% rename from src/test/java/org/cschoell/bruno/BrunoCollectionWriterTest.java rename to postman-bruno-converter/src/test/java/org/cschoell/bruno/BrunoCollectionWriterTest.java diff --git a/src/test/java/org/cschoell/bruno/RequestContentBuilderTest.java b/postman-bruno-converter/src/test/java/org/cschoell/bruno/RequestContentBuilderTest.java similarity index 100% rename from src/test/java/org/cschoell/bruno/RequestContentBuilderTest.java rename to postman-bruno-converter/src/test/java/org/cschoell/bruno/RequestContentBuilderTest.java diff --git a/src/test/java/org/cschoell/postman/converter/postmanconverter/ConverterRunner.java b/postman-bruno-converter/src/test/java/org/cschoell/postman/converter/postmanconverter/ConverterRunner.java similarity index 100% rename from src/test/java/org/cschoell/postman/converter/postmanconverter/ConverterRunner.java rename to postman-bruno-converter/src/test/java/org/cschoell/postman/converter/postmanconverter/ConverterRunner.java diff --git a/src/test/java/org/cschoell/testsupport/TestCollectionProvider.java b/postman-bruno-converter/src/test/java/org/cschoell/testsupport/TestCollectionProvider.java similarity index 92% rename from src/test/java/org/cschoell/testsupport/TestCollectionProvider.java rename to postman-bruno-converter/src/test/java/org/cschoell/testsupport/TestCollectionProvider.java index 092c3a6..47e44fd 100644 --- a/src/test/java/org/cschoell/testsupport/TestCollectionProvider.java +++ b/postman-bruno-converter/src/test/java/org/cschoell/testsupport/TestCollectionProvider.java @@ -1,7 +1,7 @@ package org.cschoell.testsupport; import com.fasterxml.jackson.databind.json.JsonMapper; -import org.cschoell.postman.converter.PostmanObjectMapperBuilder; +import org.cschoell.postman.schematoobject.PostmanObjectMapperBuilder; import org.cschoell.postman.model.PostmanCollection; import java.io.IOException; diff --git a/postman-model/pom.xml b/postman-model/pom.xml new file mode 100644 index 0000000..e86092b --- /dev/null +++ b/postman-model/pom.xml @@ -0,0 +1,31 @@ + + + 4.0.0 + + org.cschoell.apiclient.converter + apiclient-converter-parent + 0.0.1-SNAPSHOT + ../pom.xml + + + postman-model + 0.0.1-SNAPSHOT + postman-model + Bruno Model description + + 17 + 1.5.5.Final + + + + org.projectlombok + lombok + compile + + + com.fasterxml.jackson.core + jackson-annotations + + + diff --git a/src/main/java/org/cschoell/postman/model/AdditionalProperty.java b/postman-model/src/main/java/org/cschoell/postman/model/AdditionalProperty.java similarity index 100% rename from src/main/java/org/cschoell/postman/model/AdditionalProperty.java rename to postman-model/src/main/java/org/cschoell/postman/model/AdditionalProperty.java diff --git a/src/main/java/org/cschoell/postman/model/Auth.java b/postman-model/src/main/java/org/cschoell/postman/model/Auth.java similarity index 100% rename from src/main/java/org/cschoell/postman/model/Auth.java rename to postman-model/src/main/java/org/cschoell/postman/model/Auth.java diff --git a/src/main/java/org/cschoell/postman/model/AuthAttribute.java b/postman-model/src/main/java/org/cschoell/postman/model/AuthAttribute.java similarity index 100% rename from src/main/java/org/cschoell/postman/model/AuthAttribute.java rename to postman-model/src/main/java/org/cschoell/postman/model/AuthAttribute.java diff --git a/src/main/java/org/cschoell/postman/model/Body.java b/postman-model/src/main/java/org/cschoell/postman/model/Body.java similarity index 100% rename from src/main/java/org/cschoell/postman/model/Body.java rename to postman-model/src/main/java/org/cschoell/postman/model/Body.java diff --git a/src/main/java/org/cschoell/postman/model/Cert.java b/postman-model/src/main/java/org/cschoell/postman/model/Cert.java similarity index 100% rename from src/main/java/org/cschoell/postman/model/Cert.java rename to postman-model/src/main/java/org/cschoell/postman/model/Cert.java diff --git a/src/main/java/org/cschoell/postman/model/Certificate.java b/postman-model/src/main/java/org/cschoell/postman/model/Certificate.java similarity index 100% rename from src/main/java/org/cschoell/postman/model/Certificate.java rename to postman-model/src/main/java/org/cschoell/postman/model/Certificate.java diff --git a/src/main/java/org/cschoell/postman/model/Cookie.java b/postman-model/src/main/java/org/cschoell/postman/model/Cookie.java similarity index 100% rename from src/main/java/org/cschoell/postman/model/Cookie.java rename to postman-model/src/main/java/org/cschoell/postman/model/Cookie.java diff --git a/src/main/java/org/cschoell/postman/model/Description.java b/postman-model/src/main/java/org/cschoell/postman/model/Description.java similarity index 100% rename from src/main/java/org/cschoell/postman/model/Description.java rename to postman-model/src/main/java/org/cschoell/postman/model/Description.java diff --git a/src/main/java/org/cschoell/postman/model/Event.java b/postman-model/src/main/java/org/cschoell/postman/model/Event.java similarity index 100% rename from src/main/java/org/cschoell/postman/model/Event.java rename to postman-model/src/main/java/org/cschoell/postman/model/Event.java diff --git a/src/main/java/org/cschoell/postman/model/File.java b/postman-model/src/main/java/org/cschoell/postman/model/File.java similarity index 100% rename from src/main/java/org/cschoell/postman/model/File.java rename to postman-model/src/main/java/org/cschoell/postman/model/File.java diff --git a/src/main/java/org/cschoell/postman/model/Formdatum.java b/postman-model/src/main/java/org/cschoell/postman/model/Formdatum.java similarity index 100% rename from src/main/java/org/cschoell/postman/model/Formdatum.java rename to postman-model/src/main/java/org/cschoell/postman/model/Formdatum.java diff --git a/src/main/java/org/cschoell/postman/model/Graphql.java b/postman-model/src/main/java/org/cschoell/postman/model/Graphql.java similarity index 100% rename from src/main/java/org/cschoell/postman/model/Graphql.java rename to postman-model/src/main/java/org/cschoell/postman/model/Graphql.java diff --git a/src/main/java/org/cschoell/postman/model/Header.java b/postman-model/src/main/java/org/cschoell/postman/model/Header.java similarity index 100% rename from src/main/java/org/cschoell/postman/model/Header.java rename to postman-model/src/main/java/org/cschoell/postman/model/Header.java diff --git a/src/main/java/org/cschoell/postman/model/Info.java b/postman-model/src/main/java/org/cschoell/postman/model/Info.java similarity index 100% rename from src/main/java/org/cschoell/postman/model/Info.java rename to postman-model/src/main/java/org/cschoell/postman/model/Info.java diff --git a/src/main/java/org/cschoell/postman/model/Item.java b/postman-model/src/main/java/org/cschoell/postman/model/Item.java similarity index 100% rename from src/main/java/org/cschoell/postman/model/Item.java rename to postman-model/src/main/java/org/cschoell/postman/model/Item.java diff --git a/src/main/java/org/cschoell/postman/model/ItemBase.java b/postman-model/src/main/java/org/cschoell/postman/model/ItemBase.java similarity index 100% rename from src/main/java/org/cschoell/postman/model/ItemBase.java rename to postman-model/src/main/java/org/cschoell/postman/model/ItemBase.java diff --git a/src/main/java/org/cschoell/postman/model/Key.java b/postman-model/src/main/java/org/cschoell/postman/model/Key.java similarity index 100% rename from src/main/java/org/cschoell/postman/model/Key.java rename to postman-model/src/main/java/org/cschoell/postman/model/Key.java diff --git a/src/main/java/org/cschoell/postman/model/Options.java b/postman-model/src/main/java/org/cschoell/postman/model/Options.java similarity index 100% rename from src/main/java/org/cschoell/postman/model/Options.java rename to postman-model/src/main/java/org/cschoell/postman/model/Options.java diff --git a/src/main/java/org/cschoell/postman/model/PostmanCollection.java b/postman-model/src/main/java/org/cschoell/postman/model/PostmanCollection.java similarity index 100% rename from src/main/java/org/cschoell/postman/model/PostmanCollection.java rename to postman-model/src/main/java/org/cschoell/postman/model/PostmanCollection.java diff --git a/src/main/java/org/cschoell/postman/model/PostmanPolymorphicBase.java b/postman-model/src/main/java/org/cschoell/postman/model/PostmanPolymorphicBase.java similarity index 100% rename from src/main/java/org/cschoell/postman/model/PostmanPolymorphicBase.java rename to postman-model/src/main/java/org/cschoell/postman/model/PostmanPolymorphicBase.java diff --git a/src/main/java/org/cschoell/postman/model/ProtocolProfileBehavior.java b/postman-model/src/main/java/org/cschoell/postman/model/ProtocolProfileBehavior.java similarity index 100% rename from src/main/java/org/cschoell/postman/model/ProtocolProfileBehavior.java rename to postman-model/src/main/java/org/cschoell/postman/model/ProtocolProfileBehavior.java diff --git a/src/main/java/org/cschoell/postman/model/ProxyConfig.java b/postman-model/src/main/java/org/cschoell/postman/model/ProxyConfig.java similarity index 100% rename from src/main/java/org/cschoell/postman/model/ProxyConfig.java rename to postman-model/src/main/java/org/cschoell/postman/model/ProxyConfig.java diff --git a/src/main/java/org/cschoell/postman/model/Query.java b/postman-model/src/main/java/org/cschoell/postman/model/Query.java similarity index 100% rename from src/main/java/org/cschoell/postman/model/Query.java rename to postman-model/src/main/java/org/cschoell/postman/model/Query.java diff --git a/src/main/java/org/cschoell/postman/model/Request.java b/postman-model/src/main/java/org/cschoell/postman/model/Request.java similarity index 100% rename from src/main/java/org/cschoell/postman/model/Request.java rename to postman-model/src/main/java/org/cschoell/postman/model/Request.java diff --git a/src/main/java/org/cschoell/postman/model/Response.java b/postman-model/src/main/java/org/cschoell/postman/model/Response.java similarity index 100% rename from src/main/java/org/cschoell/postman/model/Response.java rename to postman-model/src/main/java/org/cschoell/postman/model/Response.java diff --git a/src/main/java/org/cschoell/postman/model/Script.java b/postman-model/src/main/java/org/cschoell/postman/model/Script.java similarity index 100% rename from src/main/java/org/cschoell/postman/model/Script.java rename to postman-model/src/main/java/org/cschoell/postman/model/Script.java diff --git a/src/main/java/org/cschoell/postman/model/Timings.java b/postman-model/src/main/java/org/cschoell/postman/model/Timings.java similarity index 100% rename from src/main/java/org/cschoell/postman/model/Timings.java rename to postman-model/src/main/java/org/cschoell/postman/model/Timings.java diff --git a/src/main/java/org/cschoell/postman/model/Url.java b/postman-model/src/main/java/org/cschoell/postman/model/Url.java similarity index 100% rename from src/main/java/org/cschoell/postman/model/Url.java rename to postman-model/src/main/java/org/cschoell/postman/model/Url.java diff --git a/src/main/java/org/cschoell/postman/model/Urlencoded.java b/postman-model/src/main/java/org/cschoell/postman/model/Urlencoded.java similarity index 100% rename from src/main/java/org/cschoell/postman/model/Urlencoded.java rename to postman-model/src/main/java/org/cschoell/postman/model/Urlencoded.java diff --git a/src/main/java/org/cschoell/postman/model/Variable.java b/postman-model/src/main/java/org/cschoell/postman/model/Variable.java similarity index 100% rename from src/main/java/org/cschoell/postman/model/Variable.java rename to postman-model/src/main/java/org/cschoell/postman/model/Variable.java diff --git a/src/main/java/org/cschoell/postman/model/Version.java b/postman-model/src/main/java/org/cschoell/postman/model/Version.java similarity index 100% rename from src/main/java/org/cschoell/postman/model/Version.java rename to postman-model/src/main/java/org/cschoell/postman/model/Version.java diff --git a/src/main/java/org/cschoell/postman/model/VirtualFolder.java b/postman-model/src/main/java/org/cschoell/postman/model/VirtualFolder.java similarity index 100% rename from src/main/java/org/cschoell/postman/model/VirtualFolder.java rename to postman-model/src/main/java/org/cschoell/postman/model/VirtualFolder.java diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties deleted file mode 100644 index 8b13789..0000000 --- a/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/main/resources/postmanschema.json b/src/main/resources/postmanschema.json deleted file mode 100644 index 97afb12..0000000 --- a/src/main/resources/postmanschema.json +++ /dev/null @@ -1,1187 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "https://schema.getpostman.com/json/collection/v2.1.0/", - "type": "object", - "properties": { - "info": { - "$ref": "#/definitions/info" - }, - "item": { - "type": "array", - "description": "Items are the basic unit for a Postman collection. You can think of them as corresponding to a single API endpoint. Each Item has one request and may have multiple API responses associated with it.", - "items": { - "title": "Items", - "oneOf": [ - { - "$ref": "#/definitions/item" - }, - { - "$ref": "#/definitions/item-group" - } - ] - } - }, - "event": { - "$ref": "#/definitions/event-list" - }, - "variable": { - "$ref": "#/definitions/variable-list" - }, - "auth": { - "oneOf": [ - { - "type": "null" - }, - { - "$ref": "#/definitions/auth" - } - ] - }, - "protocolProfileBehavior": { - "$ref": "#/definitions/protocol-profile-behavior" - } - }, - "required": [ - "info", - "item" - ], - "definitions": { - "auth-attribute": { - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "title": "Auth", - "id": "#/definitions/auth-attribute", - "description": "Represents an attribute for any authorization method provided by Postman. For example `username` and `password` are set as auth attributes for Basic Authentication method.", - "properties": { - "key": { - "type": "string" - }, - "value": {}, - "type": { - "type": "string" - } - }, - "required": [ - "key" - ] - }, - "auth": { - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "title": "Auth", - "id": "#/definitions/auth", - "description": "Represents authentication helpers provided by Postman", - "properties": { - "type": { - "type": "string", - "enum": [ - "apikey", - "awsv4", - "basic", - "bearer", - "digest", - "edgegrid", - "hawk", - "noauth", - "oauth1", - "oauth2", - "ntlm" - ] - }, - "noauth": {}, - "apikey": { - "type": "array", - "title": "API Key Authentication", - "description": "The attributes for API Key Authentication.", - "items": { - "$ref": "#/definitions/auth-attribute" - } - }, - "awsv4": { - "type": "array", - "title": "AWS Signature v4", - "description": "The attributes for [AWS Auth](http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html).", - "items": { - "$ref": "#/definitions/auth-attribute" - } - }, - "basic": { - "type": "array", - "title": "Basic Authentication", - "description": "The attributes for [Basic Authentication](https://en.wikipedia.org/wiki/Basic_access_authentication).", - "items": { - "$ref": "#/definitions/auth-attribute" - } - }, - "bearer": { - "type": "array", - "title": "Bearer Token Authentication", - "description": "The helper attributes for [Bearer Token Authentication](https://tools.ietf.org/html/rfc6750)", - "items": { - "$ref": "#/definitions/auth-attribute" - } - }, - "digest": { - "type": "array", - "title": "Digest Authentication", - "description": "The attributes for [Digest Authentication](https://en.wikipedia.org/wiki/Digest_access_authentication).", - "items": { - "$ref": "#/definitions/auth-attribute" - } - }, - "edgegrid": { - "type": "array", - "title": "EdgeGrid Authentication", - "description": "The attributes for [Akamai EdgeGrid Authentication](https://developer.akamai.com/legacy/introduction/Client_Auth.html).", - "items": { - "$ref": "#/definitions/auth-attribute" - } - }, - "hawk": { - "type": "array", - "title": "Hawk Authentication", - "description": "The attributes for [Hawk Authentication](https://github.com/hueniverse/hawk)", - "items": { - "$ref": "#/definitions/auth-attribute" - } - }, - "ntlm": { - "type": "array", - "title": "NTLM Authentication", - "description": "The attributes for [NTLM Authentication](https://msdn.microsoft.com/en-us/library/cc237488.aspx)", - "items": { - "$ref": "#/definitions/auth-attribute" - } - }, - "oauth1": { - "type": "array", - "title": "OAuth1", - "description": "The attributes for [OAuth2](https://oauth.net/1/)", - "items": { - "$ref": "#/definitions/auth-attribute" - } - }, - "oauth2": { - "type": "array", - "title": "OAuth2", - "description": "Helper attributes for [OAuth2](https://oauth.net/2/)", - "items": { - "$ref": "#/definitions/auth-attribute" - } - } - }, - "required": [ - "type" - ] - }, - "certificate-list": { - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "#/definitions/certificate-list", - "title": "Certificate List", - "description": "A representation of a list of ssl certificates", - "type": "array", - "items": { - "$ref": "#/definitions/certificate" - } - }, - "certificate": { - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "#/definitions/certificate", - "title": "Certificate", - "description": "A representation of an ssl certificate", - "type": "object", - "properties": { - "name": { - "description": "A name for the certificate for user reference", - "type": "string" - }, - "matches": { - "description": "A list of Url match pattern strings, to identify Urls this certificate can be used for.", - "type": "array", - "items": { - "type": "string", - "description": "An Url match pattern string" - } - }, - "key": { - "description": "An object containing path to file containing private key, on the file system", - "type": "object", - "properties": { - "src": { - "description": "The path to file containing key for certificate, on the file system" - } - } - }, - "cert": { - "description": "An object containing path to file certificate, on the file system", - "type": "object", - "properties": { - "src": { - "description": "The path to file containing key for certificate, on the file system" - } - } - }, - "passphrase": { - "description": "The passphrase for the certificate", - "type": "string" - } - } - }, - "cookie-list": { - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "#/definitions/cookie-list", - "title": "Certificate List", - "description": "A representation of a list of cookies", - "type": "array", - "items": { - "$ref": "#/definitions/cookie" - } - }, - "cookie": { - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "title": "Cookie", - "id": "#/definitions/cookie", - "description": "A Cookie, that follows the [Google Chrome format](https://developer.chrome.com/extensions/cookies)", - "properties": { - "domain": { - "type": "string", - "description": "The domain for which this cookie is valid." - }, - "expires": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "number" - } - ], - "description": "When the cookie expires." - }, - "maxAge": { - "type": "string" - }, - "hostOnly": { - "type": "boolean", - "description": "True if the cookie is a host-only cookie. (i.e. a request's URL domain must exactly match the domain of the cookie)." - }, - "httpOnly": { - "type": "boolean", - "description": "Indicates if this cookie is HTTP Only. (if True, the cookie is inaccessible to client-side scripts)" - }, - "name": { - "type": "string", - "description": "This is the name of the Cookie." - }, - "path": { - "type": "string", - "description": "The path associated with the Cookie." - }, - "secure": { - "type": "boolean", - "description": "Indicates if the 'secure' flag is set on the Cookie, meaning that it is transmitted over secure connections only. (typically HTTPS)" - }, - "session": { - "type": "boolean", - "description": "True if the cookie is a session cookie." - }, - "value": { - "type": "string", - "description": "The value of the Cookie." - }, - "extensions": { - "type": "array", - "description": "Custom attributes for a cookie go here, such as the [Priority Field](https://code.google.com/p/chromium/issues/detail?id=232693)" - } - }, - "required": [ - "domain", - "path" - ] - }, - "description": { - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "#/definitions/description", - "description": "A Description can be a raw text, or be an object, which holds the description along with its format.", - "oneOf": [ - { - "type": "object", - "title": "Description", - "properties": { - "content": { - "type": "string", - "description": "The content of the description goes here, as a raw string." - }, - "type": { - "type": "string", - "description": "Holds the mime type of the raw description content. E.g: 'text/markdown' or 'text/html'.\nThe type is used to correctly render the description when generating documentation, or in the Postman app." - }, - "version": { - "description": "Description can have versions associated with it, which should be put in this property." - } - } - }, - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "event-list": { - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "#/definitions/event-list", - "title": "Event List", - "type": "array", - "description": "Postman allows you to configure scripts to run when specific events occur. These scripts are stored here, and can be referenced in the collection by their ID.", - "items": { - "$ref": "#/definitions/event" - } - }, - "event": { - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "#/definitions/event", - "title": "Event", - "description": "Defines a script associated with an associated event name", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "A unique identifier for the enclosing event." - }, - "listen": { - "type": "string", - "description": "Can be set to `test` or `prerequest` for test scripts or pre-request scripts respectively." - }, - "script": { - "$ref": "#/definitions/script" - }, - "disabled": { - "type": "boolean", - "default": false, - "description": "Indicates whether the event is disabled. If absent, the event is assumed to be enabled." - } - }, - "required": [ - "listen" - ] - }, - "header-list": { - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "#/definitions/header-list", - "title": "Header List", - "description": "A representation for a list of headers", - "type": "array", - "items": { - "$ref": "#/definitions/header" - } - }, - "header": { - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "title": "Header", - "id": "#/definitions/header", - "description": "Represents a single HTTP Header", - "properties": { - "key": { - "description": "This holds the LHS of the HTTP Header, e.g ``Content-Type`` or ``X-Custom-Header``", - "type": "string" - }, - "value": { - "type": "string", - "description": "The value (or the RHS) of the Header is stored in this field." - }, - "disabled": { - "type": "boolean", - "default": false, - "description": "If set to true, the current header will not be sent with requests." - }, - "description": { - "$ref": "#/definitions/description" - } - }, - "required": [ - "key", - "value" - ] - }, - "info": { - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "#/definitions/info", - "title": "Information", - "description": "Detailed description of the info block", - "type": "object", - "properties": { - "name": { - "type": "string", - "title": "Name of the collection", - "description": "A collection's friendly name is defined by this field. You would want to set this field to a value that would allow you to easily identify this collection among a bunch of other collections, as such outlining its usage or content." - }, - "_postman_id": { - "type": "string", - "description": "Every collection is identified by the unique value of this field. The value of this field is usually easiest to generate using a UID generator function. If you already have a collection, it is recommended that you maintain the same id since changing the id usually implies that is a different collection than it was originally.\n *Note: This field exists for compatibility reasons with Collection Format V1.*" - }, - "description": { - "$ref": "#/definitions/description" - }, - "version": { - "$ref": "#/definitions/version" - }, - "schema": { - "description": "This should ideally hold a link to the Postman schema that is used to validate this collection. E.g: https://schema.postman.com/collection/v1", - "type": "string" - } - }, - "required": [ - "name", - "schema" - ] - }, - "item-group": { - "$schema": "http://json-schema.org/draft-04/schema#", - "title": "Folder", - "id": "#/definitions/item-group", - "description": "One of the primary goals of Postman is to organize the development of APIs. To this end, it is necessary to be able to group requests together. This can be achived using 'Folders'. A folder just is an ordered set of requests.", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "A folder's friendly name is defined by this field. You would want to set this field to a value that would allow you to easily identify this folder." - }, - "description": { - "$ref": "#/definitions/description" - }, - "variable": { - "$ref": "#/definitions/variable-list" - }, - "item": { - "description": "Items are entities which contain an actual HTTP request, and sample responses attached to it. Folders may contain many items.", - "type": "array", - "items": { - "title": "Items", - "anyOf": [ - { - "$ref": "#/definitions/item" - }, - { - "$ref": "#/definitions/item-group" - } - ] - } - }, - "event": { - "$ref": "#/definitions/event-list" - }, - "auth": { - "oneOf": [ - { - "type": "null" - }, - { - "$ref": "#/definitions/auth" - } - ] - }, - "protocolProfileBehavior": { - "$ref": "#/definitions/protocol-profile-behavior" - } - }, - "required": [ - "item" - ] - }, - "item": { - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "title": "Item", - "id": "#/definitions/item", - "description": "Items are entities which contain an actual HTTP request, and sample responses attached to it.", - "properties": { - "id": { - "type": "string", - "description": "A unique ID that is used to identify collections internally" - }, - "name": { - "type": "string", - "description": "A human readable identifier for the current item." - }, - "description": { - "$ref": "#/definitions/description" - }, - "variable": { - "$ref": "#/definitions/variable-list" - }, - "event": { - "$ref": "#/definitions/event-list" - }, - "request": { - "$ref": "#/definitions/request" - }, - "response": { - "type": "array", - "title": "Responses", - "items": { - "$ref": "#/definitions/response" - } - }, - "protocolProfileBehavior": { - "$ref": "#/definitions/protocol-profile-behavior" - } - }, - "required": [ - "request" - ] - }, - "protocol-profile-behavior": { - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "title": "Protocol Profile Behavior", - "id": "#/definitions/protocol-profile-behavior", - "description": "Set of configurations used to alter the usual behavior of sending the request" - }, - "proxy-config": { - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "#/definitions/proxy-config", - "title": "Proxy Config", - "description": "Using the Proxy, you can configure your custom proxy into the postman for particular url match", - "type": "object", - "properties": { - "match": { - "default": "http+https://*/*", - "description": "The Url match for which the proxy config is defined", - "type": "string" - }, - "host": { - "type": "string", - "description": "The proxy server host" - }, - "port": { - "type": "integer", - "minimum": 0, - "default": 8080, - "description": "The proxy server port" - }, - "tunnel": { - "description": "The tunneling details for the proxy config", - "default": false, - "type": "boolean" - }, - "disabled": { - "type": "boolean", - "default": false, - "description": "When set to true, ignores this proxy configuration entity" - } - } - }, - "request": { - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "#/definitions/request", - "title": "Request", - "description": "A request represents an HTTP request. If a string, the string is assumed to be the request URL and the method is assumed to be 'GET'.", - "oneOf": [ - { - "type": "object", - "title": "Request", - "properties": { - "url": { - "$ref": "#/definitions/url" - }, - "auth": { - "oneOf": [ - { - "type": "null" - }, - { - "$ref": "#/definitions/auth" - } - ] - }, - "proxy": { - "$ref": "#/definitions/proxy-config" - }, - "certificate": { - "$ref": "#/definitions/certificate" - }, - "method": { - "anyOf": [ - { - "description": "The Standard HTTP method associated with this request.", - "type": "string", - "enum": [ - "GET", - "PUT", - "POST", - "PATCH", - "DELETE", - "COPY", - "HEAD", - "OPTIONS", - "LINK", - "UNLINK", - "PURGE", - "LOCK", - "UNLOCK", - "PROPFIND", - "VIEW" - ] - }, - { - "description": "The Custom HTTP method associated with this request.", - "type": "string" - } - ] - }, - "description": { - "$ref": "#/definitions/description" - }, - "header": { - "oneOf": [ - { - "$ref": "#/definitions/header-list" - }, - { - "type": "string" - } - ] - }, - "body": { - "oneOf": [ - { - "type": "object", - "description": "This field contains the data usually contained in the request body.", - "properties": { - "mode": { - "description": "Postman stores the type of data associated with this request in this field.", - "enum": [ - "raw", - "urlencoded", - "formdata", - "file", - "graphql" - ] - }, - "raw": { - "type": "string" - }, - "urlencoded": { - "type": "array", - "items": { - "type": "object", - "title": "UrlEncodedParameter", - "properties": { - "key": { - "type": "string" - }, - "value": { - "type": "string" - }, - "disabled": { - "type": "boolean", - "default": false - }, - "description": { - "$ref": "#/definitions/description" - } - }, - "required": [ - "key" - ] - } - }, - "formdata": { - "type": "array", - "items": { - "type": "object", - "title": "FormParameter", - "anyOf": [ - { - "properties": { - "key": { - "type": "string" - }, - "value": { - "type": "string" - }, - "disabled": { - "type": "boolean", - "default": false, - "description": "When set to true, prevents this form data entity from being sent." - }, - "type": { - "type": "string", - "enum": [ - "text" - ] - }, - "contentType": { - "type": "string", - "description": "Override Content-Type header of this form data entity." - }, - "description": { - "$ref": "#/definitions/description" - } - }, - "required": [ - "key" - ] - }, - { - "properties": { - "key": { - "type": "string" - }, - "src": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "null" - }, - { - "type": "array" - } - ] - }, - "disabled": { - "type": "boolean", - "default": false, - "description": "When set to true, prevents this form data entity from being sent." - }, - "type": { - "type": "string", - "enum": [ - "file" - ] - }, - "contentType": { - "type": "string", - "description": "Override Content-Type header of this form data entity." - }, - "description": { - "$ref": "#/definitions/description" - } - }, - "required": [ - "key" - ] - } - ] - } - }, - "file": { - "type": "object", - "properties": { - "src": { - "oneOf": [ - { - "type": "string", - "description": "Contains the name of the file to upload. _Not the path_." - }, - { - "type": "null", - "description": "A null src indicates that no file has been selected as a part of the request body" - } - ] - }, - "content": { - "type": "string" - } - } - }, - "graphql": { - "type": "object" - }, - "options": { - "type": "object", - "description": "Additional configurations and options set for various body modes." - }, - "disabled": { - "type": "boolean", - "default": false, - "description": "When set to true, prevents request body from being sent." - } - } - }, - { - "type": "null" - } - ] - } - } - }, - { - "type": "string" - } - ] - }, - "response": { - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "#/definitions/response", - "title": "Response", - "description": "A response represents an HTTP response.", - "properties": { - "id": { - "description": "A unique, user defined identifier that can be used to refer to this response from requests.", - "type": "string" - }, - "originalRequest": { - "$ref": "#/definitions/request" - }, - "responseTime": { - "title": "ResponseTime", - "oneOf": [ - { - "type": "null" - }, - { - "type": "string" - }, - { - "type": "number" - } - ], - "description": "The time taken by the request to complete. If a number, the unit is milliseconds. If the response is manually created, this can be set to `null`." - }, - "timings": { - "title": "Response Timings", - "description": "Set of timing information related to request and response in milliseconds", - "oneOf": [ - { - "type": "object" - }, - { - "type": "null" - } - ] - }, - "header": { - "title": "Headers", - "oneOf": [ - { - "type": "array", - "title": "Header", - "description": "No HTTP request is complete without its headers, and the same is true for a Postman request. This field is an array containing all the headers.", - "items": { - "oneOf": [ - { - "$ref": "#/definitions/header" - }, - { - "title": "Header", - "type": "string" - } - ] - } - }, - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "cookie": { - "type": "array", - "items": { - "$ref": "#/definitions/cookie" - } - }, - "body": { - "type": [ - "null", - "string" - ], - "description": "The raw text of the response." - }, - "status": { - "type": "string", - "description": "The response status, e.g: '200 OK'" - }, - "code": { - "type": "integer", - "description": "The numerical response code, example: 200, 201, 404, etc." - } - } - }, - "script": { - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "#/definitions/script", - "title": "Script", - "type": "object", - "description": "A script is a snippet of Javascript code that can be used to to perform setup or teardown operations on a particular response.", - "properties": { - "id": { - "description": "A unique, user defined identifier that can be used to refer to this script from requests.", - "type": "string" - }, - "type": { - "description": "Type of the script. E.g: 'text/javascript'", - "type": "string" - }, - "exec": { - "oneOf": [ - { - "type": "array", - "description": "This is an array of strings, where each line represents a single line of code. Having lines separate makes it possible to easily track changes made to scripts.", - "items": { - "type": "string" - } - }, - { - "type": "string" - } - ] - }, - "src": { - "$ref": "#/definitions/url" - }, - "name": { - "type": "string", - "description": "Script name" - } - } - }, - "url": { - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "If object, contains the complete broken-down URL for this request. If string, contains the literal request URL.", - "id": "#/definitions/url", - "title": "Url", - "oneOf": [ - { - "type": "object", - "properties": { - "raw": { - "type": "string", - "description": "The string representation of the request URL, including the protocol, host, path, hash, query parameter(s) and path variable(s)." - }, - "protocol": { - "type": "string", - "description": "The protocol associated with the request, E.g: 'http'" - }, - "host": { - "title": "Host", - "description": "The host for the URL, E.g: api.yourdomain.com. Can be stored as a string or as an array of strings.", - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - }, - "description": "The host, split into subdomain strings." - } - ] - }, - "path": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "description": "The complete path of the current url, broken down into segments. A segment could be a string, or a path variable.", - "items": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "value": { - "type": "string" - } - } - } - ] - } - } - ] - }, - "port": { - "type": "string", - "description": "The port number present in this URL. An empty value implies 80/443 depending on whether the protocol field contains http/https." - }, - "query": { - "type": "array", - "description": "An array of QueryParams, which is basically the query string part of the URL, parsed into separate variables", - "items": { - "type": "object", - "title": "QueryParam", - "properties": { - "key": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "value": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "disabled": { - "type": "boolean", - "default": false, - "description": "If set to true, the current query parameter will not be sent with the request." - }, - "description": { - "$ref": "#/definitions/description" - } - } - } - }, - "hash": { - "description": "Contains the URL fragment (if any). Usually this is not transmitted over the network, but it could be useful to store this in some cases.", - "type": "string" - }, - "variable": { - "type": "array", - "description": "Postman supports path variables with the syntax `/path/:variableName/to/somewhere`. These variables are stored in this field.", - "items": { - "$ref": "#/definitions/variable" - } - } - } - }, - { - "type": "string" - } - ] - }, - "variable-list": { - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "#/definitions/variable-list", - "title": "Variable List", - "description": "Collection variables allow you to define a set of variables, that are a *part of the collection*, as opposed to environments, which are separate entities.\n*Note: Collection variables must not contain any sensitive information.*", - "type": "array", - "items": { - "$ref": "#/definitions/variable" - } - }, - "variable": { - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "#/definitions/variable", - "title": "Variable", - "description": "Using variables in your Postman requests eliminates the need to duplicate requests, which can save a lot of time. Variables can be defined, and referenced to from any part of a request.", - "type": "object", - "properties": { - "id": { - "description": "A variable ID is a unique user-defined value that identifies the variable within a collection. In traditional terms, this would be a variable name.", - "type": "string" - }, - "key": { - "description": "A variable key is a human friendly value that identifies the variable within a collection. In traditional terms, this would be a variable name.", - "type": "string" - }, - "value": { - "description": "The value that a variable holds in this collection. Ultimately, the variables will be replaced by this value, when say running a set of requests from a collection" - }, - "type": { - "description": "A variable may have multiple types. This field specifies the type of the variable.", - "type": "string", - "enum": [ - "string", - "boolean", - "any", - "number" - ] - }, - "name": { - "type": "string", - "description": "Variable name" - }, - "description": { - "$ref": "#/definitions/description" - }, - "system": { - "type": "boolean", - "default": false, - "description": "When set to true, indicates that this variable has been set by Postman" - }, - "disabled": { - "type": "boolean", - "default": false - } - }, - "anyOf": [ - { - "required": [ - "id" - ] - }, - { - "required": [ - "key" - ] - }, - { - "required": [ - "id", - "key" - ] - } - ] - }, - "version": { - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "#/definitions/version", - "title": "Collection Version", - "description": "Postman allows you to version your collections as they grow, and this field holds the version number. While optional, it is recommended that you use this field to its fullest extent!", - "oneOf": [ - { - "type": "object", - "properties": { - "major": { - "description": "Increment this number if you make changes to the collection that changes its behaviour. E.g: Removing or adding new test scripts. (partly or completely).", - "minimum": 0, - "type": "integer" - }, - "minor": { - "description": "You should increment this number if you make changes that will not break anything that uses the collection. E.g: removing a folder.", - "minimum": 0, - "type": "integer" - }, - "patch": { - "description": "Ideally, minor changes to a collection should result in the increment of this number.", - "minimum": 0, - "type": "integer" - }, - "identifier": { - "description": "A human friendly identifier to make sense of the version numbers. E.g: 'beta-3'", - "type": "string", - "maxLength": 10 - }, - "meta": {} - }, - "required": [ - "major", - "minor", - "patch" - ] - }, - { - "type": "string" - } - ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/postmanschemaNoOneOf.json b/src/main/resources/postmanschemaNoOneOf.json deleted file mode 100644 index b058914..0000000 --- a/src/main/resources/postmanschemaNoOneOf.json +++ /dev/null @@ -1,940 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "https://schema.getpostman.com/json/collection/v2.1.0/", - "type": "object", - "properties": { - "info": { - "$ref": "#/definitions/info" - }, - "item": { - "type": "array", - "description": "Items are the basic unit for a Postman collection. You can think of them as corresponding to a single API endpoint. Each Item has one request and may have multiple API responses associated with it.", - "items": { - "title": "Items", - "$ref": "#/definitions/item" - }, - "items-group": { - "title": "Items", - "$ref": "#/definitions/item-group" - } - }, - "event": { - "$ref": "#/definitions/event-list" - }, - "variable": { - "$ref": "#/definitions/variable-list" - }, - "auth": { - "$ref": "#/definitions/auth" - }, - "protocolProfileBehavior": { - "$ref": "#/definitions/protocol-profile-behavior" - } - }, - "required": [ - "info", - "item" - ], - "definitions": { - "auth-attribute": { - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "title": "Auth", - "id": "#/definitions/auth-attribute", - "description": "Represents an attribute for any authorization method provided by Postman. For example `username` and `password` are set as auth attributes for Basic Authentication method.", - "properties": { - "key": { - "type": "string" - }, - "value": {}, - "type": { - "type": "string" - } - }, - "required": [ - "key" - ] - }, - "auth": { - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "title": "Auth", - "id": "#/definitions/auth", - "description": "Represents authentication helpers provided by Postman", - "properties": { - "type": { - "type": "string", - "enum": [ - "apikey", - "awsv4", - "basic", - "bearer", - "digest", - "edgegrid", - "hawk", - "noauth", - "oauth1", - "oauth2", - "ntlm" - ] - }, - "noauth": {}, - "apikey": { - "type": "array", - "title": "API Key Authentication", - "description": "The attributes for API Key Authentication.", - "items": { - "$ref": "#/definitions/auth-attribute" - } - }, - "awsv4": { - "type": "array", - "title": "AWS Signature v4", - "description": "The attributes for [AWS Auth](http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html).", - "items": { - "$ref": "#/definitions/auth-attribute" - } - }, - "basic": { - "type": "array", - "title": "Basic Authentication", - "description": "The attributes for [Basic Authentication](https://en.wikipedia.org/wiki/Basic_access_authentication).", - "items": { - "$ref": "#/definitions/auth-attribute" - } - }, - "bearer": { - "type": "array", - "title": "Bearer Token Authentication", - "description": "The helper attributes for [Bearer Token Authentication](https://tools.ietf.org/html/rfc6750)", - "items": { - "$ref": "#/definitions/auth-attribute" - } - }, - "digest": { - "type": "array", - "title": "Digest Authentication", - "description": "The attributes for [Digest Authentication](https://en.wikipedia.org/wiki/Digest_access_authentication).", - "items": { - "$ref": "#/definitions/auth-attribute" - } - }, - "edgegrid": { - "type": "array", - "title": "EdgeGrid Authentication", - "description": "The attributes for [Akamai EdgeGrid Authentication](https://developer.akamai.com/legacy/introduction/Client_Auth.html).", - "items": { - "$ref": "#/definitions/auth-attribute" - } - }, - "hawk": { - "type": "array", - "title": "Hawk Authentication", - "description": "The attributes for [Hawk Authentication](https://github.com/hueniverse/hawk)", - "items": { - "$ref": "#/definitions/auth-attribute" - } - }, - "ntlm": { - "type": "array", - "title": "NTLM Authentication", - "description": "The attributes for [NTLM Authentication](https://msdn.microsoft.com/en-us/library/cc237488.aspx)", - "items": { - "$ref": "#/definitions/auth-attribute" - } - }, - "oauth1": { - "type": "array", - "title": "OAuth1", - "description": "The attributes for [OAuth2](https://oauth.net/1/)", - "items": { - "$ref": "#/definitions/auth-attribute" - } - }, - "oauth2": { - "type": "array", - "title": "OAuth2", - "description": "Helper attributes for [OAuth2](https://oauth.net/2/)", - "items": { - "$ref": "#/definitions/auth-attribute" - } - } - }, - "required": [ - "type" - ] - }, - "certificate-list": { - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "#/definitions/certificate-list", - "title": "Certificate List", - "description": "A representation of a list of ssl certificates", - "type": "array", - "items": { - "$ref": "#/definitions/certificate" - } - }, - "certificate": { - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "#/definitions/certificate", - "title": "Certificate", - "description": "A representation of an ssl certificate", - "type": "object", - "properties": { - "name": { - "description": "A name for the certificate for user reference", - "type": "string" - }, - "matches": { - "description": "A list of Url match pattern strings, to identify Urls this certificate can be used for.", - "type": "array", - "items": { - "type": "string", - "description": "An Url match pattern string" - } - }, - "key": { - "description": "An object containing path to file containing private key, on the file system", - "type": "object", - "properties": { - "src": { - "description": "The path to file containing key for certificate, on the file system" - } - } - }, - "cert": { - "description": "An object containing path to file certificate, on the file system", - "type": "object", - "properties": { - "src": { - "description": "The path to file containing key for certificate, on the file system" - } - } - }, - "passphrase": { - "description": "The passphrase for the certificate", - "type": "string" - } - } - }, - "cookie-list": { - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "#/definitions/cookie-list", - "title": "Certificate List", - "description": "A representation of a list of cookies", - "type": "array", - "items": { - "$ref": "#/definitions/cookie" - } - }, - "cookie": { - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "title": "Cookie", - "id": "#/definitions/cookie", - "description": "A Cookie, that follows the [Google Chrome format](https://developer.chrome.com/extensions/cookies)", - "properties": { - "domain": { - "type": "string", - "description": "The domain for which this cookie is valid." - }, - "expires": { - "type": "string", - "description": "When the cookie expires." - }, - "maxAge": { - "type": "string" - }, - "hostOnly": { - "type": "boolean", - "description": "True if the cookie is a host-only cookie. (i.e. a request's URL domain must exactly match the domain of the cookie)." - }, - "httpOnly": { - "type": "boolean", - "description": "Indicates if this cookie is HTTP Only. (if True, the cookie is inaccessible to client-side scripts)" - }, - "name": { - "type": "string", - "description": "This is the name of the Cookie." - }, - "path": { - "type": "string", - "description": "The path associated with the Cookie." - }, - "secure": { - "type": "boolean", - "description": "Indicates if the 'secure' flag is set on the Cookie, meaning that it is transmitted over secure connections only. (typically HTTPS)" - }, - "session": { - "type": "boolean", - "description": "True if the cookie is a session cookie." - }, - "value": { - "type": "string", - "description": "The value of the Cookie." - }, - "extensions": { - "type": "array", - "description": "Custom attributes for a cookie go here, such as the [Priority Field](https://code.google.com/p/chromium/issues/detail?id=232693)" - } - }, - "required": [ - "domain", - "path" - ] - }, - "description": { - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "#/definitions/description", - "description": "A Description can be a raw text, or be an object, which holds the description along with its format.", - "type": "object", - "title": "Description", - "properties": { - "content": { - "type": "string", - "description": "The content of the description goes here, as a raw string." - }, - "type": { - "type": "string", - "description": "Holds the mime type of the raw description content. E.g: 'text/markdown' or 'text/html'.\nThe type is used to correctly render the description when generating documentation, or in the Postman app." - }, - "version": { - "description": "Description can have versions associated with it, which should be put in this property." - } - } - }, - "event-list": { - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "#/definitions/event-list", - "title": "Event List", - "type": "array", - "description": "Postman allows you to configure scripts to run when specific events occur. These scripts are stored here, and can be referenced in the collection by their ID.", - "items": { - "$ref": "#/definitions/event" - } - }, - "event": { - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "#/definitions/event", - "title": "Event", - "description": "Defines a script associated with an associated event name", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "A unique identifier for the enclosing event." - }, - "listen": { - "type": "string", - "description": "Can be set to `test` or `prerequest` for test scripts or pre-request scripts respectively." - }, - "script": { - "$ref": "#/definitions/script" - }, - "disabled": { - "type": "boolean", - "default": false, - "description": "Indicates whether the event is disabled. If absent, the event is assumed to be enabled." - } - }, - "required": [ - "listen" - ] - }, - "header-list": { - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "#/definitions/header-list", - "title": "Header List", - "description": "A representation for a list of headers", - "type": "array", - "items": { - "$ref": "#/definitions/header" - } - }, - "header": { - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "title": "Header", - "id": "#/definitions/header", - "description": "Represents a single HTTP Header", - "properties": { - "key": { - "description": "This holds the LHS of the HTTP Header, e.g ``Content-Type`` or ``X-Custom-Header``", - "type": "string" - }, - "value": { - "type": "string", - "description": "The value (or the RHS) of the Header is stored in this field." - }, - "disabled": { - "type": "boolean", - "default": false, - "description": "If set to true, the current header will not be sent with requests." - }, - "description": { - "$ref": "#/definitions/description" - } - }, - "required": [ - "key", - "value" - ] - }, - "info": { - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "#/definitions/info", - "title": "Information", - "description": "Detailed description of the info block", - "type": "object", - "properties": { - "name": { - "type": "string", - "title": "Name of the collection", - "description": "A collection's friendly name is defined by this field. You would want to set this field to a value that would allow you to easily identify this collection among a bunch of other collections, as such outlining its usage or content." - }, - "_postman_id": { - "type": "string", - "description": "Every collection is identified by the unique value of this field. The value of this field is usually easiest to generate using a UID generator function. If you already have a collection, it is recommended that you maintain the same id since changing the id usually implies that is a different collection than it was originally.\n *Note: This field exists for compatibility reasons with Collection Format V1.*" - }, - "description": { - "$ref": "#/definitions/description" - }, - "version": { - "$ref": "#/definitions/version" - }, - "schema": { - "description": "This should ideally hold a link to the Postman schema that is used to validate this collection. E.g: https://schema.getpostman.com/collection/v1", - "type": "string" - } - }, - "required": [ - "name", - "schema" - ] - }, - "item-group": { - "$schema": "http://json-schema.org/draft-04/schema#", - "title": "Folder", - "id": "#/definitions/item-group", - "description": "One of the primary goals of Postman is to organize the development of APIs. To this end, it is necessary to be able to group requests together. This can be achived using 'Folders'. A folder just is an ordered set of requests.", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "A folder's friendly name is defined by this field. You would want to set this field to a value that would allow you to easily identify this folder." - }, - "description": { - "$ref": "#/definitions/description" - }, - "variable": { - "$ref": "#/definitions/variable-list" - }, - "item": { - "description": "Items are entities which contain an actual HTTP request, and sample responses attached to it. Folders may contain many items.", - "type": "array", - "items": { - "$ref": "#/definitions/item" - } - }, - "event": { - "$ref": "#/definitions/event-list" - }, - "auth": { - "$ref": "#/definitions/auth" - }, - "protocolProfileBehavior": { - "$ref": "#/definitions/protocol-profile-behavior" - } - }, - "required": [ - "item" - ] - }, - "item": { - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "title": "Item", - "id": "#/definitions/item", - "description": "Items are entities which contain an actual HTTP request, and sample responses attached to it.", - "properties": { - "id": { - "type": "string", - "description": "A unique ID that is used to identify collections internally" - }, - "name": { - "type": "string", - "description": "A human readable identifier for the current item." - }, - "description": { - "$ref": "#/definitions/description" - }, - "variable": { - "$ref": "#/definitions/variable-list" - }, - "event": { - "$ref": "#/definitions/event-list" - }, - "request": { - "$ref": "#/definitions/request" - }, - "response": { - "type": "array", - "title": "Responses", - "items": { - "$ref": "#/definitions/response" - } - }, - "protocolProfileBehavior": { - "$ref": "#/definitions/protocol-profile-behavior" - } - }, - "required": [ - "request" - ] - }, - "protocol-profile-behavior": { - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "title": "Protocol Profile Behavior", - "id": "#/definitions/protocol-profile-behavior", - "description": "Set of configurations used to alter the usual behavior of sending the request" - }, - "proxy-config": { - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "#/definitions/proxy-config", - "title": "Proxy Config", - "description": "Using the Proxy, you can configure your custom proxy into the postman for particular url match", - "type": "object", - "properties": { - "match": { - "default": "http+https://*/*", - "description": "The Url match for which the proxy config is defined", - "type": "string" - }, - "host": { - "type": "string", - "description": "The proxy server host" - }, - "port": { - "type": "integer", - "minimum": 0, - "default": 8080, - "description": "The proxy server port" - }, - "tunnel": { - "description": "The tunneling details for the proxy config", - "default": false, - "type": "boolean" - }, - "disabled": { - "type": "boolean", - "default": false, - "description": "When set to true, ignores this proxy configuration entity" - } - } - }, - "request": { - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "#/definitions/request", - "title": "Request", - "description": "A request represents an HTTP request. If a string, the string is assumed to be the request URL and the method is assumed to be 'GET'.", - "type": "object", - "properties": { - "url": { - "$ref": "#/definitions/url" - }, - "auth": { - "$ref": "#/definitions/auth" - }, - "proxy": { - "$ref": "#/definitions/proxy-config" - }, - "certificate": { - "$ref": "#/definitions/certificate" - }, - "method": { - "description": "The Standard HTTP method associated with this request.", - "type": "string", - "enum": [ - "GET", - "PUT", - "POST", - "PATCH", - "DELETE", - "COPY", - "HEAD", - "OPTIONS", - "LINK", - "UNLINK", - "PURGE", - "LOCK", - "UNLOCK", - "PROPFIND", - "VIEW" - ] - }, - "description": { - "$ref": "#/definitions/description" - }, - "header": { - "$ref": "#/definitions/header-list" - }, - "body": { - "type": "object", - "description": "This field contains the data usually contained in the request body.", - "properties": { - "mode": { - "description": "Postman stores the type of data associated with this request in this field.", - "enum": [ - "raw", - "urlencoded", - "formdata", - "file", - "graphql" - ] - }, - "raw": { - "type": "string" - }, - "urlencoded": { - "type": "array", - "items": { - "type": "object", - "title": "UrlEncodedParameter", - "properties": { - "key": { - "type": "string" - }, - "value": { - "type": "string" - }, - "disabled": { - "type": "boolean", - "default": false - }, - "description": { - "$ref": "#/definitions/description" - } - }, - "required": [ - "key" - ] - } - }, - "formdata": { - "type": "array", - "items": { - "type": "object", - "title": "FormParameter", - "properties": { - "key": { - "type": "string" - }, - "value": { - "type": "string" - }, - "src": { - "type": "string" - }, - "disabled": { - "type": "boolean", - "default": false, - "description": "When set to true, prevents this form data entity from being sent." - }, - "type": { - "type": "string", - "enum": [ - "text", - "file" - ] - }, - "contentType": { - "type": "string", - "description": "Override Content-Type header of this form data entity." - }, - "description": { - "$ref": "#/definitions/description" - } - }, - "required": [ - "key" - ] - } - }, - "file": { - "type": "object", - "properties": { - "src": { - "type": "string", - "description": "Contains the name of the file to upload. _Not the path_." - }, - "content": { - "type": "string" - } - } - }, - "graphql": { - "type": "object" - }, - "options": { - "type": "object", - "description": "Additional configurations and options set for various body modes." - }, - "disabled": { - "type": "boolean", - "default": false, - "description": "When set to true, prevents request body from being sent." - } - } - } - } - }, - "response": { - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "#/definitions/response", - "title": "Response", - "description": "A response represents an HTTP response.", - "properties": { - "id": { - "description": "A unique, user defined identifier that can be used to refer to this response from requests.", - "type": "string" - }, - "originalRequest": { - "$ref": "#/definitions/request" - }, - "responseTime": { - "title": "ResponseTime", - "type": "string", - "description": "The time taken by the request to complete. If a number, the unit is milliseconds. If the response is manually created, this can be set to `null`." - }, - "timings": { - "title": "Response Timings", - "description": "Set of timing information related to request and response in milliseconds", - "type": "object" - }, - "header": { - "title": "Headers", - "type": "array", - "description": "No HTTP request is complete without its headers, and the same is true for a Postman request. This field is an array containing all the headers.", - "items": { - "$ref": "#/definitions/header" - } - }, - "cookie": { - "type": "array", - "items": { - "$ref": "#/definitions/cookie" - } - }, - "body": { - "type": [ - "null", - "string" - ], - "description": "The raw text of the response." - }, - "status": { - "type": "string", - "description": "The response status, e.g: '200 OK'" - }, - "code": { - "type": "integer", - "description": "The numerical response code, example: 200, 201, 404, etc." - } - } - }, - "script": { - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "#/definitions/script", - "title": "Script", - "type": "object", - "description": "A script is a snippet of Javascript code that can be used to to perform setup or teardown operations on a particular response.", - "properties": { - "id": { - "description": "A unique, user defined identifier that can be used to refer to this script from requests.", - "type": "string" - }, - "type": { - "description": "Type of the script. E.g: 'text/javascript'", - "type": "string" - }, - "exec": { - "type": "array", - "description": "This is an array of strings, where each line represents a single line of code. Having lines separate makes it possible to easily track changes made to scripts.", - "items": { - "type": "string" - } - }, - "src": { - "$ref": "#/definitions/url" - }, - "name": { - "type": "string", - "description": "Script name" - } - } - }, - "url": { - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "If object, contains the complete broken-down URL for this request. If string, contains the literal request URL.", - "id": "#/definitions/url", - "title": "Url", - "type": "object", - "properties": { - "raw": { - "type": "string", - "description": "The string representation of the request URL, including the protocol, host, path, hash, query parameter(s) and path variable(s)." - }, - "protocol": { - "type": "string", - "description": "The protocol associated with the request, E.g: 'http'" - }, - "host": { - "title": "Host", - "description": "The host for the URL, E.g: api.yourdomain.com. Can be stored as a string or as an array of strings.", - "type": "array", - "items": { - "type": "string" - } - }, - "path": { - "type": "array", - "description": "The complete path of the current url, broken down into segments. A segment could be a string, or a path variable.", - "items": { - "type": "string" - } - }, - "port": { - "type": "string", - "description": "The port number present in this URL. An empty value implies 80/443 depending on whether the protocol field contains http/https." - }, - "query": { - "type": "array", - "description": "An array of QueryParams, which is basically the query string part of the URL, parsed into separate variables", - "items": { - "type": "object", - "title": "QueryParam", - "properties": { - "key": { - "type": "string" - }, - "value": { - "type": "string" - }, - "disabled": { - "type": "boolean", - "default": false, - "description": "If set to true, the current query parameter will not be sent with the request." - }, - "description": { - "$ref": "#/definitions/description" - } - } - } - }, - "hash": { - "description": "Contains the URL fragment (if any). Usually this is not transmitted over the network, but it could be useful to store this in some cases.", - "type": "string" - }, - "variable": { - "type": "array", - "description": "Postman supports path variables with the syntax `/path/:variableName/to/somewhere`. These variables are stored in this field.", - "items": { - "$ref": "#/definitions/variable" - } - } - } - }, - "variable-list": { - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "#/definitions/variable-list", - "title": "Variable List", - "description": "Collection variables allow you to define a set of variables, that are a *part of the collection*, as opposed to environments, which are separate entities.\n*Note: Collection variables must not contain any sensitive information.*", - "type": "array", - "items": { - "$ref": "#/definitions/variable" - } - }, - "variable": { - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "#/definitions/variable", - "title": "Variable", - "description": "Using variables in your Postman requests eliminates the need to duplicate requests, which can save a lot of time. Variables can be defined, and referenced to from any part of a request.", - "type": "object", - "properties": { - "id": { - "description": "A variable ID is a unique user-defined value that identifies the variable within a collection. In traditional terms, this would be a variable name.", - "type": "string" - }, - "key": { - "description": "A variable key is a human friendly value that identifies the variable within a collection. In traditional terms, this would be a variable name.", - "type": "string" - }, - "value": { - "description": "The value that a variable holds in this collection. Ultimately, the variables will be replaced by this value, when say running a set of requests from a collection" - }, - "type": { - "description": "A variable may have multiple types. This field specifies the type of the variable.", - "type": "string", - "enum": [ - "string", - "boolean", - "any", - "number" - ] - }, - "name": { - "type": "string", - "description": "Variable name" - }, - "description": { - "$ref": "#/definitions/description" - }, - "system": { - "type": "boolean", - "default": false, - "description": "When set to true, indicates that this variable has been set by Postman" - }, - "disabled": { - "type": "boolean", - "default": false - } - } - }, - "version": { - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "#/definitions/version", - "title": "Collection Version", - "description": "Postman allows you to version your collections as they grow, and this field holds the version number. While optional, it is recommended that you use this field to its fullest extent!", - "type": "object", - "properties": { - "major": { - "description": "Increment this number if you make changes to the collection that changes its behaviour. E.g: Removing or adding new test scripts. (partly or completely).", - "minimum": 0, - "type": "integer" - }, - "minor": { - "description": "You should increment this number if you make changes that will not break anything that uses the collection. E.g: removing a folder.", - "minimum": 0, - "type": "integer" - }, - "patch": { - "description": "Ideally, minor changes to a collection should result in the increment of this number.", - "minimum": 0, - "type": "integer" - }, - "identifier": { - "description": "A human friendly identifier to make sense of the version numbers. E.g: 'beta-3'", - "type": "string", - "maxLength": 10 - }, - "meta": {} - }, - "required": [ - "major", - "minor", - "patch" - ] - } - } -} \ No newline at end of file