rspec_api_documentation icon indicating copy to clipboard operation
rspec_api_documentation copied to clipboard

Fix #407 Open API: Wrong parse in query params

Open SrMouraSilva opened this issue 6 years ago • 9 comments

Before the fix, the urls is wrong parsed. After the fix, the url are parsed as correctly

  • url: /path/:param1/path?param2=:param2&param3=:param3
  • before: /path/{param1}/path?param2={param2&param3=:param3}
  • after: /path/{param1}/path?param2={param2}&param3={param3}.

SrMouraSilva avatar Sep 18 '18 16:09 SrMouraSilva

@SrMouraSilva mind describing what you're fix does?

bf4 avatar Nov 19 '18 18:11 bf4

@bf4, it fixes https://github.com/zipmark/rspec_api_documentation/issues/407 In query parameters, the current regex parse wrong. For it, all the query is an unique parameter (see example in issue)

SrMouraSilva avatar Nov 20 '18 00:11 SrMouraSilva

Is mind synonymous with lying?

@bf4, I think there was some misunderstanding. Are you implying that I'm lying? Maybe my request has some side effect that I do not know. So, I apologize. However, I urge you to point out my mistake so I do not do it anymore.

SrMouraSilva avatar Nov 23 '18 22:11 SrMouraSilva

@SrMouraSilva

Is mind synonymous with lying?

nope. I was asking if you could describe what behavior is fixed the the diff in the PR, since my imagination was failing me and there's no test for me to look at, and I didn't noticed you had referenced this from #407

I was hoping you'd have something like

before the fix, the url is parsed as '...' after the fix, the url is parsed as '...' the parsing rule is per json schema or open api link description or some 'link here'

bf4 avatar Nov 23 '18 22:11 bf4

@bf4 Ah, ok! I updated the description.

SrMouraSilva avatar Nov 26 '18 11:11 SrMouraSilva

Oh, that looks straightforward enough. Any reason you didn't add a test?

bf4 avatar Nov 29 '18 22:11 bf4

Hello @bf4, I add a test and fix other the case:

  • url: /path/:param1/:param2?param3=:param3&param4=:param4
  • before: /path/{param1}/{param2?param3=:param3}&param4={param4}.
  • after: /path/{param1}/{param2}?param3={param3}&param4={param4}.

SrMouraSilva avatar Dec 06 '18 12:12 SrMouraSilva

Oh, that looks straightforward enough. Any reason you didn't add a test?

The reason was I have forgotten. At the last commit I added a test! :D

SrMouraSilva avatar Mar 01 '19 20:03 SrMouraSilva

cc @oestrich

bf4 avatar Mar 01 '19 21:03 bf4