Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ describe("Next link operations", () => {
it("includes protocol-only response model in code model (issue #9391)", async () => {
const program = await typeSpecCompile(
`
@convenientAPI(false)
@convenientAPI(false, "csharp")
@list
op link(): {
@pageItems
Expand Down Expand Up @@ -267,7 +267,7 @@ describe("Next link operations", () => {
it("includes nested enum from protocol-only response model in code model", async () => {
const program = await typeSpecCompile(
`
@convenientAPI(false)
@convenientAPI(false, "csharp")
@list
op link(): {
@pageItems
Expand Down Expand Up @@ -309,7 +309,7 @@ describe("Next link operations", () => {
it("includes deeply nested enum from protocol-only response model in code model", async () => {
const program = await typeSpecCompile(
`
@convenientAPI(false)
@convenientAPI(false, "csharp")
@list
op link(): {
@pageItems
Expand Down Expand Up @@ -359,7 +359,7 @@ describe("Next link operations", () => {
it("does not deduplicate enums with the same name but different namespaces", async () => {
const program = await typeSpecCompile(
`
@convenientAPI(false)
@convenientAPI(false, "csharp")
@list
op link(): {
@pageItems
Expand Down Expand Up @@ -413,7 +413,7 @@ describe("Next link operations", () => {
};
}

@convenientAPI(false)
@convenientAPI(false, "csharp")
@list
@route("/a")
op listA(): {
Expand All @@ -423,7 +423,7 @@ describe("Next link operations", () => {
next?: url;
};

@convenientAPI(false)
@convenientAPI(false, "csharp")
@list
@route("/b")
op listB(): {
Expand Down
4 changes: 2 additions & 2 deletions packages/http-client-csharp/emitter/test/Unit/usage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ interface LegacyLro {
@doc("Gets the status and details of the Radiology Insights job.")
@get
@route("/radiology-insights/jobs/{id}")
@convenientAPI(false)
@convenientAPI(false, "csharp")
getJob is HealthInsightsLongRunningPollOperation<RadiologyInsightsResult>;

#suppress "@azure-tools/typespec-azure-core/long-running-polling-operation-required" "Polling through operation-location"
Expand All @@ -643,7 +643,7 @@ interface LegacyLro {
@doc("Creates a Radiology Insights job with the given request body.")
@pollingOperation(LegacyLro.getJob)
@route("/radiology-insights/jobs")
@convenientAPI(true)
@convenientAPI(true, "csharp")
createJob is HealthInsightsLongRunningRpcOperation<
RadiologyInsightsData,
RadiologyInsightsResult
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ op sayHi(
@route("/againHi")
@doc("Return hi again")
@get
@convenientAPI(true)
@convenientAPI(true, "csharp")
op helloAgain(
@header p1: string,
@body action: RoundTripModel,
Expand All @@ -539,43 +539,43 @@ op noContentTypeOverride(info: Wrapper): RoundTripModel;
@route("/demoHi")
@doc("Return hi in demo2")
@get
@convenientAPI(true)
@convenientAPI(true, "csharp")
op helloDemo2(): Thing;

@route("/literal")
@doc("Create with literal value")
@post
@convenientAPI(true)
@convenientAPI(true, "csharp")
op createLiteral(@body body: Thing): Thing;

@route("/helloLiteral")
@doc("Send literal parameters")
@get
@convenientAPI(true)
@convenientAPI(true, "csharp")
op helloLiteral(@header p1: "test", @path p2: 123, @query p3: true): Thing;

@route("/top")
@doc("top level method")
@get
@convenientAPI(true)
@convenientAPI(true, "csharp")
op topAction(@path action: utcDateTime): Thing;

@route("/top2")
@doc("top level method2")
@get
@convenientAPI(false)
@convenientAPI(false, "csharp")
op topAction2(): Thing;

@route("/patch")
@doc("top level patch")
@patch
@convenientAPI(true)
@convenientAPI(true, "csharp")
op patchAction(@body body: Thing): Thing;

@route("/anonymousBody")
@doc("body parameter without body decorator")
@post
@convenientAPI(true)
@convenientAPI(true, "csharp")
op anonymousBody(
...Thing,
@query requiredQueryParam: "someRequiredLiteralQueryParam",
Expand All @@ -585,21 +585,21 @@ op anonymousBody(
@route("/friendlyName")
@doc("Model can have its friendly name")
@post
@convenientAPI(true)
@convenientAPI(true, "csharp")
op friendlyModel(...NotFriend): NotFriend;

op addTimeHeader(@header("Repeatability-First-Sent") repeatabilityFirstSent?: utcDateTime): void;

@route("/projectedName")
@doc("Model can have its projected name")
@post
@convenientAPI(true)
@convenientAPI(true, "csharp")
op projectedNameModel(...ModelWithClientName): ModelWithClientName;

@route("/returnsAnonymousModel")
@doc("return anonymous model")
@post
@convenientAPI(true)
@convenientAPI(true, "csharp")
op returnsAnonymousModel(): {
@body body: {};
};
Expand All @@ -612,32 +612,32 @@ op getUnknownValue(): DaysOfWeekExtensibleEnum;
@doc("When set protocol false and convenient true, then the protocol method should be internal")
@route("internalProtocol")
@post
@convenientAPI(true)
@protocolAPI(false)
@convenientAPI(true, "csharp")
@protocolAPI(false, "csharp")
op internalProtocol(@body body: Thing): Thing;

@doc("When set protocol false and convenient true, the convenient method should be generated even it has the same signature as protocol one")
@route("stillConvenient")
@get
@convenientAPI(true)
@protocolAPI(false)
@convenientAPI(true, "csharp")
@protocolAPI(false, "csharp")
op stillConvenient(): void;

@route("/headAsBoolean")
@doc("head as boolean.")
@head
@convenientAPI(true)
@convenientAPI(true, "csharp")
op headAsBoolean(@path id: string): void;

@route("/WithApiVersion")
@doc("Return hi again")
@get
@convenientAPI(true)
@convenientAPI(true, "csharp")
op WithApiVersion(@header p1: string, @query apiVersion: string): void;

@route("/link")
@doc("List things with nextlink")
@convenientAPI(true)
@convenientAPI(true, "csharp")
@list
op ListWithNextLink(): {
@pageItems
Expand All @@ -648,7 +648,7 @@ op ListWithNextLink(): {

@route("/linkString")
@doc("List things with nextlink")
@convenientAPI(true)
@convenientAPI(true, "csharp")
@list
op ListWithStringNextLink(): {
@pageItems
Expand All @@ -659,7 +659,7 @@ op ListWithStringNextLink(): {

@route("/continuation")
@doc("List things with continuation token")
@convenientAPI(true)
@convenientAPI(true, "csharp")
@list
op ListWithContinuationToken(@query @continuationToken token?: string): {
@pageItems
Expand All @@ -670,7 +670,7 @@ op ListWithContinuationToken(@query @continuationToken token?: string): {

@route("/continuation/header")
@doc("List things with continuation token header response")
@convenientAPI(true)
@convenientAPI(true, "csharp")
@list
op ListWithContinuationTokenHeaderResponse(@query @continuationToken token?: string): {
@pageItems
Expand All @@ -685,7 +685,7 @@ model Page<T> {

@route("list/paging")
@doc("List things with paging")
@convenientAPI(true)
@convenientAPI(true, "csharp")
@list
op ListWithPaging(): Page<Thing>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ op sayHi(
@route("/againHi")
@doc("Return hi again")
@get
@convenientAPI(true)
@convenientAPI(true, "csharp")
op helloAgain(
@header p1: string,
@body action: RoundTripModel,
Expand All @@ -261,7 +261,7 @@ op helloAgain(
@route("/noContentType")
@doc("Return hi again")
@get
@convenientAPI(false)
@convenientAPI(false, "csharp")
op noContentType(
@header p1: string,
@body action: RoundTripModel,
Expand All @@ -271,63 +271,63 @@ op noContentType(
@route("/demoHi")
@doc("Return hi in demo2")
@get
@convenientAPI(true)
@convenientAPI(true, "csharp")
op helloDemo2(): Thing;

@route("/literal")
@doc("Create with literal value")
@post
@convenientAPI(true)
@convenientAPI(true, "csharp")
op createLiteral(@body body: Thing): Thing;

@route("/helloLiteral")
@doc("Send literal parameters")
@get
@convenientAPI(true)
@convenientAPI(true, "csharp")
op helloLiteral(@header p1: "test", @path p2: 123, @query p3: true): Thing;

@route("/top")
@doc("top level method")
@get
@convenientAPI(true)
@convenientAPI(true, "csharp")
op topAction(@path action: utcDateTime): Thing;

@route("/top2")
@doc("top level method2")
@get
@convenientAPI(false)
@convenientAPI(false, "csharp")
op topAction2(): Thing;

@route("/patch")
@doc("top level patch")
@patch
@convenientAPI(true)
@convenientAPI(true, "csharp")
op patchAction(@body body: Thing): Thing;

@route("/anonymousBody")
@doc("body parameter without body decorator")
@post
@convenientAPI(true)
@convenientAPI(true, "csharp")
op anonymousBody(...Thing): Thing;

@route("/friendlyName")
@doc("Model can have its friendly name")
@post
@convenientAPI(true)
@convenientAPI(true, "csharp")
op friendlyModel(...NotFriend): NotFriend;

op addTimeHeader(@header("Repeatability-First-Sent") repeatabilityFirstSent?: utcDateTime): void;

@route("/projectedName")
@doc("Model can have its projected name")
@post
@convenientAPI(true)
@convenientAPI(true, "csharp")
op projectedNameModel(...ModelWithProjectedName): ModelWithProjectedName;

@route("/returnsAnonymousModel")
@doc("return anonymous model")
@post
@convenientAPI(true)
@convenientAPI(true, "csharp")
op returnsAnonymousModel(): {
@body body: {};
};
Expand All @@ -340,19 +340,19 @@ op getUnknownValue(): DaysOfWeekExtensibleEnum;
@doc("When set protocol false and convenient true, then the protocol method should be internal")
@route("internalProtocol")
@post
@convenientAPI(true)
@protocolAPI(false)
@convenientAPI(true, "csharp")
@protocolAPI(false, "csharp")
op internalProtocol(@body body: Thing): Thing;

@doc("When set protocol false and convenient true, the convenient method should be generated even it has the same signature as protocol one")
@route("stillConvenient")
@get
@convenientAPI(true)
@protocolAPI(false)
@convenientAPI(true, "csharp")
@protocolAPI(false, "csharp")
op stillConvenient(): void;

@route("/headAsBoolean")
@doc("head as boolean.")
@head
@convenientAPI(true)
@convenientAPI(true, "csharp")
op headAsBoolean(@path id: string): void;
10 changes: 5 additions & 5 deletions packages/http-client-csharp/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/http-client-csharp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
],
"peerDependencies": {
"@azure-tools/typespec-azure-core": ">=0.71.0 <0.72.0 || ~0.72.0-0",
"@azure-tools/typespec-client-generator-core": ">=0.71.1 <0.72.0 || ~0.72.0-0",
"@azure-tools/typespec-client-generator-core": ">=0.71.2 <0.72.0 || ~0.72.0-0",
"@typespec/compiler": "^1.15.0",
"@typespec/events": ">=0.85.0 <0.86.0 || ~0.86.0-0",
"@typespec/http": "^1.15.0",
Expand All @@ -72,7 +72,7 @@
"devDependencies": {
"@azure-tools/azure-http-specs": "0.1.0-alpha.44",
"@azure-tools/typespec-azure-core": "0.71.0",
"@azure-tools/typespec-client-generator-core": "0.71.1",
"@azure-tools/typespec-client-generator-core": "0.71.2",
"@microsoft/api-extractor": "^7.52.2",
"@types/node": "~22.12.0",
"@typespec/compiler": "1.15.0",
Expand Down
Loading
Loading