Skip to content

Commit

Permalink
Merge pull request #94 from adyen-examples/package-refactor
Browse files Browse the repository at this point in the history
Package refactor
  • Loading branch information
gcatanese authored Nov 12, 2024
2 parents 30f3796 + cf9c810 commit 44062bd
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 24 deletions.
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

0 comments on commit 44062bd

Please sign in to comment.