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

Slash in consumer name results in folders being created #126

Closed
TimothyJones opened this issue Nov 23, 2017 · 8 comments
Closed

Slash in consumer name results in folders being created #126

TimothyJones opened this issue Nov 23, 2017 · 8 comments
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@TimothyJones
Copy link
Contributor

Software versions

  • OS: Mac OSX 10.11.6 (15G1611)
  • Consumer Pact library: Pact JS 4.2.1
  • Provider Pact library: NA
  • Node Version: v8.3.0

When the consumer or provider names contain a slash, the slash is passed through to the file system, which creates folders:

Expected behaviour

Full pact filename is present in the pacts/ folder, something like: pacts/a_b client-a_b api.json

Alternatively, some kind of error that provider/consumer names are not allowed to contain slashes.

Actual behaviour

Pact file in a few folders deep: pacts/a/b client-a/b api.json

Steps to reproduce

Use the following pact() call:

  const provider = pact({
    consumer: 'A/B Client',
    provider: 'A/B API',
    port,
    done: error => expect(error).to.be.null
  });
@bethesque
Copy link
Member

I'm trying to think of an example where a service name would have a slash in it! But yes, we should do one of the two.

@bethesque
Copy link
Member

Can you raise this in the pact-mock_service repository? That's where the logic is.

@TimothyJones
Copy link
Contributor Author

The example we have is an API for A/B testing. I'll raise the issue over there now.

@TimothyJones
Copy link
Contributor Author

Done: pact-foundation/pact-mock_service#81

I suppose we should close this one now?

@mefellows
Copy link
Member

I think it's an acceptable string to use, I would suggest we properly escape the names and let it be used (and not created the subfolders).

@mefellows
Copy link
Member

Let's leave this open for the time being until we understand if changes are required here also.

@stale
Copy link

stale bot commented Feb 10, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Feb 10, 2019
@stale stale bot closed this as completed Feb 17, 2019
@mefellows mefellows added bug Indicates an unexpected problem or unintended behavior and removed Triage labels Feb 17, 2019
@mefellows mefellows reopened this Feb 17, 2019
@TimothyJones
Copy link
Contributor Author

Changes were not required :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants