Add commaDelimited and newlineDelimited to ArrayEncoding enum#9002
Add commaDelimited and newlineDelimited to ArrayEncoding enum#9002timotheeguerin merged 9 commits intomainfrom
Conversation
Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
|
@copilot please regenerate js documentation for the compiler and include the updated markdown file in this PR. you can do this by executing |
|
@copilot Please fix cspell violations in the PR. You can do this by adding the violating terms to the exceptions list for cspell. |
Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
Documentation regenerated and included in commit fbaaabd. The built-in-data-types.md file now includes the new commaDelimited and newlineDelimited enum values with full protocol-specific documentation. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
Cspell violations fixed in commit bac10d0. Added Ablack, Cblack, and Cbrown to the exceptions list - these are URL-encoded color names from the test data (e.g., "blue%2Cblack%2Cbrown" where %2C is comma, %0A is newline). |
|
All changed packages have been documented.
Show changes
|
commit: |
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
| @@ -531,11 +531,37 @@ enum BytesKnownEncoding { | |||
| * Encoding for serializing arrays | |||
| */ | |||
| enum ArrayEncoding { | |||
There was a problem hiding this comment.
ArrayEncoding is not used in the encode decorator behavior code. Should we add lint to only allow it to be set on array type? @timotheeguerin
There was a problem hiding this comment.
hhm yeah could do that, can you file an issue
| } | ||
| `); | ||
|
|
||
| strictEqual(getEncode(program, prop)?.encoding, "ArrayEncoding.spaceDelimited"); |
There was a problem hiding this comment.
Array encoding's usage is different from bytes/datetime/duration. It uses the TypeSpec enum value name instead a defined type in ts lib.
There was a problem hiding this comment.
yes this is expected, same as xml libraries. Using the fqn allows it to make sure it doesn't conflict with anything else. We couldn'tchange the other one for back compat
Adding commaDelimited and newlineDelimited to ArrayEncoding enum ✅
Implementation complete!
commaDelimitedandnewlineDelimitedenum members toArrayEncodingin decorators.tsppipeDelimitedandspaceDelimited)Summary
This PR successfully adds
commaDelimitedandnewlineDelimitedvalues to theArrayEncodingenum as per the approved design. The implementation includes:Core Changes:
pipeDelimitedandspaceDelimitedto match the new formatOpenAPI3 Integration:
Testing:
Documentation:
Test Results:
The implementation follows TypeSpec conventions and properly integrates with the existing ArrayEncoding infrastructure.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.