Skip to content

[http-specs] Add http-specs tests for CSV encoding on model properties - #9106

Merged
tadelesh merged 3 commits into
mainfrom
copilot/add-csv-encoding-tests
Dec 4, 2025
Merged

[http-specs] Add http-specs tests for CSV encoding on model properties#9106
tadelesh merged 3 commits into
mainfrom
copilot/add-csv-encoding-tests

Conversation

Copilot AI commented Nov 28, 2025

Copy link
Copy Markdown
Contributor

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.

Co-authored-by: tadelesh <1726438+tadelesh@users.noreply.github.com>
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
@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

pkg-pr-new Bot commented Nov 28, 2025

Copy link
Copy Markdown

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
Copy Markdown
Contributor

All changed packages have been documented.

  • @typespec/http-specs
Show changes

@typespec/http-specs - feature ✏️

Add tests for array encode.

Comment thread packages/http-specs/specs/encode/array/main.tsp
@tadelesh
tadelesh enabled auto-merge December 3, 2025 05:23
@tadelesh
tadelesh disabled auto-merge December 4, 2025 02:38
@tadelesh
tadelesh enabled auto-merge December 4, 2025 02:38
@tadelesh

tadelesh commented Dec 4, 2025

Copy link
Copy Markdown
Member

@timotheeguerin @markcowl Could either of you approve this?

@tadelesh
tadelesh added this pull request to the merge queue Dec 4, 2025
Merged via the queue into main with commit 382fb8c Dec 4, 2025
23 checks passed
@tadelesh
tadelesh deleted the copilot/add-csv-encoding-tests branch December 4, 2025 16:04
github-merge-queue Bot pushed a commit that referenced this pull request Dec 12, 2025
@timotheeguerin timotheeguerin added lib:http-specs For issues/prs related to the @typespec/http-specs package spector Issues related to spector and the spec sets labels Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lib:http-specs For issues/prs related to the @typespec/http-specs package spector Issues related to spector and the spec sets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CSV encoding for model properties Scenario tests

6 participants