-
Notifications
You must be signed in to change notification settings - Fork 73
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
Fix collectionFormat issue in header #1878
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
b95fc23
Merge branch 'main' into fix-csv-default-issue
MaryGao 9f8428a
Add helper method for header csv format
MaryGao e808d05
Update the test cases in swagger
MaryGao 452eb71
Update the swagger side change
MaryGao 66354f8
Revert changes
MaryGao b23b3d5
Revert changes
MaryGao 5247311
Update the generated code
MaryGao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -304,4 +304,4 @@ function getAllOperations(model: CodeModel): Operation[] { | |
} | ||
|
||
return operations; | ||
} | ||
} | ||
7 changes: 2 additions & 5 deletions
7
...est.typescript/test/rlcIntegration/generated/multipleUrlParameters/src/serializeHelper.ts
This file contains 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
12 changes: 6 additions & 6 deletions
12
packages/autorest.typescript/test/rlcIntegration/generated/urlRest/src/serializeHelper.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
export function buildPipeCollection(queryParameters: string[]): string { | ||
return queryParameters.join("|"); | ||
export function buildPipeCollection(items: string[]): string { | ||
return items.join("|"); | ||
} | ||
|
||
export function buildSsvCollection(queryParameters: string[]): string { | ||
return queryParameters.join(" "); | ||
export function buildSsvCollection(items: string[]): string { | ||
return items.join(" "); | ||
} | ||
|
||
export function buildTsvCollection(queryParameters: string[]) { | ||
return queryParameters.join("\t"); | ||
export function buildTsvCollection(items: string[]) { | ||
return items.join("\t"); | ||
} |
This file contains 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
7 changes: 2 additions & 5 deletions
7
packages/autorest.typescript/test/smoke/generated/agrifood-data-plane/src/serializeHelper.ts
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
export const buildMultiCollectionContent = ` | ||
export function buildMultiCollection( | ||
queryParameters: string[], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change the param name to |
||
items: string[], | ||
parameterName: string | ||
) { | ||
return queryParameters | ||
return items | ||
.map((item, index) => { | ||
if (index === 0) { | ||
return item; | ||
|
@@ -14,16 +14,21 @@ export function buildMultiCollection( | |
}`; | ||
|
||
export const buildPipeCollectionContent = ` | ||
export function buildPipeCollection(queryParameters: string[]): string { | ||
return queryParameters.join("|"); | ||
export function buildPipeCollection(items: string[]): string { | ||
return items.join("|"); | ||
}`; | ||
|
||
export const buildSsvCollectionContent = ` | ||
export function buildSsvCollection(queryParameters: string[]): string { | ||
return queryParameters.join(" "); | ||
export function buildSsvCollection(items: string[]): string { | ||
return items.join(" "); | ||
}`; | ||
|
||
export const buildTsvCollectionContent = ` | ||
export function buildTsvCollection(queryParameters: string[]) { | ||
return queryParameters.join("\\t"); | ||
export function buildTsvCollection(items: string[]) { | ||
return items.join("\\t"); | ||
}`; | ||
|
||
export const buildCsvCollectionContent = ` | ||
export function buildCsvCollection(items: string[]) { | ||
return items.join(","); | ||
}`; |
This file contains 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
7 changes: 2 additions & 5 deletions
7
packages/typespec-test/test/collectionFormat/generated/typespec-ts/src/serializeHelper.ts
This file contains 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
This file contains 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
7 changes: 2 additions & 5 deletions
7
packages/typespec-test/test/translator/generated/typespec-ts/src/serializeHelper.ts
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't support this case in swagger side, because I didn't find a valid case anywhere and when I tried to build one the autorest would complain
Unknown primitive schema array
.I guess only primitive types are supported in header for autorest.