Skip to content
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

Change how required parameters are represented in URI Templates #3989

Closed
darrelmiller opened this issue Jan 10, 2024 · 3 comments · Fixed by #4087
Closed

Change how required parameters are represented in URI Templates #3989

darrelmiller opened this issue Jan 10, 2024 · 3 comments · Fixed by #4087
Assignees
Labels
enhancement New feature or request generator Issues or improvements relater to generation capabilities. WIP
Milestone

Comments

@darrelmiller
Copy link
Member

Currently all parameters are rendered in URI templates like this:

  {+baseUrl}{?paramA,paramB,paramC}

I would like us to consider changing the way required parameters are presenting. Consider paramA and paramB are optional, but paramC is required, the URI Template would be

  {+baseUrl}?paramC={paramC}{&paramA,paramB}

With this approach, query parameters that are required but allow an empty value, do not require the application developer to explicitly set the empty value.
The other advantage is that when using this URI Template for documentation/debugging purposes it is very clear which parameters are required vs optional.
This approach also produces a more stable URL as the order of query parameters is impacted less due to the presence of optional parameters. This is helpful to prevent HTTP cache pollution.

@baywet
Copy link
Member

baywet commented Jan 10, 2024

related microsoft/kiota-dotnet#172

@baywet baywet self-assigned this Jan 10, 2024
@baywet baywet added enhancement New feature or request generator Issues or improvements relater to generation capabilities. labels Jan 10, 2024
@baywet baywet added this to the Backlog milestone Jan 10, 2024
@baywet
Copy link
Member

baywet commented Jan 10, 2024

@sebastienlevert for prioritization

@sebastienlevert
Copy link
Contributor

This seems like a clear bug and impact current customers. I'll add it to our 1.11 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request generator Issues or improvements relater to generation capabilities. WIP
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants