question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrong response using hyphen in query param & variable reference expression

See original GitHub issue

Hi, I’m facing a new issue when I use an hyphen in a query param and try to retrieve this value with variable reference expressions.

I have one operation like this : GET /users which can use query params like “id” or “account-name”.

I add two response examples in my openapi yaml file :

examples:
  get-users-id-10:
    value:
      id: "{{request.params[id]}}"
      accountName: "test"
  get-users-account-name-test:
    value:
      id: "8"
      accountName: "{{request.params[account-name]}}"

When I acces to http://localhost:8080/rest/Test/1.3.0/users?id=10 I get a correct response : {"id":"10","accountName":"test"}

But when I try http://localhost:8080/rest/Test/1.3.0/users?account-name=test I do not retrieve my “account-name” param value as a string but get it as an object and I do not understand why. {"id":"8","accountName":"{account-name=test}]}}"}

How can I get this kind of response ? : {"id":"8","accountName":"test"}

Thanks

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
lbroudouxcommented, Sep 1, 2022

Done

1reaction
lbroudouxcommented, Sep 1, 2022

Hope to release it within a week.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can hyphens be used in query string values? - Stack Overflow
I am parsing $_SERVER['QUERY_STRING'] with PHP. I would like to know whether it is syntactically correct to use hyphens in query string ......
Read more >
Allowing hyphens in Query Params · Issue #460 · apiaryio/dredd
I have a query param that has a hyphen as the key. e.g. foo-bar, but dredd is throwing an error that it's invalid....
Read more >
With respect to SEO, is it preferred to use hyphen instead of ...
Generally speaking, "hyphen" is prefered over "underscore" - I never had anyone use "periods" before, but for the sake of this question, ...
Read more >
Dash (Hyphen) or Underscore in URLs: Which one to use and ...
Should you use a dash or an underscore in URLs? Well, the answer depends on a few things and is not that simple....
Read more >
Amazon API Gateway important notes
API Gateway does not support sharing a custom domain name across REST and WebSocket APIs. Stage names can only contain alphanumeric characters, hyphens, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found