Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Or_Soffer
Employee
Employee
Jump to solution

postman_collection R81

Postman collection for Check Point R81 (1.7 API)

1 Solution

Accepted Solutions
Thomas-Marko
Contributor
Contributor

Thank you for the link! Unfortunately my version of Postman (8.1.0) does not accept v1 formatted collection templates any more. One can convert the v1 version to the needed v2 version by using the postman-collection-transformer:

postman-collection-transformer convert -i postman_collection-v1.7.json -j 1.0.0 -o postman_collection-v1.7-v2.json -p 2.0.0

For those who just want to download the converted version, I attached the v2 version to my post.

Cheers,

Thomas

 

View solution in original post

7 Replies
Thomas-Marko
Contributor
Contributor

Thank you for the link! Unfortunately my version of Postman (8.1.0) does not accept v1 formatted collection templates any more. One can convert the v1 version to the needed v2 version by using the postman-collection-transformer:

postman-collection-transformer convert -i postman_collection-v1.7.json -j 1.0.0 -o postman_collection-v1.7-v2.json -p 2.0.0

For those who just want to download the converted version, I attached the v2 version to my post.

Cheers,

Thomas

 

PhoneBoy
Admin
Admin

Thanks, that turned out to be handy 🙂

0 Kudos
Kurpeus
Participant
Participant

Thanks for this.


Any chance you could do the same for other R80.x version ? I've tried converting collections but i'm getting an error message outside my knowledge area:

 

[root@autobot ~]# postman-collection-transformer convert --input ./postman_collection-v1.3.json --input-version 1.0.0 --output ./postman_collection-v1.3_v2.json --output-version 2.0.0
/usr/lib/node_modules/postman-collection-transformer/node_modules/commander/lib/command.js:866
async parseAsync(argv, parseOptions) {
^^^^^^^^^^

SyntaxError: Unexpected identifier
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/usr/lib/node_modules/postman-collection-transformer/node_modules/commander/index.js:2:21)
[root@autobot ~]#

0 Kudos
Thomas-Marko
Contributor
Contributor

Of course I can, but the only thing you possibly missed, is to convert the original json to use unix line feeds:

thomas@apollon:~$ file postman_collection-v1.3.json
postman_collection-v1.3.json: ASCII text, with very long lines, with CRLF line terminators

CRLF line feeds are used by Windows, so just do a dos2unix:

thomas@apollon:~$ dos2unix postman_collection-v1.3.json
thomas@apollon:~$ file postman_collection-v1.3.json
postman_collection-v1.3.json: ASCII text, with very long lines

 After that everything works fine 🙂

Nevertheless, I will attach a v2 version to the articles linked in https://community.checkpoint.com/t5/API-CLI-Discussion/Postman-Collections-links-to-all-available-an... accordingly.

Cheers,
Thomas

Kurpeus
Participant
Participant

Hi Thomas

 

Thanks so much for your effort and converting all those collections.  The unix line feed is good to know although this isn't the cause of the issue I'm experiencing as even if i run the  postman-collection-transformer without any arguments i get the same error message   (see below but this is no longer in relation to this topic 🙂 )

 

[root@autobot ~]# postman-collection-transformer
/usr/lib/node_modules/postman-collection-transformer/node_modules/commander/lib/command.js:866
async parseAsync(argv, parseOptions) {
^^^^^^^^^^

SyntaxError: Unexpected identifier
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/usr/lib/node_modules/postman-collection-transformer/node_modules/commander/index.js:2:21)

 

[root@autobot ~]# npm list -g postman-collection-transformer


└─┬ postman-collection-transformer@4.1.3
├── commander@8.0.0
├── inherits@2.0.4
├─┬ intel@1.2.0
│ ├─┬ chalk@1.1.3
│ │ ├── ansi-styles@2.2.1
│ │ ├── escape-string-regexp@1.0.5
│ │ ├─┬ has-ansi@2.0.0
│ │ │ └── ansi-regex@2.1.1
│ │ ├── strip-ansi@3.0.1
│ │ └── supports-color@2.0.0
│ ├── dbug@0.4.2
│ ├── stack-trace@0.0.10
│ ├── strftime@0.10.0
│ ├── symbol@0.3.1
│ └── utcstring@0.1.0
├── lodash@4.17.21
├─┬ semver@7.3.5
│ └─┬ lru-cache@6.0.0
│ └── yallist@4.0.0
└── strip-json-comments@3.1.1

 

 

 

Thomas-Marko
Contributor
Contributor

Hi,

I attached a Dockerfile for you if you like to try it out. The content is very simple and loads a basic Alpine Linux image and installs npm as well as the postman-collection-transformer:

 

FROM alpine:3.14

RUN apk add --no-cache npm
RUN npm install -g postman-collection-transformer

WORKDIR /app

CMD ["/bin/sh"]

 

Finally it starts a shell.

If you have installed Docker, cd into the directory with the Dockerfile and you can build the image with the following command:

 

docker build -t postmanconverter .

 

 This builds your postmanconverter image. You can then run a container from this image with

 

docker container run --rm -it -v ${PWD}:/app postmanconverter

 

--rm removes the container after you have finished and the -v argument bind mounts the current folder into the container to /app, so you can put you postman collection json files into the same directory as the Dockerfile.

After running the docker container command you will be put into the container's shell. From her you can simply run the command "postman-collection-transformer".

Cheers,
Thomas

(1)
Kurpeus
Participant
Participant

You are a star ! Thanks so much

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events