Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 28, 2025

Adds scenario tests for array encoding on model properties, covering all four ArrayEncoding variants.

Changes

  • New test folder: packages/http-specs/specs/encode/array/
  • Scenarios added:
    • commaDelimited (CSV) - values joined with ,
    • spaceDelimited (SSV) - values joined with
    • pipeDelimited - values joined with |
    • newlineDelimited - values joined with \n

Example

model CommaDelimitedArrayProperty {
  @encode(ArrayEncoding.commaDelimited)
  value: string[];
}

@route("/property/comma-delimited")
@post
op commaDelimited(@body body: CommaDelimitedArrayProperty): CommaDelimitedArrayProperty;

Expected request/response body:

{
  "value": "blue,red,green"
}

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:

  • telemetry.astro.build
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/typespec/typespec/website/node_modules/.bin/../astro/astro.js build (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>CSV encoding for model properties Scenario tests</issue_title>
<issue_description>Add http-specs tests for array encoding, including all four encode. Add a new folder under packages/http-specs/specs/encode.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Add HTTP specs tests for CSV encoding of model properties Add http-specs tests for CSV encoding on model properties Nov 28, 2025
Copilot AI requested a review from tadelesh November 28, 2025 03:25
Copilot finished work on behalf of tadelesh November 28, 2025 03:25
@tadelesh tadelesh marked this pull request as ready for review November 28, 2025 03:49
@tadelesh tadelesh changed the title Add http-specs tests for CSV encoding on model properties [http-specs] Add http-specs tests for CSV encoding on model properties Nov 28, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 28, 2025

Open in StackBlitz

npm i https://pkg.pr.new/microsoft/typespec/@typespec/http@9106
npm i https://pkg.pr.new/microsoft/typespec/@typespec/http-specs@9106

commit: f6d8c0a

@github-actions
Copy link
Contributor

All changed packages have been documented.

  • @typespec/http-specs
Show changes

@typespec/http-specs - feature ✏️

Add tests for array encode.


model CommaDelimitedArrayProperty {
@encode(ArrayEncoding.commaDelimited)
value: string[];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hope we won't have a int32[] or utcDateTime[]...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CSV encoding for model properties Scenario tests

3 participants