Fully support url template in Modular#2884
Merged
qiaozha merged 83 commits intoAzure:mainfrom Mar 7, 2025
Merged
Conversation
…into poc-modular-uri-template-support
MaryGao
commented
Oct 29, 2024
MaryGao
commented
Nov 4, 2024
MaryGao
commented
Feb 13, 2025
lirenhe
reviewed
Feb 14, 2025
lirenhe
reviewed
Feb 14, 2025
Contributor
There was a problem hiding this comment.
Copilot reviewed 68 out of 82 changed files in this pull request and generated no comments.
Files not reviewed (14)
- packages/typespec-ts/package.json: Language not supported
- packages/typespec-ts/test/azureModularIntegration/routes.spec.ts: Evaluated as low risk
- packages/typespec-ts/test/modularUnit/scenarios/operations/pathParam/allowReservedTrueWithUriTemplate.md: Evaluated as low risk
- packages/typespec-ts/src/utils/operationUtil.ts: Evaluated as low risk
- packages/typespec-ts/src/index.ts: Evaluated as low risk
- packages/typespec-ts/test/modularIntegration/collectionFormat.spec.ts: Evaluated as low risk
- packages/typespec-ts/test/commands/cadl-ranch-list.js: Evaluated as low risk
- packages/typespec-ts/src/modular/static-helpers-metadata.ts: Evaluated as low risk
- packages/typespec-ts/src/modular/buildOperations.ts: Evaluated as low risk
- packages/typespec-ts/test/modularUnit/scenarios/example/example.md: Evaluated as low risk
- packages/typespec-ts/test/modularUnit/scenarios/operations/pathParam/allowReservedWithUriTemplate.md: Evaluated as low risk
- packages/typespec-ts/test/modularUnit/scenarios/operations/pathParam/allowReservedFalseInAnnotation.md: Evaluated as low risk
- packages/typespec-ts/test/modularUnit/scenarios/anonymous/anonymous.md: Evaluated as low risk
- packages/typespec-ts/test/modularUnit/scenarios/apiOperations/apiOperations.md: Evaluated as low risk
Comments suppressed due to low confidence (1)
packages/typespec-ts/src/modular/helpers/operationHelpers.ts:1059
- The removal of the
allowReservedcheck for path parameters in thegetPathParamExprfunction could lead to incorrect URL encoding when reserved characters are involved. Please reintroduce theallowReservedcheck for path parameters.
const value = defaultValue ? typeof defaultValue === "string" ? `${paramName} ?? "${defaultValue}"` : `${paramName} ?? ${defaultValue}` : paramName;
timovv
reviewed
Feb 24, 2025
MaryGao
commented
Mar 4, 2025
MaryGao
commented
Mar 4, 2025
timovv
approved these changes
Mar 6, 2025
Member
timovv
left a comment
There was a problem hiding this comment.
LGTM. Codegen changes look good, and I see we have good test coverage for the implementation of the static helper. I think this is good as a first cut
qiaozha
approved these changes
Mar 7, 2025
Member
qiaozha
left a comment
There was a problem hiding this comment.
Please create issues for headers url template support and the deprecation of skipUrlEncoding in core, let's have further communications there.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #2735
fixes #2794
fixes #2866
fixes #3000
The pr is quite direct and I implemented an url template resolution helper to resolve path and query parameters. Relevant UTs and integration tests are updated to cover the new feature.