You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a collection is contained in an external JSON file, the behavior wrt how it is processed differs between the CLI interface and the programmatic interface in a surprising way.
When passed as a filepath, the collection can be loaded if it's in a JSON object OR if it's in a JSON object under the key collection, but when passed as JSON directly, this unwrapping doesn't happen. The unwrapping happens here:
This leads to surprising behavior, as my expectation was that running a json file that works on the CLI would also work when passed as part of a script. There is no feedback that the formatting of the json could be the issue and be causing the difference.
Newman Version (can be found via newman -v): 6.0.0
OS details (type, version, and architecture): Mac Ventura M2
Are you using Newman as a library, or via the CLI? Both, see issue
Did you encounter this recently, or has this bug always been there: Idk
Expected behaviour: Consistency between CLI and programmatic use
Command / script used to run Newman:
Sample collection, and auxiliary files (minus the sensitive details):
reproduction
I don't have the context to know what the expected behavior should be, other than I think passing a path and passing a JSON object should work consistently. I can see there is a lot of backwards compatibility stuff going on too. I'm filing this issue so that there is some visibility into the surprising behavior.
Thanks!
The text was updated successfully, but these errors were encountered:
When a collection is contained in an external JSON file, the behavior wrt how it is processed differs between the CLI interface and the programmatic interface in a surprising way.
When passed as a filepath, the collection can be loaded if it's in a JSON object OR if it's in a JSON object under the key
collection
, but when passed as JSON directly, this unwrapping doesn't happen. The unwrapping happens here:newman/lib/run/options.js
Line 60 in a612fbe
This leads to surprising behavior, as my expectation was that running a json file that works on the CLI would also work when passed as part of a script. There is no feedback that the formatting of the json could be the issue and be causing the difference.
Newman Version (can be found via
newman -v
): 6.0.0OS details (type, version, and architecture): Mac Ventura M2
Are you using Newman as a library, or via the CLI? Both, see issue
Did you encounter this recently, or has this bug always been there: Idk
Expected behaviour: Consistency between CLI and programmatic use
Command / script used to run Newman:
Sample collection, and auxiliary files (minus the sensitive details):
reproduction
Reproduction can be found in this diff in this branch
I don't have the context to know what the expected behavior should be, other than I think passing a path and passing a JSON object should work consistently. I can see there is a lot of backwards compatibility stuff going on too. I'm filing this issue so that there is some visibility into the surprising behavior.
Thanks!
The text was updated successfully, but these errors were encountered: