Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: Ability to pass json to pact-message via standard in #61

Open
2 tasks done
TimothyJones opened this issue Jan 5, 2021 · 3 comments
Open
2 tasks done

Comments

@TimothyJones
Copy link

Pre issue-raising checklist

I have already (please mark the applicable with an x):

  • Upgraded to the latest version of the relevant libraries
  • Checked to see if the issue has already been raised

Software versions

  • pact-ruby-standalone: 1.88.26

Request

Currently, pact-message expects the content JSON to be passed as a command line parameter:

pact-message update MESSAGE_JSON --consumer=CONSUMER --pact-dir=PACT_DIR --provider=PROVIDER

JSON in a command line param is difficult to quote correctly on windows (I haven't found a library that works for all cases yet).

It would be awesome if we could work around this by having the option to pass the content via standard in:

pact-message update MESSAGE_JSON --consumer=CONSUMER --pact-dir=PACT_DIR --provider=PROVIDER
or
echo "$MESSAGE_JSON" | pact-message update --consumer=CONSUMER --pact-dir=PACT_DIR --provider=PROVIDER
@TimothyJones
Copy link
Author

Here's a short test:

echo '{ "description": "a test mesage", "content": { "name": "Mary" } }' > msg
cat msg | pact-message  update --consumer=CONSUMER  --pact-dir=. --provider=PROVIDER

@bethesque
Copy link
Member

Sounds good.

Why is your example in two steps instead of echo '{ "description": "a test mesage", "content": { "name": "Mary" } }' | pact-message update --consumer=CONSUMER --pact-dir=. --provider=PROVIDER ?

@TimothyJones
Copy link
Author

No specific reason, just what I happened to write

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants