Optional path needs to be supported
See original GitHub issueIn Hyak when a part of the path is set to be optional, if the optional argument in the path is not provided, it would not include the optional path. This is not supported with AutoRest, which is needed by Key Vault service.
For example for
/subscriptions/{subscriptionId}/[resourceGroups/{resourceGroupName}]/resources
if {resourceGroupName} is provided, the base URL should be
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/resources
and when {resourceGroupName} is not provided, the base URL should be
/subscriptions/{subscriptionId}/resources
Issue Analytics
- State:
- Created 8 years ago
- Comments:11 (10 by maintainers)
Top Results From Across the Web
Spring Optional Path Variables
Explore how to make a path variable optional in different Spring versions.
Read more >React Router with optional path parameter
v6: React router seems to have dropped support for optional path parameters in v6, see github.com/remix-run/react-router/issues/…
Read more >Optional path parameters #93 - OAI/OpenAPI-Specification
I use optional path parameters in a REST API for filtering, sorting etc. ... path parameters are a natural element of REST APIs,...
Read more >Paths and Operations
Paths may have an optional short summary and a longer description for documentation purposes. This information is supposed to be relevant to all...
Read more >Define Spring Optional Path Variables | by Ravinder Verma
From Spring 4.3.3 version, @PathVariable annotation has required attribute, to specify it is mandatorily required in URI. The default value for ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Optional path parameters are supported in URI Templates (RFC 6570) , but they don’t work the way the original example suggested.
Consider this template:
Note the / is inside the curly braces. When {resourceGroupName} is not provided, the URL would be,
I realize that doesn’t help much, but if OpenAPI are going to support optional parameters then it is likely going to be the 6570 way. I doubt we could reach consensus on the idea that the parent path segment is “attached” to the parameter segment.
Howdy!
In our planning for driving towards a stable ‘1.0’ release, I’m marking this issue as ‘deferred’ 💤 and we’re going to review it during the post-1.0 planning cycle.
It’s not to say that we’re not going to work on it, or that this isn’t not important, but at the moment, we’re picking and choosing the stuff we must do before 1.0. 🏇 🏇 🏇
We’ll make sure we pick this back up at that point. 🎉