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.

Optional path needs to be supported

See original GitHub issue

In 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:closed
  • Created 8 years ago
  • Comments:11 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
darrelmillercommented, Apr 8, 2016

Optional path parameters are supported in URI Templates (RFC 6570) , but they don’t work the way the original example suggested.
Consider this template:

 /subscriptions/{subscriptionId}/resourceGroups{/resourceGroupName}/resources 

Note the / is inside the curly braces. When {resourceGroupName} is not provided, the URL would be,

/subscriptions/{subscriptionId}/resourceGroups/resources 

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.

0reactions
fearthecowboycommented, Jun 15, 2016

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. 🎉

Read more comments on GitHub >

github_iconTop 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 >

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