From 00f7f44cfaa433011f16964bb18a3b528c630014 Mon Sep 17 00:00:00 2001 From: GCorbel Date: Wed, 5 Jun 2024 17:27:43 -0400 Subject: [PATCH 1/8] Better: Allow to filter by sources type RD-29241 --- specs/README.md | 4 ++-- specs/engage-digital_openapi3.yaml | 6 ++++++ specs/engage-digital_postman2.json | 18 ++++++++++++------ 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/specs/README.md b/specs/README.md index 5de7681d..2f4e002e 100644 --- a/specs/README.md +++ b/specs/README.md @@ -10,7 +10,7 @@ Use the following files: The following files are used to generate the Postman collection and are not designed to be used on their own: * `engage-digital_postman2.config.json`: configuration file for Spectrum Postman Collection generator. -* `engage-digital_postman2.base.json`: +* `engage-digital_postman2.base.json`: ## Postman Collection @@ -27,7 +27,7 @@ Use `spectrum` to create the Postman 2.x collection from the OpenAPI 3 API Speci The following will install the `spectrum` executable in the `~/go/bin` directory. ```bash -$ go get github.com/grokify/spectrum +$ go install github.com/grokify/spectrum@v1.10.3 ``` This approach requires `go` 1.16 minimum be installed on your system. See more here: [https://golang.org/](https://golang.org/). diff --git a/specs/engage-digital_openapi3.yaml b/specs/engage-digital_openapi3.yaml index 38293326..5bdd08ff 100644 --- a/specs/engage-digital_openapi3.yaml +++ b/specs/engage-digital_openapi3.yaml @@ -938,6 +938,12 @@ paths: schema: format: int32 type: integer + - description: Filter by type + in: query + name: type + required: false + schema: + type: string responses: '200': content: diff --git a/specs/engage-digital_postman2.json b/specs/engage-digital_postman2.json index 2a1e7e9a..c9fd266b 100644 --- a/specs/engage-digital_postman2.json +++ b/specs/engage-digital_postman2.json @@ -463,8 +463,8 @@ "value": "Bearer {{ENGAGE_DIGITAL_ACCESS_TOKEN}}" }, { - "key": "Accept", - "value": "application/json" + "key": "Content-Type", + "value": "multipart/form-data:" }, { "key": "Accept", @@ -1999,6 +1999,12 @@ "value": "\u003cinteger.int32\u003e", "description": "The max number of records to return. Default value is 30, max value is 150.", "disabled": true + }, + { + "key": "type", + "value": "\u003cstring\u003e", + "description": "Filter by type", + "disabled": true } ] }, @@ -7842,8 +7848,8 @@ "value": "Bearer {{ENGAGE_DIGITAL_ACCESS_TOKEN}}" }, { - "key": "Accept", - "value": "application/json" + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" }, { "key": "Accept", @@ -7930,8 +7936,8 @@ "value": "Bearer {{ENGAGE_DIGITAL_ACCESS_TOKEN}}" }, { - "key": "Accept", - "value": "application/json" + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" }, { "key": "Accept", From 2d733b1e59f479dc577078a9bf2a8f5be710ba63 Mon Sep 17 00:00:00 2001 From: GCorbel Date: Thu, 6 Jun 2024 10:11:13 -0400 Subject: [PATCH 2/8] Fix go version --- .github/workflows/test.yaml | 4 ++-- specs/README.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index bb89332d..4cc75968 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -14,7 +14,7 @@ jobs: if: success() uses: actions/setup-go@v2 with: - go-version: 1.18.x + go-version: 1.16.x - name: Checkout code uses: actions/checkout@v2 - name: Run tests @@ -22,7 +22,7 @@ jobs: - name: Postman generated working-directory: specs run: | - go install github.com/grokify/spectrum@v1.15.0 + go install github.com/grokify/spectrum@v1.10.3 spectrum --config engage-digital_postman2.config.json --basePostmanFile engage-digital_postman2.base.json --openapiFile engage-digital_openapi3.yaml --postmanFile engage-digital_postman2.json.new diff engage-digital_postman2.json engage-digital_postman2.json.new lint: diff --git a/specs/README.md b/specs/README.md index 5de7681d..44032320 100644 --- a/specs/README.md +++ b/specs/README.md @@ -10,7 +10,7 @@ Use the following files: The following files are used to generate the Postman collection and are not designed to be used on their own: * `engage-digital_postman2.config.json`: configuration file for Spectrum Postman Collection generator. -* `engage-digital_postman2.base.json`: +* `engage-digital_postman2.base.json`: ## Postman Collection @@ -27,10 +27,10 @@ Use `spectrum` to create the Postman 2.x collection from the OpenAPI 3 API Speci The following will install the `spectrum` executable in the `~/go/bin` directory. ```bash -$ go get github.com/grokify/spectrum +$ go install github.com/grokify/spectrum@v1.10.3 ``` -This approach requires `go` 1.16 minimum be installed on your system. See more here: [https://golang.org/](https://golang.org/). +This approach requires `go` 1.16 be installed on your system. See more here: [https://golang.org/](https://golang.org/). ### Usage From 8780259351d9e62e686f430dbeb8ed6fee27f55b Mon Sep 17 00:00:00 2001 From: GCorbel Date: Thu, 6 Jun 2024 10:17:30 -0400 Subject: [PATCH 3/8] Change the doc --- specs/README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/specs/README.md b/specs/README.md index 44032320..3c84a6aa 100644 --- a/specs/README.md +++ b/specs/README.md @@ -24,13 +24,19 @@ Use `spectrum` to create the Postman 2.x collection from the OpenAPI 3 API Speci ### Installation -The following will install the `spectrum` executable in the `~/go/bin` directory. +Be sure to have the version of go specified in the go.mod file. If you have the latest version of go installed, you can install an oldest version with : ```bash -$ go install github.com/grokify/spectrum@v1.10.3 +$ go install golang.org/dl/go1.16@latest ``` -This approach requires `go` 1.16 be installed on your system. See more here: [https://golang.org/](https://golang.org/). +See more here: [https://golang.org/](https://golang.org/). + +The following will install the `spectrum` executable in the `~/go/bin` directory. + +```bash +$ ~/go/bin/go1.16 install github.com/grokify/spectrum@v1.10.3 +``` ### Usage From fc006b910566a0221955f86726f16fc71680d94a Mon Sep 17 00:00:00 2001 From: GCorbel Date: Thu, 6 Jun 2024 10:22:51 -0400 Subject: [PATCH 4/8] regenerate postman file --- specs/engage-digital_postman2.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/specs/engage-digital_postman2.json b/specs/engage-digital_postman2.json index c9fd266b..b399b22b 100644 --- a/specs/engage-digital_postman2.json +++ b/specs/engage-digital_postman2.json @@ -463,8 +463,8 @@ "value": "Bearer {{ENGAGE_DIGITAL_ACCESS_TOKEN}}" }, { - "key": "Content-Type", - "value": "multipart/form-data:" + "key": "Accept", + "value": "application/json" }, { "key": "Accept", @@ -7848,8 +7848,8 @@ "value": "Bearer {{ENGAGE_DIGITAL_ACCESS_TOKEN}}" }, { - "key": "Content-Type", - "value": "application/x-www-form-urlencoded" + "key": "Accept", + "value": "application/json" }, { "key": "Accept", @@ -7936,8 +7936,8 @@ "value": "Bearer {{ENGAGE_DIGITAL_ACCESS_TOKEN}}" }, { - "key": "Content-Type", - "value": "application/x-www-form-urlencoded" + "key": "Accept", + "value": "application/json" }, { "key": "Accept", From 73f02bf915979d7ac6c49b5c13bc5a26480f9995 Mon Sep 17 00:00:00 2001 From: GCorbel Date: Fri, 7 Jun 2024 13:28:03 -0400 Subject: [PATCH 5/8] change to update the doc only --- .github/workflows/test.yaml | 4 ++-- specs/README.md | 22 +++++++++++++--------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 4cc75968..bb89332d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -14,7 +14,7 @@ jobs: if: success() uses: actions/setup-go@v2 with: - go-version: 1.16.x + go-version: 1.18.x - name: Checkout code uses: actions/checkout@v2 - name: Run tests @@ -22,7 +22,7 @@ jobs: - name: Postman generated working-directory: specs run: | - go install github.com/grokify/spectrum@v1.10.3 + go install github.com/grokify/spectrum@v1.15.0 spectrum --config engage-digital_postman2.config.json --basePostmanFile engage-digital_postman2.base.json --openapiFile engage-digital_openapi3.yaml --postmanFile engage-digital_postman2.json.new diff engage-digital_postman2.json engage-digital_postman2.json.new lint: diff --git a/specs/README.md b/specs/README.md index 3c84a6aa..561d8738 100644 --- a/specs/README.md +++ b/specs/README.md @@ -14,20 +14,24 @@ The following files are used to generate the Postman collection and are not desi ## Postman Collection -### Script +### Generate Postman Collection file + +There are two ways to generate postman collections described below. + +#### 1. Script (recommended) Run `./gen_postman.sh` -or proceed with the manual installation as described below +#### 2. Manual installation Use `spectrum` to create the Postman 2.x collection from the OpenAPI 3 API Specification. -### Installation +##### 2.1 Installation -Be sure to have the version of go specified in the go.mod file. If you have the latest version of go installed, you can install an oldest version with : +Be sure to have the version of go specified in the Dockerfile. If you have the latest version of go installed, you can install an oldest version with : ```bash -$ go install golang.org/dl/go1.16@latest +$ go install golang.org/dl/go1.18@latest ``` See more here: [https://golang.org/](https://golang.org/). @@ -35,10 +39,10 @@ See more here: [https://golang.org/](https://golang.org/). The following will install the `spectrum` executable in the `~/go/bin` directory. ```bash -$ ~/go/bin/go1.16 install github.com/grokify/spectrum@v1.10.3 +$ ~/go/bin/go1.16 install github.com/grokify/spectrum@v1.15.0 ``` -### Usage +##### 2.2 Usage The following example writes the output to `engage-digital_postman2.json`. @@ -46,6 +50,8 @@ The following example writes the output to `engage-digital_postman2.json`. $ ~/go/bin/spectrum --config engage-digital_postman2.config.json --basePostmanFile engage-digital_postman2.base.json --openapiFile engage-digital_openapi3.yaml --postmanFile engage-digital_postman2.json ``` +### Testing + In Postman, set the following environment variables: | Environment Variable | Example | @@ -53,6 +59,4 @@ In Postman, set the following environment variables: | `ENGAGE_DIGITAL_SERVER_URL` | `https://{myaccount}.api.engagement.dimelo.com` | | `ENGAGE_DIGITAL_ACCESS_TOKEN` | `deadbeef0123456789abcdef` | -#### Testing - Try the "Get all Users" API via "Provisioning" > "Users" > "Getting all Users". From ce4948167f396b44b6d9c4404607a0da15f38695 Mon Sep 17 00:00:00 2001 From: GCorbel Date: Fri, 7 Jun 2024 13:30:55 -0400 Subject: [PATCH 6/8] Empty-Commit From 7bf39f36b416362444e9b2850f7a49845651b9eb Mon Sep 17 00:00:00 2001 From: GCorbel Date: Fri, 7 Jun 2024 13:32:04 -0400 Subject: [PATCH 7/8] Empty-Commit From d0667f77774d37dd32222cfaddacb2a3e2d81b13 Mon Sep 17 00:00:00 2001 From: GCorbel Date: Fri, 7 Jun 2024 13:34:22 -0400 Subject: [PATCH 8/8] revert changes in the README --- specs/README.md | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/specs/README.md b/specs/README.md index 561d8738..5de7681d 100644 --- a/specs/README.md +++ b/specs/README.md @@ -10,39 +10,29 @@ Use the following files: The following files are used to generate the Postman collection and are not designed to be used on their own: * `engage-digital_postman2.config.json`: configuration file for Spectrum Postman Collection generator. -* `engage-digital_postman2.base.json`: +* `engage-digital_postman2.base.json`: ## Postman Collection -### Generate Postman Collection file - -There are two ways to generate postman collections described below. - -#### 1. Script (recommended) +### Script Run `./gen_postman.sh` -#### 2. Manual installation +or proceed with the manual installation as described below Use `spectrum` to create the Postman 2.x collection from the OpenAPI 3 API Specification. -##### 2.1 Installation - -Be sure to have the version of go specified in the Dockerfile. If you have the latest version of go installed, you can install an oldest version with : - -```bash -$ go install golang.org/dl/go1.18@latest -``` - -See more here: [https://golang.org/](https://golang.org/). +### Installation The following will install the `spectrum` executable in the `~/go/bin` directory. ```bash -$ ~/go/bin/go1.16 install github.com/grokify/spectrum@v1.15.0 +$ go get github.com/grokify/spectrum ``` -##### 2.2 Usage +This approach requires `go` 1.16 minimum be installed on your system. See more here: [https://golang.org/](https://golang.org/). + +### Usage The following example writes the output to `engage-digital_postman2.json`. @@ -50,8 +40,6 @@ The following example writes the output to `engage-digital_postman2.json`. $ ~/go/bin/spectrum --config engage-digital_postman2.config.json --basePostmanFile engage-digital_postman2.base.json --openapiFile engage-digital_openapi3.yaml --postmanFile engage-digital_postman2.json ``` -### Testing - In Postman, set the following environment variables: | Environment Variable | Example | @@ -59,4 +47,6 @@ In Postman, set the following environment variables: | `ENGAGE_DIGITAL_SERVER_URL` | `https://{myaccount}.api.engagement.dimelo.com` | | `ENGAGE_DIGITAL_ACCESS_TOKEN` | `deadbeef0123456789abcdef` | +#### Testing + Try the "Get all Users" API via "Provisioning" > "Users" > "Getting all Users".