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

Getting data by name will return first data bucket CONTAINING (not just EQUAL) string param #1313

Closed
R0M4N0F5K7 opened this issue Feb 12, 2024 · 1 comment

Comments

@R0M4N0F5K7
Copy link

R0M4N0F5K7 commented Feb 12, 2024

Describe the bug
Seems like when referencing a data bucket by name it will return the data from the first one that includes/contains the name as a substring instead of only one of equal name.
E.g. if I get {{dataRaw 'applications'}} it will return the data bucket "applications software" or even "ABC_applications_XYZ", which can't possibly be the expected behavior...?

Steps to Reproduce

  1. create two data buckets, the second one being name A, the first one having name A as a substring. E.g. first "substring123”, second "string" and fill them with any distinguishable data.
  2. reference the shorter, contained string in your response. E.g. {{{stringify (dataRaw 'string')}}}
  3. if you call that request you will get the data from the first data bucket in the data list that CONTAINS the string name, "substring123" in our example.

Mockoon version:
v6.2.0 on Windows

@255kb
Copy link
Member

255kb commented Feb 13, 2024

This was done on purpose to allow users to reference a data bucket without having to write its exact name.
If you want to get a specific bucket with 100% certainty, you either have to write the full name or use the unique ID visible at the bottom of the data bucket page, or by right-clicking "Copy ID to clipboard":
image

@255kb 255kb closed this as not planned Won't fix, can't repro, duplicate, stale Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants