Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 22, 2025

Adds test coverage for model properties using reserved keywords, specifically "list" which is reserved in Python and other languages.

Changes

  • main.tsp: Added ModelWithList model with list property in ModelProperties namespace, following existing pattern for reserved word testing
  • mockapi.ts: Added SpecialWords_ModelProperties_withList scenario expecting {"list": "ok"} payload
  • Special words list: Updated documentation to include "list" in the enumerated reserved words

Example

model ModelWithList {
  list: string;
}

@scenario
@route("list")
op withList(@body body: ModelWithList): void;

Validates that generators properly escape or handle the list property name when generating client code.

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 sh n-sc�� ebsite/src/content/docs/docs/emitters/openapi3/reference node k/typespec/typespec/node_modules../../website/src/content/docs/docs/emitters/protobuf/reference -p . n-schema/referentspd doc . --enable-experimental --output-dir ../../website/src/content/docs/docs/emitters/servers/http-server-csharp/reference --skip-js node tool�� lmstxt --output-dir ../../website/src/content/docs/docs/libraries/http/reference node pec/node_modules/.bin/sh /library-linter sh sh /.bin/sh sh (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>[specs] new test case for model whose property is named "list"</issue_title>
<issue_description>To cover scenario #9248, we need a new test case in https://github.com/microsoft/typespec/blob/main/packages/http-specs/specs/special-words/main.tsp that it has model property named "list"

NOTE:

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


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits December 22, 2025 08:20
Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
Copilot AI changed the title [WIP] Add new test case for model property named 'list' Add test case for model property named "list" Dec 22, 2025
Copilot AI requested a review from msyyc December 22, 2025 08:34
@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 24, 2025

Open in StackBlitz

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

commit: 57d7ad6

@github-actions
Copy link
Contributor

All changed packages have been documented.

  • @typespec/http-specs
Show changes

@typespec/http-specs - internal ✏️

Add test case for model property named "list" to cover special word scenarios

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.

[specs] new test case for model whose property is named "list"

2 participants