Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 11, 2025

The @convenientAPI and @protocolAPI decorators lacked test coverage for namespace and interface level application, only being tested on individual operations.

Changes

Added specs/azure/client-generator-core/convenient-api/ with test cases covering:

  • Namespace level decorators: @convenientAPI(false) and @protocolAPI(false) applied to namespaces containing multiple operations
  • Interface level decorators: @convenientAPI(false) and @protocolAPI(false) applied to interfaces within namespaces

Each test case includes:

  • TypeSpec scenario definitions with proper documentation
  • Mock API handlers for GET and POST operations
  • Consistent request/response patterns for validation

Example usage in the test:

@convenientAPI(false)
namespace ConvenientNamespace {
  @route("/operation1")
  @get
  op operation1(@query name: string): TestModel;
  
  @route("/operation2")
  @post
  op operation2(@query name: string): TestModel;
}

This validates that SDK generators correctly handle decorator inheritance from namespace/interface scope to contained operations.

Original prompt

This section details on the original issue you should resolve

<issue_title>add new cases for decorator @convenientAPI & @protocolAPI applied at the namespace + interface level</issue_title>
<issue_description>The protocolAPI decorator docs are here and the convenientAPI decorator docs are here.

Goal:
Add test case in folder https://github.com/Azure/typespec-azure/tree/main/packages/azure-http-specs/specs/azure/client-generator-core

Ask:

Add cases:

  • applying each decorator at the namespace level
  • applying each decorate at the interface level</issue_description>

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 11, 2025 20:13
Copilot AI changed the title [WIP] Add new cases for decorators @convenientAPI and @protocolAPI Add test cases for @convenientAPI and @protocolAPI at namespace and interface levels Dec 11, 2025
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.

add new cases for decorator @convenientAPI & @protocolAPI applied at the namespace + interface level

2 participants