Following up with #1004, this is a ticket for https://github.com/intuit/karate/projects/3#card-22529475: adding Postman import to Karate.
Like @ptrthomas mentioned, adding a CLI flag to switch on the behavior is simple. Where, though, should the (very little) logic for this functionality live? Inside com.intuit.karate.cli.Main, or should another CLI "utility" class?
@Celeo thanks for asking
cli.Main - but since we have to implement the command-line twice, it makes sense to create a utility, we do have a postman package right https://github.com/intuit/karate/tree/develop/karate-core/src/main/java/com/intuit/karate/formats/postmanfeel free to ask more questions
Great, thanks for the info.
I had come across the second CLI in the karate-netty package when searching for the main method, but figured I'd stick to the one you linked in #1004 unless otherwise noted.
@Celeo yes I had missed it, it struck me later that a postman import is one of those things that makes more sense for the fat-jar, since anyone who is working with the maven jar would have been doing it via code like you were. so I would actually prioritize the karate-netty CLI.
but the reason I think it makes sense in both places is because the VS Code plugin is really catching on and the debug CLI -d is an example where it is useful for both Maven / Gradle and fat-jar users.
@ptrthomas , @Celeo just wanted to understand the proposal here for postman import via CLI.
is it going to be an import flag for existing CLI like,
java -jar karate.jar -i file_name.postman_collection ?
or a subcommand that can support different imports from CLI
java -jar karate.jar import -p file_name.postman_collection ?
@babusekaran good question, to be honest I have not explored picocli subcommands yet. I leave it to @Celeo - either one is fine for me. IMO the file extension should be a good enough indicator of the type of import - in case we support more than postman in the future
Went with -i/--import <path> in https://github.com/intuit/karate/pull/1011.
Most helpful comment
@babusekaran good question, to be honest I have not explored picocli subcommands yet. I leave it to @Celeo - either one is fine for me. IMO the file extension should be a good enough indicator of the type of import - in case we support more than postman in the future