Skip to content

Package refactor #94

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ and requires a valid API key from Postman's integrations [dashboard](https://web
```docker
# generate only
docker run -v $(pwd):/usr/src/app \
-it --rm --name postmanv2-container gcatanese/openapi-generator-postman-v2 generate \
-it --rm --name postmanv2-container ghcr.io/adyen-examples/openapi-generator-postman-v2:main generate \
-i src/test/resources/SampleProject.yaml \
-o tmp

# generate only (with additional parameters)
docker run -v $(pwd):/usr/src/app \
-it --rm --name postmanv2-container gcatanese/openapi-generator-postman-v2 generate \
-it --rm --name postmanv2-container ghcr.io/adyen-examples/openapi-generator-postman-v2:main generate \
-i src/test/resources/SampleProject.yaml \
-o tmp \
--additional-properties folderStrategy=Tags,postmanVariables=MY_VAR1-ANOTHERVAR
Expand All @@ -44,7 +44,7 @@ docker run -v $(pwd):/usr/src/app \
# note: require POSTMAN API KEY
docker run -v $(pwd):/usr/src/app \
-e POSTMAN_API_KEY=YOUR_POSTMAN_API_KEY \
-it --rm --name postmanv2-container gcatanese/openapi-generator-postman-v2 push \
-it --rm --name postmanv2-container ghcr.io/adyen-examples/openapi-generator-postman-v2:main push \
-i src/test/resources/SampleProject.yaml \
-o tmp \
--additional-properties folderStrategy=Tags,postmanVariables=MY_VAR1-ANOTHERVAR
Expand All @@ -59,7 +59,7 @@ Build `postman-v2` from source
Run OpenAPI Generator adding `postman-v2` jar file in the class path and specifying the `PostmanV2Generator` generator:
```shell
java -cp target/openapi-generator-postman-v2.jar:/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar \
org.openapitools.codegen.OpenAPIGenerator generate -g com.tweesky.cloudtools.codegen.PostmanV2Generator \
org.openapitools.codegen.OpenAPIGenerator generate -g com.adyen.codegen.postman.PostmanV2Generator \
-i src/test/resources/BasicJson.json -o output
```
## METADATA
Expand Down
2 changes: 1 addition & 1 deletion script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ then
cmdparams="${cmdline#*push}"
fi

statusCode=$(java -jar /openapi-generator-postman-v2.jar generate -g com.tweesky.cloudtools.codegen.PostmanV2Generator $cmdparams)
statusCode=$(java -jar /openapi-generator-postman-v2.jar generate -g com.adyen.codegen.postman.PostmanV2Generator $cmdparams)

if [[ ! $statusCode ]]
then
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.tweesky.cloudtools.codegen;
package com.adyen.codegen.postman;

import org.apache.http.impl.EnglishReasonPhraseCatalog;
import org.openapitools.codegen.CodegenResponse;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.tweesky.cloudtools.codegen;
package com.adyen.codegen.postman;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
Expand All @@ -15,8 +15,8 @@
import java.util.LinkedHashMap;
import java.util.Map;

import static com.tweesky.cloudtools.codegen.PostmanV2Generator.JSON_ESCAPE_DOUBLE_QUOTE;
import static com.tweesky.cloudtools.codegen.PostmanV2Generator.JSON_ESCAPE_NEW_LINE;
import static com.adyen.codegen.postman.PostmanV2Generator.JSON_ESCAPE_DOUBLE_QUOTE;
import static com.adyen.codegen.postman.PostmanV2Generator.JSON_ESCAPE_NEW_LINE;

/**
* Extract and format JSON examples
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.tweesky.cloudtools.codegen;
package com.adyen.codegen.postman;

import com.tweesky.cloudtools.codegen.model.PostmanRequestItem;
import com.tweesky.cloudtools.codegen.model.PostmanResponse;
import com.tweesky.cloudtools.codegen.model.PostmanVariable;
import com.adyen.codegen.postman.model.PostmanRequestItem;
import com.adyen.codegen.postman.model.PostmanResponse;
import com.adyen.codegen.postman.model.PostmanVariable;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.examples.Example;
import io.swagger.v3.oas.models.media.Schema;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.tweesky.cloudtools.codegen.model;
package com.adyen.codegen.postman.model;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.tweesky.cloudtools.codegen.model;
package com.adyen.codegen.postman.model;

import com.tweesky.cloudtools.codegen.CodegenUtils;
import com.adyen.codegen.postman.CodegenUtils;
import org.openapitools.codegen.CodegenResponse;

public class PostmanResponse {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.tweesky.cloudtools.codegen.model;
package com.adyen.codegen.postman.model;

import java.util.Objects;

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
com.tweesky.cloudtools.codegen.PostmanV2Generator
com.adyen.codegen.postman.PostmanV2Generator
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.tweesky.cloudtools.codegen;
package com.adyen.codegen.postman;

import io.swagger.v3.oas.models.responses.ApiResponse;
import junit.framework.TestCase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.tweesky.cloudtools.codegen;
package com.adyen.codegen.postman;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.tweesky.cloudtools.codegen;
package com.adyen.codegen.postman;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.tweesky.cloudtools.codegen.model.PostmanRequestItem;
import com.adyen.codegen.postman.model.PostmanRequestItem;
import io.swagger.v3.oas.models.tags.Tag;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.tweesky.cloudtools.codegen;
package com.adyen.codegen.postman;

import java.io.IOException;
import java.nio.charset.StandardCharsets;
Expand Down
1 change: 0 additions & 1 deletion src/test/resources/SampleProject.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ info:
version: '1.0'
contact:
name: Beppe Catanese
email: [email protected]
url: 'https://github.com/gcatanese'
description: 'Sample API Check "API Key" '
license:
Expand Down