-
Notifications
You must be signed in to change notification settings - Fork 128
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
Missing path parameters #23
Comments
Hi @almamatter9 what you mean by path parameters, can you please provider an example? |
Hi @rangav, For a endpoint like this : Here down below, how Postman handle both Query Params and path params (or path variable) In Postman, to use a path parameter, we need to enter the parameter name after a colon :
|
ok got it, I will add this to the product roadmap. |
Hi @rangav. Congrats you for such amazing job! It seems, query parameters does not render enviroment variables too. I belive issues are related. |
Hi @mazoqui thank you. Can you post a screenshot or more details about the query params and env var issue? |
Hi @rangav - thank you for the quick response. "Base" and "Output" variables are defined, yet I need to replace {{varname}} with related value to get this request to work |
Hope i'm not late to the party. Just found Thunder a couple days ago, very nice indeed :) As of now this is the only thing that feels like it lacks and missing, allowing variables in the URI. Just curious for this update does it allow for variables being defined at both the collection level (effectively global for the collection) and/or the individual request level? Following along with this, and kind of related. Allow the base URI for the collection to be configurable? In postman i would often have my queries to be {{URI}}:{{Port}}. Sure you see why :) The one down side for this is losing the "www.thunderclient.io" reference. Hmmm suggestion two? On the side of the UI, put a "What's new" i.e.: Anyway thanks for an awesome tool. For me postman just met up with the garbage man and is heading to the dump! |
Hi @ZooDoo4U thanks for feedback you can use environment variables for baseUrl and port and for other parameters Will soon implement path parameters |
But using environment variables alone seems problematic? If using 2 or more collection and using what {{#host}}, as soon as one get 2 or more collection which may have different end point, we run into an issue? Environment variables might be a decent stop gap, but not a sustainable solution in the long run. Would assert the variables belong within and should be bound directly in the collection... |
Linking a environment with a collection is in roadmap. will start work on collection level options like headers, auth etc in early July. |
lack of path variable support and not being able to set auth token at root level (and be able to override in deeper levels) are the only two things preventing me from switching to thunder client. @rangav hope you'll implement these soon... and keep up the good work!!! awesome stuff!!! |
Hi @dj-nitehawk thanks for feedback. planning to start work in july, there are few things todo in my list before i start this. |
Hi guys! |
Hi @transfer76, I think it needs a little work, but with the latest version (i'm running 1.5.0, just noticed 1.6 available). Anyway it might be like myself, took a little stumbling to get them working. Where postman will show your param/variables at the same time as your query... You will first need to create an Env. Define your params in the Env, now back to your query collection and define a query such as: {{baseUrl}}:{{port}}/bible/{{bibleVersion}}/FullBookNames So from the variables you defined in you Env, just wrap them as show with: {{yourParamNameGoesHere}} Think this should get you working. The one thing missing is allowing "Global" params at the "Collection" which may be overridden on an individual query within the collection. |
Cannot wait for the feature, path parameters("path variable" in Postman)! |
@rangav if I may contribute to the discussion. The use of path variables is extremely helpful when keeping the route the same between code and api testing. So with that in mind, may I suggest that only for path variables, the format for that be Just my two cents, in trying to make a plug-in that is already fantastic, just that much better!! |
Hi all, I will include this feature for the next update v1.9.0 see all features planned #282 These variables work in request level only |
I wouldn't be a fan of using ":var_name" for a parameter. In a URL ':' can be used as a valid legal character making up the URI itself, while "{}" aren't. That would be the first reason not to change what is already being used. Which now means there would also be a breaking change all users with collections now that will need to fixed. And finally, would assert most of us are web developers, be it Javascript itself, React, Angular or any other tool/component we will already use.... Just feels a lot more natural for variable substitution follow the language and frameworks/libraries we all use daily...? Ah and one last thing with only using ":" where does the parameter name end if only :some_variable::port:domain:component Just seems using the "{}" is be cleaner and obvious, my example with the port in my example. Is that a valid URI, did i mean for the ':' before the port or not? My point it isn't definitive the author's intention does port === ":80" or "80"? Just saying this is clear and obvious... No? And here there is no ambiguity... |
Hi @ZooDoo4U thanks for the feedback, for path variable are you suggesting to use single bracket |
@rangav Thanks for your attention, glad you liked the feedback. I'd assert one or two "{}" would be fine. Double checking not sure why i was using two, seems when i was googling how to use the place holders the pages/references i found used two and that is what was working for me. Double checking and searching again, now i'm seeing others are using only one, so using two is more from my confusion... (sorry) I'd assert one "{}" would be perfect, then again most developer might agree 99% of most bugs are one off errors ;) Either way love to see your work and attention to your users.... |
While I understand why people are weirded out by Besides, the only time a : is valid is after the top level domain, and before the path. |
I would humbly reject your assertion the ':' is only valid as mentioned. Found this reference on Quora In the end it will point you to the RFC 3986 4.2 Also just wrote a sample Rest Api with ASP.NET. https://localhost:44338/TestApiEndpoint/abc:def Worked just fine... Okay i'm assuming MS is adhering to the RFC 3986 spec... But even being a back end only developer for 40+ years, would prefer the "{}", seeing a :var_name would seem more like a target for goto target command/script file, nothing related to web request... Not clear why you are asserting ":this" is more useful or easier? And carrying on with usefulness, with the "{}" i can directly copy my request into my javascript, use back ticks and fix up my place holder variable names (which if that is what i'm using in Thunder Client, good chance the same was what i have in my JS)??? With this absolutely no fixup required for my copied URI? Not possible with ":this"? And even when i paste the URI into my C# code, use $"" for string interpolation again no fix up. I like the option to have no fix up and copy directly from Thunder Client to my actual code, no fuss, no errors, worked when i tested, should work in either my JS or C# code... And if the thunder client collection could be shared (which i'm assuming could be but not 100% sure) that would help impose a coding style on all :) Sorry to belabor the point, just haven't heard one reasonable reason for using ":this". Or i'd be curious which language if any would all for string interpolation with: Would simply follow javascript ES5 or ES6... They are the most common for the web these days...? |
@rangav Fair enough, from what i'm seeing Postman nor Insomnia use ":this". Insomnia uses {{this}} Postman {this}. Would like to know which tool actually uses ":this". I'm curious what tool(s) are using ":this" in case i ever come across it so i can be prepared for it :) |
Insomnia path params postman Both use don't confuse with environment variables format |
@rangav While this discussion does open up a question i'm not sure about Sharing collections. Would agree it is a separate issue. Saving and passing around collections between users. At work for Postman we have a collection file we can import/export and it is checked into git (less the actual keys). From what see there is no way to allow for this sharing... Am I missing that, not seeing where or how to do that. Just ask, i'll open a new request. |
@ZooDoo4U sharing works in TC, by saving requests in git repository, see below link for Team features |
I'm not familiar with Insomnia, but i know Postman uses "{}" i'm not seeing on their page ":this". https://learning.postman.com/docs/sending-requests/variables/ While there should be a really compelling reason to not use "{}" given the point you can copy/paste from TC to my actual code.... Cheers :) |
Awesome, i tend not to check updates for VS Code often. Sure enough installed the newest Bingo.. there it is :) |
looks like there is some limitations with format Following use-cases might be tricky to do and not possible in other clients
|
I'm curious when, where, how did ":PathName" become popular, i do lots of web api stuff. Or for that matter seems a lot better to remain simple to have an API like: Very straight forward, ":pathSegment" is not needed and query params simply help influence things like paging size, sort order, values filters, and the like.... All the while given the HTTP Verb they may all have a body for a payload. I'm just not seeing the need to have ":param". |
Hi all, I think it's better to use different syntax for path params to address these limitations #23 (comment) so planning to use format When importing postman collection the extension with convert to this format. let me know any further feedback |
This feature is now implemented in v1.9.0 please let me know if any feedback |
Awesome work @rangav, will check it out. Again thanks for your support!!! |
Thanks @nghtstr for reporting the bug, will try to fix it asap. |
If i'm not mistaken, i started off using "{{var}}" as it as the only example if found, you only need "{var}", but then again that might be a nice solution use "{single}" for query params and "{{double}}" for environment... Or if i'm understanding it you have duplicate names for both and you're battling which has precedence? Sorry your bug and issue isn't exactly clear. |
yes thats the plan to use "{single}" for query params and "{{double}}" for environment. thats how its implemented now. But i did not test this use case you mentioned above for bug. |
Just now did a quick release v1.9.1 to fix this bug, please test and let me know if its working or not. |
Can you add "path parameters" in the Params tab
Thks
The text was updated successfully, but these errors were encountered: