diff --git a/.gitignore b/.gitignore
index be4473eb7b..c5cc09c2a7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -193,3 +193,4 @@ docs/**/js-api/
# csharp emitter
!packages/http-client-csharp/package-lock.json
+packages/http-client-csharp/generator/artifacts/
diff --git a/eng/common/scripts/Analyze-Changes.Tests.ps1 b/eng/common/scripts/Analyze-Changes.Tests.ps1
index b38ba9ecbc..7ea65ef7ca 100644
--- a/eng/common/scripts/Analyze-Changes.Tests.ps1
+++ b/eng/common/scripts/Analyze-Changes.Tests.ps1
@@ -10,27 +10,51 @@ Describe 'Analyze-Changes' {
}
It 'Should return package variables if package specific changes are detected' {
- $variables = Get-ActiveVariables @(
+ $actual = Get-ActiveVariables @(
"packages/http-client-csharp/src/constants.ts"
)
- $variables | Should -Be 'RunCSharp'
+ $expected = @('RunCSharp')
+
+ $actual | ForEach-Object {
+ $_ | Should -BeIn $expected
+ }
}
It 'Should return RunCore if common files are changed' {
- $variables = Get-ActiveVariables @(
+ $actual = Get-ActiveVariables @(
"packages/compiler/package.json"
)
- $variables | Should -Be 'RunCore'
+ $expected = @('RunCore')
+
+ $actual | ForEach-Object {
+ $_ | Should -BeIn $expected
+ }
}
It 'Should return a combination of core and isolated packages' {
- $variables = Get-ActiveVariables @(
+ $actual = Get-ActiveVariables @(
"packages/http-client-csharp/src/constants.ts",
"packages/compiler/package.json"
)
- $variables | Should -Be 'RunCore', 'RunCSharp'
+ $expected = @('RunCore', 'RunCSharp')
+
+ $actual | ForEach-Object {
+ $_ | Should -BeIn $expected
+ }
+ }
+
+ It 'Should return RunCSharp and RunCore if .editorconfig is changed' {
+ $actual = Get-ActiveVariables @(
+ ".editorconfig"
+ )
+
+ $expected = @('RunCore', 'RunCSharp')
+
+ $actual | ForEach-Object {
+ $_ | Should -BeIn $expected
+ }
}
}
diff --git a/eng/common/scripts/Analyze-Changes.ps1 b/eng/common/scripts/Analyze-Changes.ps1
index d30ccf01ff..ae9417d653 100644
--- a/eng/common/scripts/Analyze-Changes.ps1
+++ b/eng/common/scripts/Analyze-Changes.ps1
@@ -6,12 +6,12 @@ param(
# Represents an isolated package which has its own stages in typespec - ci pipeline
class IsolatedPackage {
- [string] $Path
+ [string[]] $Paths
[string] $RunVariable
[bool] $RunValue
- IsolatedPackage([string]$path, [string]$runVariable, [bool]$runValue) {
- $this.Path = $path
+ IsolatedPackage([string[]]$paths, [string]$runVariable, [bool]$runValue) {
+ $this.Paths = $paths
$this.RunVariable = $runVariable
$this.RunValue = $runValue
}
@@ -19,10 +19,10 @@ class IsolatedPackage {
# Emitter packages in the repo
$isolatedPackages = @{
- "http-client-csharp" = [IsolatedPackage]::new("packages/http-client-csharp", "RunCSharp", $false)
- "http-client-java" = [IsolatedPackage]::new("packages/http-client-java", "RunJava", $false)
- "http-client-typescript" = [IsolatedPackage]::new("packages/http-client-typescript", "RunTypeScript", $false)
- "http-client-python" = [IsolatedPackage]::new("packages/http-client-python", "RunPython", $false)
+ "http-client-csharp" = [IsolatedPackage]::new(@("packages/http-client-csharp", ".editorconfig"), "RunCSharp", $false)
+ "http-client-java" = [IsolatedPackage]::new(@("packages/http-client-java"), "RunJava", $false)
+ "http-client-typescript" = [IsolatedPackage]::new(@("packages/http-client-typescript"), "RunTypeScript", $false)
+ "http-client-python" = [IsolatedPackage]::new(@("packages/http-client-python"), "RunPython", $false)
}
# A tree representation of a set of files
@@ -125,7 +125,12 @@ function Get-ActiveVariables($changes) {
if (-not $runIsolated) {
# set each isolated package flag
foreach ($package in $isolatedPackages.Values) {
- $package.RunValue = $root.PathExists($package.Path)
+ foreach ($path in $package.Paths) {
+ $package.RunValue = $package.RunValue -or $root.PathExists($path)
+ if ($package.RunValue) {
+ break
+ }
+ }
}
}
diff --git a/packages/http-client-csharp/readme.md b/packages/http-client-csharp/emitter/readme.md
similarity index 100%
rename from packages/http-client-csharp/readme.md
rename to packages/http-client-csharp/emitter/readme.md
diff --git a/packages/http-client-csharp/src/constants.ts b/packages/http-client-csharp/emitter/src/constants.ts
similarity index 100%
rename from packages/http-client-csharp/src/constants.ts
rename to packages/http-client-csharp/emitter/src/constants.ts
diff --git a/packages/http-client-csharp/src/emitter.ts b/packages/http-client-csharp/emitter/src/emitter.ts
similarity index 100%
rename from packages/http-client-csharp/src/emitter.ts
rename to packages/http-client-csharp/emitter/src/emitter.ts
diff --git a/packages/http-client-csharp/src/index.ts b/packages/http-client-csharp/emitter/src/index.ts
similarity index 100%
rename from packages/http-client-csharp/src/index.ts
rename to packages/http-client-csharp/emitter/src/index.ts
diff --git a/packages/http-client-csharp/src/lib/client-model-builder.ts b/packages/http-client-csharp/emitter/src/lib/client-model-builder.ts
similarity index 100%
rename from packages/http-client-csharp/src/lib/client-model-builder.ts
rename to packages/http-client-csharp/emitter/src/lib/client-model-builder.ts
diff --git a/packages/http-client-csharp/src/lib/decorators.ts b/packages/http-client-csharp/emitter/src/lib/decorators.ts
similarity index 100%
rename from packages/http-client-csharp/src/lib/decorators.ts
rename to packages/http-client-csharp/emitter/src/lib/decorators.ts
diff --git a/packages/http-client-csharp/src/lib/logger.ts b/packages/http-client-csharp/emitter/src/lib/logger.ts
similarity index 100%
rename from packages/http-client-csharp/src/lib/logger.ts
rename to packages/http-client-csharp/emitter/src/lib/logger.ts
diff --git a/packages/http-client-csharp/src/lib/model.ts b/packages/http-client-csharp/emitter/src/lib/model.ts
similarity index 100%
rename from packages/http-client-csharp/src/lib/model.ts
rename to packages/http-client-csharp/emitter/src/lib/model.ts
diff --git a/packages/http-client-csharp/src/lib/operation.ts b/packages/http-client-csharp/emitter/src/lib/operation.ts
similarity index 100%
rename from packages/http-client-csharp/src/lib/operation.ts
rename to packages/http-client-csharp/emitter/src/lib/operation.ts
diff --git a/packages/http-client-csharp/src/lib/service-authentication.ts b/packages/http-client-csharp/emitter/src/lib/service-authentication.ts
similarity index 100%
rename from packages/http-client-csharp/src/lib/service-authentication.ts
rename to packages/http-client-csharp/emitter/src/lib/service-authentication.ts
diff --git a/packages/http-client-csharp/src/lib/typespec-server.ts b/packages/http-client-csharp/emitter/src/lib/typespec-server.ts
similarity index 100%
rename from packages/http-client-csharp/src/lib/typespec-server.ts
rename to packages/http-client-csharp/emitter/src/lib/typespec-server.ts
diff --git a/packages/http-client-csharp/src/lib/utils.ts b/packages/http-client-csharp/emitter/src/lib/utils.ts
similarity index 100%
rename from packages/http-client-csharp/src/lib/utils.ts
rename to packages/http-client-csharp/emitter/src/lib/utils.ts
diff --git a/packages/http-client-csharp/src/options.ts b/packages/http-client-csharp/emitter/src/options.ts
similarity index 100%
rename from packages/http-client-csharp/src/options.ts
rename to packages/http-client-csharp/emitter/src/options.ts
diff --git a/packages/http-client-csharp/src/type/body-media-type.ts b/packages/http-client-csharp/emitter/src/type/body-media-type.ts
similarity index 100%
rename from packages/http-client-csharp/src/type/body-media-type.ts
rename to packages/http-client-csharp/emitter/src/type/body-media-type.ts
diff --git a/packages/http-client-csharp/src/type/client-kind.ts b/packages/http-client-csharp/emitter/src/type/client-kind.ts
similarity index 100%
rename from packages/http-client-csharp/src/type/client-kind.ts
rename to packages/http-client-csharp/emitter/src/type/client-kind.ts
diff --git a/packages/http-client-csharp/src/type/code-model.ts b/packages/http-client-csharp/emitter/src/type/code-model.ts
similarity index 100%
rename from packages/http-client-csharp/src/type/code-model.ts
rename to packages/http-client-csharp/emitter/src/type/code-model.ts
diff --git a/packages/http-client-csharp/src/type/collection-format.ts b/packages/http-client-csharp/emitter/src/type/collection-format.ts
similarity index 100%
rename from packages/http-client-csharp/src/type/collection-format.ts
rename to packages/http-client-csharp/emitter/src/type/collection-format.ts
diff --git a/packages/http-client-csharp/src/type/configuration.ts b/packages/http-client-csharp/emitter/src/type/configuration.ts
similarity index 100%
rename from packages/http-client-csharp/src/type/configuration.ts
rename to packages/http-client-csharp/emitter/src/type/configuration.ts
diff --git a/packages/http-client-csharp/src/type/converter.ts b/packages/http-client-csharp/emitter/src/type/converter.ts
similarity index 100%
rename from packages/http-client-csharp/src/type/converter.ts
rename to packages/http-client-csharp/emitter/src/type/converter.ts
diff --git a/packages/http-client-csharp/src/type/external-docs.ts b/packages/http-client-csharp/emitter/src/type/external-docs.ts
similarity index 100%
rename from packages/http-client-csharp/src/type/external-docs.ts
rename to packages/http-client-csharp/emitter/src/type/external-docs.ts
diff --git a/packages/http-client-csharp/src/type/formatted-type.ts b/packages/http-client-csharp/emitter/src/type/formatted-type.ts
similarity index 100%
rename from packages/http-client-csharp/src/type/formatted-type.ts
rename to packages/http-client-csharp/emitter/src/type/formatted-type.ts
diff --git a/packages/http-client-csharp/src/type/http-response-header.ts b/packages/http-client-csharp/emitter/src/type/http-response-header.ts
similarity index 100%
rename from packages/http-client-csharp/src/type/http-response-header.ts
rename to packages/http-client-csharp/emitter/src/type/http-response-header.ts
diff --git a/packages/http-client-csharp/src/type/input-api-key-auth.ts b/packages/http-client-csharp/emitter/src/type/input-api-key-auth.ts
similarity index 100%
rename from packages/http-client-csharp/src/type/input-api-key-auth.ts
rename to packages/http-client-csharp/emitter/src/type/input-api-key-auth.ts
diff --git a/packages/http-client-csharp/src/type/input-auth.ts b/packages/http-client-csharp/emitter/src/type/input-auth.ts
similarity index 100%
rename from packages/http-client-csharp/src/type/input-auth.ts
rename to packages/http-client-csharp/emitter/src/type/input-auth.ts
diff --git a/packages/http-client-csharp/src/type/input-client.ts b/packages/http-client-csharp/emitter/src/type/input-client.ts
similarity index 100%
rename from packages/http-client-csharp/src/type/input-client.ts
rename to packages/http-client-csharp/emitter/src/type/input-client.ts
diff --git a/packages/http-client-csharp/src/type/input-constant.ts b/packages/http-client-csharp/emitter/src/type/input-constant.ts
similarity index 100%
rename from packages/http-client-csharp/src/type/input-constant.ts
rename to packages/http-client-csharp/emitter/src/type/input-constant.ts
diff --git a/packages/http-client-csharp/src/type/input-enum-type-value.ts b/packages/http-client-csharp/emitter/src/type/input-enum-type-value.ts
similarity index 100%
rename from packages/http-client-csharp/src/type/input-enum-type-value.ts
rename to packages/http-client-csharp/emitter/src/type/input-enum-type-value.ts
diff --git a/packages/http-client-csharp/src/type/input-intrinsic-type-kind.ts b/packages/http-client-csharp/emitter/src/type/input-intrinsic-type-kind.ts
similarity index 100%
rename from packages/http-client-csharp/src/type/input-intrinsic-type-kind.ts
rename to packages/http-client-csharp/emitter/src/type/input-intrinsic-type-kind.ts
diff --git a/packages/http-client-csharp/src/type/input-model-property.ts b/packages/http-client-csharp/emitter/src/type/input-model-property.ts
similarity index 100%
rename from packages/http-client-csharp/src/type/input-model-property.ts
rename to packages/http-client-csharp/emitter/src/type/input-model-property.ts
diff --git a/packages/http-client-csharp/src/type/input-oauth2-auth.ts b/packages/http-client-csharp/emitter/src/type/input-oauth2-auth.ts
similarity index 100%
rename from packages/http-client-csharp/src/type/input-oauth2-auth.ts
rename to packages/http-client-csharp/emitter/src/type/input-oauth2-auth.ts
diff --git a/packages/http-client-csharp/src/type/input-operation-parameter-kind.ts b/packages/http-client-csharp/emitter/src/type/input-operation-parameter-kind.ts
similarity index 100%
rename from packages/http-client-csharp/src/type/input-operation-parameter-kind.ts
rename to packages/http-client-csharp/emitter/src/type/input-operation-parameter-kind.ts
diff --git a/packages/http-client-csharp/src/type/input-operation.ts b/packages/http-client-csharp/emitter/src/type/input-operation.ts
similarity index 100%
rename from packages/http-client-csharp/src/type/input-operation.ts
rename to packages/http-client-csharp/emitter/src/type/input-operation.ts
diff --git a/packages/http-client-csharp/src/type/input-parameter.ts b/packages/http-client-csharp/emitter/src/type/input-parameter.ts
similarity index 100%
rename from packages/http-client-csharp/src/type/input-parameter.ts
rename to packages/http-client-csharp/emitter/src/type/input-parameter.ts
diff --git a/packages/http-client-csharp/src/type/input-primitive-type-kind.ts b/packages/http-client-csharp/emitter/src/type/input-primitive-type-kind.ts
similarity index 100%
rename from packages/http-client-csharp/src/type/input-primitive-type-kind.ts
rename to packages/http-client-csharp/emitter/src/type/input-primitive-type-kind.ts
diff --git a/packages/http-client-csharp/src/type/input-type-kind.ts b/packages/http-client-csharp/emitter/src/type/input-type-kind.ts
similarity index 100%
rename from packages/http-client-csharp/src/type/input-type-kind.ts
rename to packages/http-client-csharp/emitter/src/type/input-type-kind.ts
diff --git a/packages/http-client-csharp/src/type/input-type-serialization-format.ts b/packages/http-client-csharp/emitter/src/type/input-type-serialization-format.ts
similarity index 100%
rename from packages/http-client-csharp/src/type/input-type-serialization-format.ts
rename to packages/http-client-csharp/emitter/src/type/input-type-serialization-format.ts
diff --git a/packages/http-client-csharp/src/type/input-type-value.ts b/packages/http-client-csharp/emitter/src/type/input-type-value.ts
similarity index 100%
rename from packages/http-client-csharp/src/type/input-type-value.ts
rename to packages/http-client-csharp/emitter/src/type/input-type-value.ts
diff --git a/packages/http-client-csharp/src/type/input-type.ts b/packages/http-client-csharp/emitter/src/type/input-type.ts
similarity index 100%
rename from packages/http-client-csharp/src/type/input-type.ts
rename to packages/http-client-csharp/emitter/src/type/input-type.ts
diff --git a/packages/http-client-csharp/src/type/literal-type-context.ts b/packages/http-client-csharp/emitter/src/type/literal-type-context.ts
similarity index 100%
rename from packages/http-client-csharp/src/type/literal-type-context.ts
rename to packages/http-client-csharp/emitter/src/type/literal-type-context.ts
diff --git a/packages/http-client-csharp/src/type/operation-final-state-via.ts b/packages/http-client-csharp/emitter/src/type/operation-final-state-via.ts
similarity index 100%
rename from packages/http-client-csharp/src/type/operation-final-state-via.ts
rename to packages/http-client-csharp/emitter/src/type/operation-final-state-via.ts
diff --git a/packages/http-client-csharp/src/type/operation-long-running.ts b/packages/http-client-csharp/emitter/src/type/operation-long-running.ts
similarity index 100%
rename from packages/http-client-csharp/src/type/operation-long-running.ts
rename to packages/http-client-csharp/emitter/src/type/operation-long-running.ts
diff --git a/packages/http-client-csharp/src/type/operation-paging.ts b/packages/http-client-csharp/emitter/src/type/operation-paging.ts
similarity index 100%
rename from packages/http-client-csharp/src/type/operation-paging.ts
rename to packages/http-client-csharp/emitter/src/type/operation-paging.ts
diff --git a/packages/http-client-csharp/src/type/operation-response.ts b/packages/http-client-csharp/emitter/src/type/operation-response.ts
similarity index 100%
rename from packages/http-client-csharp/src/type/operation-response.ts
rename to packages/http-client-csharp/emitter/src/type/operation-response.ts
diff --git a/packages/http-client-csharp/src/type/protocols.ts b/packages/http-client-csharp/emitter/src/type/protocols.ts
similarity index 100%
rename from packages/http-client-csharp/src/type/protocols.ts
rename to packages/http-client-csharp/emitter/src/type/protocols.ts
diff --git a/packages/http-client-csharp/src/type/request-location.ts b/packages/http-client-csharp/emitter/src/type/request-location.ts
similarity index 100%
rename from packages/http-client-csharp/src/type/request-location.ts
rename to packages/http-client-csharp/emitter/src/type/request-location.ts
diff --git a/packages/http-client-csharp/src/type/request-method.ts b/packages/http-client-csharp/emitter/src/type/request-method.ts
similarity index 100%
rename from packages/http-client-csharp/src/type/request-method.ts
rename to packages/http-client-csharp/emitter/src/type/request-method.ts
diff --git a/packages/http-client-csharp/src/type/usage.ts b/packages/http-client-csharp/emitter/src/type/usage.ts
similarity index 100%
rename from packages/http-client-csharp/src/type/usage.ts
rename to packages/http-client-csharp/emitter/src/type/usage.ts
diff --git a/packages/http-client-csharp/src/type/validation-type.ts b/packages/http-client-csharp/emitter/src/type/validation-type.ts
similarity index 100%
rename from packages/http-client-csharp/src/type/validation-type.ts
rename to packages/http-client-csharp/emitter/src/type/validation-type.ts
diff --git a/packages/http-client-csharp/test/Unit/encode.test.ts b/packages/http-client-csharp/emitter/test/Unit/encode.test.ts
similarity index 100%
rename from packages/http-client-csharp/test/Unit/encode.test.ts
rename to packages/http-client-csharp/emitter/test/Unit/encode.test.ts
diff --git a/packages/http-client-csharp/test/Unit/model-type.test.ts b/packages/http-client-csharp/emitter/test/Unit/model-type.test.ts
similarity index 100%
rename from packages/http-client-csharp/test/Unit/model-type.test.ts
rename to packages/http-client-csharp/emitter/test/Unit/model-type.test.ts
diff --git a/packages/http-client-csharp/test/Unit/operation-final-state-via.test.ts b/packages/http-client-csharp/emitter/test/Unit/operation-final-state-via.test.ts
similarity index 100%
rename from packages/http-client-csharp/test/Unit/operation-final-state-via.test.ts
rename to packages/http-client-csharp/emitter/test/Unit/operation-final-state-via.test.ts
diff --git a/packages/http-client-csharp/test/Unit/property-type.test.ts b/packages/http-client-csharp/emitter/test/Unit/property-type.test.ts
similarity index 100%
rename from packages/http-client-csharp/test/Unit/property-type.test.ts
rename to packages/http-client-csharp/emitter/test/Unit/property-type.test.ts
diff --git a/packages/http-client-csharp/test/Unit/scalar.test.ts b/packages/http-client-csharp/emitter/test/Unit/scalar.test.ts
similarity index 100%
rename from packages/http-client-csharp/test/Unit/scalar.test.ts
rename to packages/http-client-csharp/emitter/test/Unit/scalar.test.ts
diff --git a/packages/http-client-csharp/test/Unit/string-format.test.ts b/packages/http-client-csharp/emitter/test/Unit/string-format.test.ts
similarity index 100%
rename from packages/http-client-csharp/test/Unit/string-format.test.ts
rename to packages/http-client-csharp/emitter/test/Unit/string-format.test.ts
diff --git a/packages/http-client-csharp/test/Unit/usage.test.ts b/packages/http-client-csharp/emitter/test/Unit/usage.test.ts
similarity index 100%
rename from packages/http-client-csharp/test/Unit/usage.test.ts
rename to packages/http-client-csharp/emitter/test/Unit/usage.test.ts
diff --git a/packages/http-client-csharp/test/Unit/utils/test-util.ts b/packages/http-client-csharp/emitter/test/Unit/utils/test-util.ts
similarity index 100%
rename from packages/http-client-csharp/test/Unit/utils/test-util.ts
rename to packages/http-client-csharp/emitter/test/Unit/utils/test-util.ts
diff --git a/packages/http-client-csharp/tsconfig.build.json b/packages/http-client-csharp/emitter/tsconfig.build.json
similarity index 100%
rename from packages/http-client-csharp/tsconfig.build.json
rename to packages/http-client-csharp/emitter/tsconfig.build.json
diff --git a/packages/http-client-csharp/tsconfig.json b/packages/http-client-csharp/emitter/tsconfig.json
similarity index 53%
rename from packages/http-client-csharp/tsconfig.json
rename to packages/http-client-csharp/emitter/tsconfig.json
index d9d7cca1f2..ff45a592dd 100644
--- a/packages/http-client-csharp/tsconfig.json
+++ b/packages/http-client-csharp/emitter/tsconfig.json
@@ -1,5 +1,5 @@
{
- "extends": "../../tsconfig.base.json",
+ "extends": "../../../tsconfig.base.json",
"compilerOptions": {
"noEmit": true
}
diff --git a/packages/http-client-csharp/vitest.config.ts b/packages/http-client-csharp/emitter/vitest.config.ts
similarity index 63%
rename from packages/http-client-csharp/vitest.config.ts
rename to packages/http-client-csharp/emitter/vitest.config.ts
index 15eeaceb85..0e0e86fefc 100644
--- a/packages/http-client-csharp/vitest.config.ts
+++ b/packages/http-client-csharp/emitter/vitest.config.ts
@@ -1,4 +1,4 @@
import { defineConfig, mergeConfig } from "vitest/config";
-import { defaultTypeSpecVitestConfig } from "../../vitest.workspace.js";
+import { defaultTypeSpecVitestConfig } from "../../../vitest.workspace.js";
export default mergeConfig(defaultTypeSpecVitestConfig, defineConfig({}));
diff --git a/packages/http-client-csharp/eng/CodeAnalysis.ruleset b/packages/http-client-csharp/eng/CodeAnalysis.ruleset
new file mode 100644
index 0000000000..620d8b708a
--- /dev/null
+++ b/packages/http-client-csharp/eng/CodeAnalysis.ruleset
@@ -0,0 +1,217 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/http-client-csharp/eng/images/packageIcon.png b/packages/http-client-csharp/eng/images/packageIcon.png
new file mode 100644
index 0000000000..9a6227a73b
Binary files /dev/null and b/packages/http-client-csharp/eng/images/packageIcon.png differ
diff --git a/packages/http-client-csharp/eng/scripts/Build-Packages.ps1 b/packages/http-client-csharp/eng/scripts/Build-Packages.ps1
index 2a568da228..832fa5b9fe 100644
--- a/packages/http-client-csharp/eng/scripts/Build-Packages.ps1
+++ b/packages/http-client-csharp/eng/scripts/Build-Packages.ps1
@@ -34,6 +34,10 @@ if ($BuildNumber) {
Push-Location "$packageRoot"
try {
Write-Host "Working in $PWD"
+
+ # TODO this is happening 4 times until ..... gets fixed
+ Invoke-LoggedCommand "dotnet build ./generator" -GroupOutput
+
Invoke-LoggedCommand "npm run build" -GroupOutput
if ($BuildNumber) {
diff --git a/packages/http-client-csharp/eng/scripts/Generate.ps1 b/packages/http-client-csharp/eng/scripts/Generate.ps1
new file mode 100644
index 0000000000..52c1e2580c
--- /dev/null
+++ b/packages/http-client-csharp/eng/scripts/Generate.ps1
@@ -0,0 +1,13 @@
+#Requires -Version 7.0
+
+Import-Module "$PSScriptRoot\Generation.psm1" -DisableNameChecking -Force;
+
+$repoRoot = Resolve-Path (Join-Path $PSScriptRoot '..' '..' 'generator')
+$mgcArtifactRoot = Join-Path $repoRoot 'artifacts' 'bin' 'Microsoft.Generator.CSharp' 'Debug' 'net8.0'
+$clientModelTestProjectsDirectory = Join-Path $repoRoot 'Microsoft.Generator.CSharp.ClientModel.TestProjects'
+
+Invoke "dotnet build $repoRoot"
+
+$mgcPath = Join-Path $mgcArtifactRoot "Microsoft.Generator.CSharp"
+$unbrandedTypespecTestProject = Join-Path $clientModelTestProjectsDirectory "Unbranded-TypeSpec"
+Invoke "$mgcPath $unbrandedTypespecTestProject"
diff --git a/packages/http-client-csharp/eng/scripts/Generation.psm1 b/packages/http-client-csharp/eng/scripts/Generation.psm1
new file mode 100644
index 0000000000..5f69ef0534
--- /dev/null
+++ b/packages/http-client-csharp/eng/scripts/Generation.psm1
@@ -0,0 +1,22 @@
+$repoRoot = Resolve-Path (Join-Path $PSScriptRoot '..')
+
+function Invoke($command, $executePath=$repoRoot)
+{
+ Write-Host "> $command"
+ Push-Location $executePath
+ if ($IsLinux -or $IsMacOs)
+ {
+ sh -c "$command 2>&1"
+ }
+ else
+ {
+ cmd /c "$command 2>&1"
+ }
+ Pop-Location
+
+ if($LastExitCode -ne 0)
+ {
+ Write-Error "Command failed to execute: $command"
+ }
+}
+Export-ModuleMember -Function "Invoke"
diff --git a/packages/http-client-csharp/eng/scripts/Initialize-Repository.ps1 b/packages/http-client-csharp/eng/scripts/Initialize-Repository.ps1
index 259d3e2b63..5b9d64f0f3 100644
--- a/packages/http-client-csharp/eng/scripts/Initialize-Repository.ps1
+++ b/packages/http-client-csharp/eng/scripts/Initialize-Repository.ps1
@@ -17,6 +17,17 @@ try {
Remove-Item -Recurse -Force "./node_modules"
}
+ # install dotnet
+ if ($IsWindows) {
+ # download and run https://dot.net/v1/dotnet-install.ps1
+ Invoke-WebRequest 'https://dot.net/v1/dotnet-install.ps1' -OutFile 'dotnet-install.ps1'
+ ./dotnet-install.ps1 -Version '8.0.204'
+ }
+ else {
+ Invoke-WebRequest 'https://dot.net/v1/dotnet-install.sh' -OutFile 'dotnet-install.sh'
+ bash ./dotnet-install.sh --version 8.0.204
+ }
+
# install and list npm packages
if ($BuildArtifactsPath) {
diff --git a/packages/http-client-csharp/eng/scripts/Test-Packages.ps1 b/packages/http-client-csharp/eng/scripts/Test-Packages.ps1
index af82147d4f..f67755f7b7 100644
--- a/packages/http-client-csharp/eng/scripts/Test-Packages.ps1
+++ b/packages/http-client-csharp/eng/scripts/Test-Packages.ps1
@@ -15,11 +15,14 @@ Set-ConsoleEncoding
Push-Location $packageRoot
try {
if ($UnitTests) {
- # test the emitter
Push-Location "$packageRoot"
try {
+ # test the emitter
Invoke-LoggedCommand "npm run build" -GroupOutput
Invoke-LoggedCommand "npm run test" -GroupOutput
+
+ # test the generator
+ Invoke-LoggedCommand "dotnet test ./generator" -GroupOutput
}
finally {
Pop-Location
diff --git a/packages/http-client-csharp/eng/stylecop.json b/packages/http-client-csharp/eng/stylecop.json
new file mode 100644
index 0000000000..846f4b7624
--- /dev/null
+++ b/packages/http-client-csharp/eng/stylecop.json
@@ -0,0 +1,13 @@
+{
+ "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
+ "settings": {
+ "documentationRules": {
+ "copyrightText": "Copyright (c) {companyName}. All rights reserved.\nLicensed under the {licenseName} License.",
+ "companyName": "Microsoft Corporation",
+ "xmlHeader": false,
+ "variables": {
+ "licenseName": "MIT"
+ }
+ }
+ }
+}
diff --git a/packages/http-client-csharp/generator/.editorconfig b/packages/http-client-csharp/generator/.editorconfig
new file mode 100644
index 0000000000..01850bd6c4
--- /dev/null
+++ b/packages/http-client-csharp/generator/.editorconfig
@@ -0,0 +1,201 @@
+# editorconfig.org
+
+[*]
+trim_trailing_whitespace = true
+
+# Default settings:
+# A newline ending every file
+# Use 4 spaces as indentation
+[**]
+insert_final_newline = true
+indent_style = space
+indent_size = 4
+
+# C# files
+[**.cs]
+# New line preferences
+csharp_new_line_before_open_brace = all # vs-default: any
+csharp_new_line_before_else = true # vs-default: true
+csharp_new_line_before_catch = true # vs-default: true
+csharp_new_line_before_finally = true # vs-default: true
+csharp_new_line_before_members_in_object_initializers = true # vs-default: true
+csharp_new_line_before_members_in_anonymous_types = true # vs-default: true
+csharp_new_line_between_query_expression_clauses = true # vs-default: true
+
+# Indentation preferences
+csharp_indent_block_contents = true # vs-default: true
+csharp_indent_braces = false # vs-default: false
+csharp_indent_case_contents = true # vs-default: true
+csharp_indent_case_contents_when_block = true
+csharp_indent_switch_labels = true # vs-default: true
+csharp_indent_labels = one_less_than_current # vs-default: one_less_than_current
+
+# Modifier preferences
+csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
+
+# avoid this. unless absolutely necessary
+dotnet_style_qualification_for_field = false:suggestion # vs-default: false:none
+dotnet_style_qualification_for_property = false:suggestion # vs-default: false:none
+dotnet_style_qualification_for_method = false:suggestion # vs-default: false:none
+dotnet_style_qualification_for_event = false:suggestion # vs-default: false:none
+
+# only use var when it's obvious what the variable type is
+csharp_style_var_for_built_in_types = false:none # vs-default: true:none
+csharp_style_var_when_type_is_apparent = false:none # vs-default: true:none
+csharp_style_var_elsewhere = false:suggestion # vs-default: true:none
+
+# use language keywords instead of BCL types
+dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion # vs-default: true:none
+dotnet_style_predefined_type_for_member_access = true:suggestion # vs-default: true:none
+
+# name all constant fields using PascalCase
+dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
+dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
+dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
+
+dotnet_naming_symbols.constant_fields.applicable_kinds = field
+dotnet_naming_symbols.constant_fields.required_modifiers = const
+
+dotnet_naming_style.pascal_case_style.capitalization = pascal_case
+
+# static fields should have s_ prefix
+dotnet_naming_rule.static_fields_should_have_prefix.severity = suggestion
+dotnet_naming_rule.static_fields_should_have_prefix.symbols = static_fields
+dotnet_naming_rule.static_fields_should_have_prefix.style = static_prefix_style
+
+dotnet_naming_symbols.static_fields.applicable_kinds = field
+dotnet_naming_symbols.static_fields.required_modifiers = static
+dotnet_naming_symbols.static_fields.applicable_accessibilities = private, internal, private_protected
+dotnet_naming_style.static_prefix_style.required_prefix = s_
+dotnet_naming_style.static_prefix_style.capitalization = camel_case
+
+# name all properties using PascalCase
+dotnet_naming_rule.properties_should_be_pascal_case.severity = error
+dotnet_naming_rule.properties_should_be_pascal_case.symbols = properties_symbols
+dotnet_naming_rule.properties_should_be_pascal_case.style = pascal_case_style
+
+dotnet_naming_symbols.properties_symbols.applicable_kinds = property
+
+dotnet_naming_style.pascal_case_style.capitalization = pascal_case
+
+# internal and private fields should be _camelCase
+dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion
+dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields
+dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style
+
+dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
+dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal
+
+dotnet_naming_style.camel_case_underscore_style.required_prefix = _
+dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
+
+# Code style defaults
+csharp_using_directive_placement = outside_namespace:suggestion
+dotnet_sort_system_directives_first = true # vs-default: true
+csharp_prefer_braces = true:refactoring
+csharp_preserve_single_line_blocks = true # vs-default: true
+csharp_preserve_single_line_statements = false # vs-default: true
+csharp_prefer_static_local_function = true:suggestion
+csharp_prefer_simple_using_statement = false:none
+csharp_style_prefer_switch_expression = true:suggestion
+
+# Code quality
+dotnet_style_readonly_field = true:suggestion
+dotnet_code_quality_unused_parameters = non_public:suggestion
+
+# Expression-level preferences
+dotnet_style_object_initializer = true:suggestion # vs-default: true:suggestion
+dotnet_style_collection_initializer = true:suggestion # vs-default: true:suggestion
+dotnet_style_explicit_tuple_names = true:suggestion # vs-default: true:suggestion
+dotnet_style_coalesce_expression = true:suggestion # vs-default: true:suggestion
+dotnet_style_null_propagation = true:suggestion # vs-default: true:suggestion
+dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
+dotnet_style_prefer_inferred_tuple_names = true:suggestion
+dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
+dotnet_style_prefer_auto_properties = true:suggestion
+dotnet_style_prefer_conditional_expression_over_assignment = true:refactoring
+dotnet_style_prefer_conditional_expression_over_return = true:refactoring
+csharp_prefer_simple_default_expression = true:suggestion
+
+# Expression-bodied members
+csharp_style_expression_bodied_methods = false:none # vs-default: false:none
+csharp_style_expression_bodied_constructors = false:none # vs-default: false:none
+csharp_style_expression_bodied_operators = false:none # vs-default: false:none
+csharp_style_expression_bodied_properties = true:none # vs-default: true:none
+csharp_style_expression_bodied_indexers = true:none # vs-default: true:none
+csharp_style_expression_bodied_accessors = true:none # vs-default: true:none
+csharp_style_expression_bodied_lambdas = true:refactoring
+csharp_style_expression_bodied_local_functions = true:refactoring
+
+# Pattern matching
+csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion # vs-default: true:suggestion
+csharp_style_pattern_matching_over_as_with_null_check = true:suggestion # vs-default: true:suggestion
+csharp_style_inlined_variable_declaration = true:suggestion # vs-default: true:suggestion
+
+# Null checking preferences
+csharp_style_throw_expression = true:suggestion # vs-default: true:suggestion
+csharp_style_conditional_delegate_call = true:suggestion # vs-default: true:suggestion
+
+# Other features
+csharp_style_prefer_index_operator = false:none
+csharp_style_prefer_range_operator = false:none
+csharp_style_pattern_local_over_anonymous_function = false:none
+
+# Space preferences
+csharp_space_after_cast = false # vs-default: false
+csharp_space_after_colon_in_inheritance_clause = true # vs-default: true
+csharp_space_after_comma = true # vs-default: true
+csharp_space_after_dot = false # vs-default: false
+csharp_space_after_keywords_in_control_flow_statements = true # vs-default: true
+csharp_space_after_semicolon_in_for_statement = true # vs-default: true
+csharp_space_around_binary_operators = before_and_after # vs-default: before_and_after
+csharp_space_around_declaration_statements = do_not_ignore # vs-default: false
+csharp_space_before_colon_in_inheritance_clause = true # vs-default: true
+csharp_space_before_comma = false # vs-default: false
+csharp_space_before_dot = false # vs-default: false
+csharp_space_before_open_square_brackets = false # vs-default: false
+csharp_space_before_semicolon_in_for_statement = false # vs-default: false
+csharp_space_between_empty_square_brackets = false # vs-default: false
+csharp_space_between_method_call_empty_parameter_list_parentheses = false # vs-default: false
+csharp_space_between_method_call_name_and_opening_parenthesis = false # vs-default: false
+csharp_space_between_method_call_parameter_list_parentheses = false # vs-default: false
+csharp_space_between_method_declaration_empty_parameter_list_parentheses = false # vs-default: false
+csharp_space_between_method_declaration_name_and_open_parenthesis = false # vs-default: false
+csharp_space_between_method_declaration_parameter_list_parentheses = false # vs-default: false
+csharp_space_between_parentheses = false # vs-default: false
+csharp_space_between_square_brackets = false # vs-default: false
+
+# Require accessibility modifiers
+dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion # vs-default: for_non_interface_members:none
+
+# Analyzers
+dotnet_code_quality.ca1802.api_surface = private, internal
+
+# Warn about unused private fields & methods
+dotnet_diagnostic.IDE0051.severity = warning
+
+# Xml project files
+[*.{csproj,vcxproj,vcxproj.filters,proj,nativeproj,locproj}]
+indent_size = 2
+
+# Xml build files
+[*.builds]
+indent_size = 2
+
+# Xml files
+[*.{xml,stylecop,resx,ruleset}]
+indent_size = 2
+
+# Xml config files
+[*.{props,targets,config,nuspec}]
+indent_size = 2
+
+# Shell scripts
+[*.sh]
+end_of_line = lf
+[*.{cmd, bat}]
+end_of_line = crlf
+
+# Yaml files
+[*.{yml,yaml}]
+indent_size = 2
diff --git a/packages/http-client-csharp/generator/Directory.Build.props b/packages/http-client-csharp/generator/Directory.Build.props
new file mode 100644
index 0000000000..89e091b803
--- /dev/null
+++ b/packages/http-client-csharp/generator/Directory.Build.props
@@ -0,0 +1,55 @@
+
+
+ $(MSBuildThisFileDirectory)
+ $(MSBuildThisFileDirectory)../eng
+ true
+ $(MSBuildThisFileDirectory)Packages.Data.props
+ true
+
+
+
+ packageIcon.png
+ $(RepoEngPath)/images/$(PackageIcon)
+
+
+
+
+ Debug
+ AnyCPU
+ $(Platform)
+
+
+
+
+ $(RepoRoot)artifacts\
+ $(ArtifactsDir)obj\
+ $(ArtifactsDir)bin\
+ $(ArtifactsDir)packages\$(Configuration)\
+
+ $(NoWarn);NU5105
+ true
+ $(MSBuildProjectName)
+
+ $([System.IO.Path]::GetFullPath('$(ArtifactsBinDir)$(OutDirName)\'))
+ $(BaseOutputPath)$(Configuration)\
+ $(BaseOutputPath)$(PlatformName)\$(Configuration)\
+
+ $([System.IO.Path]::GetFullPath('$(ArtifactsObjDir)$(OutDirName)\'))
+ $(BaseIntermediateOutputPath)$(Configuration)\
+ $(BaseIntermediateOutputPath)$(PlatformName)\$(Configuration)\
+
+ $(ArtifactsPackagesDir)
+ $(RepoEngPath)\CodeAnalysis.ruleset
+
+
+
+ false
+ false
+ false
+ 12.0
+
+
+
diff --git a/packages/http-client-csharp/generator/Directory.Build.targets b/packages/http-client-csharp/generator/Directory.Build.targets
new file mode 100644
index 0000000000..290ad8754b
--- /dev/null
+++ b/packages/http-client-csharp/generator/Directory.Build.targets
@@ -0,0 +1,17 @@
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers
+
+
+ false
+
+
+
+
+
+
+
+
diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Microsoft.Generator.CSharp.ClientModel.TestProjects.csproj b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Microsoft.Generator.CSharp.ClientModel.TestProjects.csproj
new file mode 100644
index 0000000000..a601507255
--- /dev/null
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Microsoft.Generator.CSharp.ClientModel.TestProjects.csproj
@@ -0,0 +1,11 @@
+
+
+
+ net8.0
+ false
+ enable
+
+
+
+
+
diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/Configuration.json b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/Configuration.json
new file mode 100644
index 0000000000..c505454e1b
--- /dev/null
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/Configuration.json
@@ -0,0 +1,5 @@
+{
+ "output-folder": ".",
+ "namespace": "UnbrandedTypeSpec",
+ "library-name": "UnbrandedTypeSpec"
+}
diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/Unbranded-TypeSpec.tsp b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/Unbranded-TypeSpec.tsp
new file mode 100644
index 0000000000..56ad3aca1c
--- /dev/null
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/Unbranded-TypeSpec.tsp
@@ -0,0 +1,351 @@
+import "@typespec/rest";
+import "@typespec/http";
+import "@azure-tools/typespec-client-generator-core";
+import "@azure-tools/typespec-azure-core";
+
+@service({
+ title: "hello world",
+ version: "0.1.0",
+})
+@doc("This is a sample typespec project.")
+@server(
+ "{unbrandedTypeSpecUrl}",
+ "Endpoint Service",
+ {
+ unbrandedTypeSpecUrl: string,
+ }
+)
+@useAuth(ApiKeyAuth)
+namespace UnbrandedTypeSpec;
+
+using TypeSpec.Http;
+using Azure.ClientGenerator.Core;
+using Azure.Core;
+
+@doc("float fixed enum")
+@fixed
+enum FloatFixedEnum {
+ One: 1.1,
+ Two: 2.2,
+ Four: 4.4,
+}
+
+@doc("int fixed enum")
+@fixed
+enum IntFixedEnum {
+ One: 1,
+ Two: 2,
+ Four: 4,
+}
+
+@doc("Simple enum")
+@fixed
+enum StringFixedEnum {
+ One: "1",
+ Two: "2",
+ Four: "4",
+}
+
+@doc("Int based extensible enum")
+union IntExtensibleEnum {
+ int32,
+ One: 1,
+ Two: 2,
+ Four: 4,
+}
+
+@doc("Float based extensible enum")
+union FloatExtensibleEnum {
+ float32,
+ One: 1.0,
+ Two: 2.0,
+ Four: 4.0,
+}
+
+@doc("Extensible enum")
+union StringExtensibleEnum {
+ string,
+ One: "1",
+ Two: "2",
+ Four: "4",
+}
+
+@doc("A model with a few properties of literal types")
+model Thing {
+ @doc("name of the Thing")
+ name: string;
+
+ @doc("required Union")
+ requiredUnion: string | string[] | int32;
+
+ @doc("required literal string")
+ requiredLiteralString: "accept";
+
+ @doc("required literal int")
+ requiredLiteralInt: 123;
+
+ @doc("required literal float")
+ requiredLiteralFloat: 1.23;
+
+ @doc("required literal bool")
+ requiredLiteralBool: false;
+
+ @doc("optional literal string")
+ optionalLiteralString?: "reject";
+
+ @doc("optional literal int")
+ optionalLiteralInt?: 456;
+
+ @doc("optional literal float")
+ optionalLiteralFloat?: 4.56;
+
+ @doc("optional literal bool")
+ optionalLiteralBool?: true;
+
+ @doc("description with xml <|endoftext|>")
+ requiredBadDescription: string;
+
+ @doc("optional nullable collection")
+ optionalNullableList?: int32[] | null;
+
+ @doc("required nullable collection")
+ requiredNullableList: int32[] | null;
+}
+
+@doc("A model with a few required nullable properties")
+model ModelWithRequiredNullableProperties {
+ @doc("required nullable primitive type")
+ requiredNullablePrimitive: int32 | null;
+
+ @doc("required nullable extensible enum type")
+ requiredExtensibleEnum: StringExtensibleEnum | null;
+
+ @doc("required nullable fixed enum type")
+ requiredFixedEnum: StringFixedEnum | null;
+}
+
+@doc("this is not a friendly model but with a friendly name")
+@friendlyName("Friend")
+model NotFriend {
+ @doc("name of the NotFriend")
+ name: string;
+}
+
+@doc("this is a model with a projected name")
+@projectedName("client", "ProjectedModel")
+model ModelWithProjectedName {
+ @doc("name of the ModelWithProjectedName")
+ name: string;
+}
+
+@doc("this is a roundtrip model")
+model RoundTripModel {
+ @doc("Required string, illustrating a reference type property.")
+ requiredString: string;
+
+ @doc("Required int, illustrating a value type property.")
+ requiredInt: int32;
+
+ @doc("Required collection of enums")
+ requiredCollection: StringFixedEnum[];
+
+ @doc("Required dictionary of enums")
+ requiredDictionary: Record;
+
+ @doc("Required model")
+ requiredModel: Thing;
+
+ @doc("this is an int based extensible enum")
+ intExtensibleEnum?: IntExtensibleEnum;
+
+ @doc("this is a collection of int based extensible enum")
+ intExtensibleEnumCollection?: IntExtensibleEnum[];
+
+ @doc("this is a float based extensible enum")
+ floatExtensibleEnum?: FloatExtensibleEnum;
+
+ @doc("this is a collection of float based extensible enum")
+ floatExtensibleEnumCollection?: FloatExtensibleEnum[];
+
+ @doc("this is a float based fixed enum")
+ floatFixedEnum?: FloatFixedEnum;
+
+ @doc("this is a collection of float based fixed enum")
+ floatFixedEnumCollection?: FloatFixedEnum[];
+
+ @doc("this is a int based fixed enum")
+ intFixedEnum?: IntFixedEnum;
+
+ @doc("this is a collection of int based fixed enum")
+ intFixedEnumCollection?: IntFixedEnum[];
+
+ @doc("this is a string based fixed enum")
+ stringFixedEnum?: StringFixedEnum;
+
+ @doc("required unknown")
+ requiredUnknown: unknown;
+
+ @doc("optional unknown")
+ optionalUnknown?: unknown;
+
+ @doc("required record of unknown")
+ requiredRecordUnknown: Record;
+
+ @doc("optional record of unknown")
+ optionalRecordUnknown?: Record;
+
+ @doc("required readonly record of unknown")
+ @visibility("read")
+ readOnlyRequiredRecordUnknown: Record;
+
+ @doc("optional readonly record of unknown")
+ @visibility("read")
+ readOnlyOptionalRecordUnknown?: Record;
+
+ @doc("this is a model with required nullable properties")
+ modelWithRequiredNullable: ModelWithRequiredNullableProperties;
+}
+
+union DaysOfWeekExtensibleEnum {
+ string,
+ Monday: "Monday",
+ Tuesday: "Tuesday",
+ Wednesday: "Wednesday",
+ Thursday: "Thursday",
+ Friday: "Friday",
+ Saturday: "Saturday",
+ Sunday: "Sunday",
+}
+
+model ModelWithFormat {
+ @doc("url format")
+ @format("Uri")
+ sourceUrl: string;
+
+ @doc("uuid format")
+ @format("uuid")
+ guid: string;
+}
+
+@route("/hello")
+@doc("Return hi")
+@get
+op sayHi(
+ @header headParameter: string,
+ @query queryParameter: string,
+ @query optionalQuery?: string,
+): Thing;
+
+@route("/againHi")
+@doc("Return hi again")
+@get
+@convenientAPI(true)
+op helloAgain(
+ @header p1: string,
+ @body action: RoundTripModel,
+ @header contentType: "text/plain",
+ @path p2: string,
+): RoundTripModel;
+
+@route("/noContentType")
+@doc("Return hi again")
+@get
+@convenientAPI(false)
+op noContentType(
+ @header p1: string,
+ @body action: RoundTripModel,
+ @path p2: string,
+): RoundTripModel;
+
+@route("/demoHi")
+@doc("Return hi in demo2")
+@get
+@convenientAPI(true)
+op helloDemo2(): Thing;
+
+@route("/literal")
+@doc("Create with literal value")
+@post
+@convenientAPI(true)
+op createLiteral(@body body: Thing): Thing;
+
+@route("/helloLiteral")
+@doc("Send literal parameters")
+@get
+@convenientAPI(true)
+op helloLiteral(@header p1: "test", @path p2: 123, @query p3: true): Thing;
+
+@route("/top")
+@doc("top level method")
+@get
+@convenientAPI(true)
+op topAction(@path @format("date") action: string): Thing;
+
+@route("/top2")
+@doc("top level method2")
+@get
+@convenientAPI(false)
+op topAction2(): Thing;
+
+@route("/patch")
+@doc("top level patch")
+@patch
+@convenientAPI(true)
+op patchAction(@body body: Thing): Thing;
+
+@route("/anonymousBody")
+@doc("body parameter without body decorator")
+@post
+@convenientAPI(true)
+op anonymousBody(...Thing): Thing;
+
+@route("/friendlyName")
+@doc("Model can have its friendly name")
+@post
+@convenientAPI(true)
+op friendlyModel(...NotFriend): NotFriend;
+
+op addTimeHeader(@header("Repeatability-First-Sent") repeatabilityFirstSent?: utcDateTime): void;
+
+@route("/stringFormat")
+@doc("parameter has string format.")
+@post
+@convenientAPI(true)
+op stringFormat(@path @format("uuid") subscriptionId: string, @body body: ModelWithFormat): void;
+
+@route("/projectedName")
+@doc("Model can have its projected name")
+@post
+@convenientAPI(true)
+op projectedNameModel(...ModelWithProjectedName): ModelWithProjectedName;
+
+@route("/returnsAnonymousModel")
+@doc("return anonymous model")
+@post
+@convenientAPI(true)
+op returnsAnonymousModel(): {};
+
+@get
+@route("/unknown-value")
+@doc("get extensible enum")
+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)
+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)
+op stillConvenient(): void;
+
+@route("/headAsBoolean")
+@doc("head as boolean.")
+@head
+@convenientAPI(true)
+op headAsBoolean(@path id: string): void;
diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/UnbrandedTypeSpec.sln b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/UnbrandedTypeSpec.sln
new file mode 100644
index 0000000000..00547e30c4
--- /dev/null
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/UnbrandedTypeSpec.sln
@@ -0,0 +1,50 @@
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.29709.97
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnbrandedTypeSpec", "src\UnbrandedTypeSpec.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnbrandedTypeSpec.Tests", "tests\UnbrandedTypeSpec.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU
+ {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU
+ {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU
+ {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU
+ {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE}
+ EndGlobalSection
+EndGlobal
diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/src/Generated/Models/Friend.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/src/Generated/Models/Friend.cs
new file mode 100644
index 0000000000..ab15e63ff2
--- /dev/null
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/src/Generated/Models/Friend.cs
@@ -0,0 +1,19 @@
+//
+
+#nullable disable
+
+namespace UnbrandedTypeSpec.Models
+{
+ public partial class Friend
+ {
+ // Add Fields
+
+ // Add Constructors
+
+ // Add Properties
+
+ // Add Methods
+
+ // Add Nested Type
+ }
+}
diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/src/Generated/Models/ModelWithFormat.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/src/Generated/Models/ModelWithFormat.cs
new file mode 100644
index 0000000000..8f76547168
--- /dev/null
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/src/Generated/Models/ModelWithFormat.cs
@@ -0,0 +1,19 @@
+//
+
+#nullable disable
+
+namespace UnbrandedTypeSpec.Models
+{
+ public partial class ModelWithFormat
+ {
+ // Add Fields
+
+ // Add Constructors
+
+ // Add Properties
+
+ // Add Methods
+
+ // Add Nested Type
+ }
+}
diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/src/Generated/Models/ModelWithRequiredNullableProperties.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/src/Generated/Models/ModelWithRequiredNullableProperties.cs
new file mode 100644
index 0000000000..018763577b
--- /dev/null
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/src/Generated/Models/ModelWithRequiredNullableProperties.cs
@@ -0,0 +1,19 @@
+//
+
+#nullable disable
+
+namespace UnbrandedTypeSpec.Models
+{
+ public partial class ModelWithRequiredNullableProperties
+ {
+ // Add Fields
+
+ // Add Constructors
+
+ // Add Properties
+
+ // Add Methods
+
+ // Add Nested Type
+ }
+}
diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/src/Generated/Models/ProjectedModel.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/src/Generated/Models/ProjectedModel.cs
new file mode 100644
index 0000000000..421cb4dec6
--- /dev/null
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/src/Generated/Models/ProjectedModel.cs
@@ -0,0 +1,19 @@
+//
+
+#nullable disable
+
+namespace UnbrandedTypeSpec.Models
+{
+ public partial class ProjectedModel
+ {
+ // Add Fields
+
+ // Add Constructors
+
+ // Add Properties
+
+ // Add Methods
+
+ // Add Nested Type
+ }
+}
diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/src/Generated/Models/ReturnsAnonymousModelResponse.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/src/Generated/Models/ReturnsAnonymousModelResponse.cs
new file mode 100644
index 0000000000..803e2c6e21
--- /dev/null
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/src/Generated/Models/ReturnsAnonymousModelResponse.cs
@@ -0,0 +1,19 @@
+//
+
+#nullable disable
+
+namespace UnbrandedTypeSpec.Models
+{
+ public partial class ReturnsAnonymousModelResponse
+ {
+ // Add Fields
+
+ // Add Constructors
+
+ // Add Properties
+
+ // Add Methods
+
+ // Add Nested Type
+ }
+}
diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/src/Generated/Models/RoundTripModel.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/src/Generated/Models/RoundTripModel.cs
new file mode 100644
index 0000000000..f0a0cce2aa
--- /dev/null
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/src/Generated/Models/RoundTripModel.cs
@@ -0,0 +1,19 @@
+//
+
+#nullable disable
+
+namespace UnbrandedTypeSpec.Models
+{
+ public partial class RoundTripModel
+ {
+ // Add Fields
+
+ // Add Constructors
+
+ // Add Properties
+
+ // Add Methods
+
+ // Add Nested Type
+ }
+}
diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/src/Generated/Models/Thing.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/src/Generated/Models/Thing.cs
new file mode 100644
index 0000000000..e5fad142cb
--- /dev/null
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/src/Generated/Models/Thing.cs
@@ -0,0 +1,19 @@
+//
+
+#nullable disable
+
+namespace UnbrandedTypeSpec.Models
+{
+ public partial class Thing
+ {
+ // Add Fields
+
+ // Add Constructors
+
+ // Add Properties
+
+ // Add Methods
+
+ // Add Nested Type
+ }
+}
diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/tspCodeModel.json b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/tspCodeModel.json
new file mode 100644
index 0000000000..2d8e966996
--- /dev/null
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/tspCodeModel.json
@@ -0,0 +1,2923 @@
+{
+ "$id": "1",
+ "Name": "UnbrandedTypeSpec",
+ "Description": "This is a sample typespec project.",
+ "ApiVersions": [],
+ "Enums": [
+ {
+ "$id": "2",
+ "Kind": "Enum",
+ "Name": "Thing_requiredLiteralString",
+ "EnumValueType": "String",
+ "AllowedValues": [
+ {
+ "$id": "3",
+ "Name": "accept",
+ "Value": "accept",
+ "Description": "accept"
+ }
+ ],
+ "Namespace": "UnbrandedTypeSpec",
+ "Description": "The Thing_requiredLiteralString",
+ "IsExtensible": true,
+ "IsNullable": false,
+ "Usage": "RoundTrip"
+ },
+ {
+ "$id": "4",
+ "Kind": "Enum",
+ "Name": "Thing_requiredLiteralInt",
+ "EnumValueType": "Float32",
+ "AllowedValues": [
+ {
+ "$id": "5",
+ "Name": "123",
+ "Value": 123,
+ "Description": "123"
+ }
+ ],
+ "Namespace": "UnbrandedTypeSpec",
+ "Description": "The Thing_requiredLiteralInt",
+ "IsExtensible": true,
+ "IsNullable": false,
+ "Usage": "RoundTrip"
+ },
+ {
+ "$id": "6",
+ "Kind": "Enum",
+ "Name": "Thing_requiredLiteralFloat",
+ "EnumValueType": "Float32",
+ "AllowedValues": [
+ {
+ "$id": "7",
+ "Name": "1.23",
+ "Value": 1.23,
+ "Description": "1.23"
+ }
+ ],
+ "Namespace": "UnbrandedTypeSpec",
+ "Description": "The Thing_requiredLiteralFloat",
+ "IsExtensible": true,
+ "IsNullable": false,
+ "Usage": "RoundTrip"
+ },
+ {
+ "$id": "8",
+ "Kind": "Enum",
+ "Name": "Thing_optionalLiteralString",
+ "EnumValueType": "String",
+ "AllowedValues": [
+ {
+ "$id": "9",
+ "Name": "reject",
+ "Value": "reject",
+ "Description": "reject"
+ }
+ ],
+ "Namespace": "UnbrandedTypeSpec",
+ "Description": "The Thing_optionalLiteralString",
+ "IsExtensible": true,
+ "IsNullable": false,
+ "Usage": "RoundTrip"
+ },
+ {
+ "$id": "10",
+ "Kind": "Enum",
+ "Name": "Thing_optionalLiteralInt",
+ "EnumValueType": "Float32",
+ "AllowedValues": [
+ {
+ "$id": "11",
+ "Name": "456",
+ "Value": 456,
+ "Description": "456"
+ }
+ ],
+ "Namespace": "UnbrandedTypeSpec",
+ "Description": "The Thing_optionalLiteralInt",
+ "IsExtensible": true,
+ "IsNullable": false,
+ "Usage": "RoundTrip"
+ },
+ {
+ "$id": "12",
+ "Kind": "Enum",
+ "Name": "Thing_optionalLiteralFloat",
+ "EnumValueType": "Float32",
+ "AllowedValues": [
+ {
+ "$id": "13",
+ "Name": "4.56",
+ "Value": 4.56,
+ "Description": "4.56"
+ }
+ ],
+ "Namespace": "UnbrandedTypeSpec",
+ "Description": "The Thing_optionalLiteralFloat",
+ "IsExtensible": true,
+ "IsNullable": false,
+ "Usage": "RoundTrip"
+ },
+ {
+ "$id": "14",
+ "Kind": "Enum",
+ "Name": "StringFixedEnum",
+ "EnumValueType": "String",
+ "AllowedValues": [
+ {
+ "$id": "15",
+ "Name": "One",
+ "Value": "1"
+ },
+ {
+ "$id": "16",
+ "Name": "Two",
+ "Value": "2"
+ },
+ {
+ "$id": "17",
+ "Name": "Four",
+ "Value": "4"
+ }
+ ],
+ "Namespace": "UnbrandedTypeSpec",
+ "Description": "Simple enum",
+ "IsExtensible": false,
+ "IsNullable": true,
+ "Usage": "RoundTrip"
+ },
+ {
+ "$id": "18",
+ "Kind": "Enum",
+ "Name": "StringExtensibleEnum",
+ "EnumValueType": "string",
+ "AllowedValues": [
+ {
+ "$id": "19",
+ "Name": "One",
+ "Value": "1"
+ },
+ {
+ "$id": "20",
+ "Name": "Two",
+ "Value": "2"
+ },
+ {
+ "$id": "21",
+ "Name": "Four",
+ "Value": "4"
+ }
+ ],
+ "Namespace": "UnbrandedTypeSpec",
+ "Description": "Extensible enum",
+ "IsExtensible": true,
+ "IsNullable": true,
+ "Usage": "RoundTrip"
+ },
+ {
+ "$id": "22",
+ "Kind": "Enum",
+ "Name": "IntExtensibleEnum",
+ "EnumValueType": "int32",
+ "AllowedValues": [
+ {
+ "$id": "23",
+ "Name": "One",
+ "Value": 1
+ },
+ {
+ "$id": "24",
+ "Name": "Two",
+ "Value": 2
+ },
+ {
+ "$id": "25",
+ "Name": "Four",
+ "Value": 4
+ }
+ ],
+ "Namespace": "UnbrandedTypeSpec",
+ "Description": "Int based extensible enum",
+ "IsExtensible": true,
+ "IsNullable": false,
+ "Usage": "RoundTrip"
+ },
+ {
+ "$id": "26",
+ "Kind": "Enum",
+ "Name": "FloatExtensibleEnum",
+ "EnumValueType": "float32",
+ "AllowedValues": [
+ {
+ "$id": "27",
+ "Name": "One",
+ "Value": 1
+ },
+ {
+ "$id": "28",
+ "Name": "Two",
+ "Value": 2
+ },
+ {
+ "$id": "29",
+ "Name": "Four",
+ "Value": 4
+ }
+ ],
+ "Namespace": "UnbrandedTypeSpec",
+ "Description": "Float based extensible enum",
+ "IsExtensible": true,
+ "IsNullable": false,
+ "Usage": "RoundTrip"
+ },
+ {
+ "$id": "30",
+ "Kind": "Enum",
+ "Name": "FloatFixedEnum",
+ "EnumValueType": "Float32",
+ "AllowedValues": [
+ {
+ "$id": "31",
+ "Name": "One",
+ "Value": 1.1
+ },
+ {
+ "$id": "32",
+ "Name": "Two",
+ "Value": 2.2
+ },
+ {
+ "$id": "33",
+ "Name": "Four",
+ "Value": 4.4
+ }
+ ],
+ "Namespace": "UnbrandedTypeSpec",
+ "Description": "float fixed enum",
+ "IsExtensible": false,
+ "IsNullable": false,
+ "Usage": "RoundTrip"
+ },
+ {
+ "$id": "34",
+ "Kind": "Enum",
+ "Name": "IntFixedEnum",
+ "EnumValueType": "Float32",
+ "AllowedValues": [
+ {
+ "$id": "35",
+ "Name": "One",
+ "Value": 1
+ },
+ {
+ "$id": "36",
+ "Name": "Two",
+ "Value": 2
+ },
+ {
+ "$id": "37",
+ "Name": "Four",
+ "Value": 4
+ }
+ ],
+ "Namespace": "UnbrandedTypeSpec",
+ "Description": "int fixed enum",
+ "IsExtensible": false,
+ "IsNullable": false,
+ "Usage": "RoundTrip"
+ }
+ ],
+ "Models": [
+ {
+ "$id": "38",
+ "Kind": "Model",
+ "Name": "Thing",
+ "Namespace": "UnbrandedTypeSpec",
+ "Description": "A model with a few properties of literal types",
+ "IsNullable": false,
+ "Usage": "RoundTrip",
+ "Properties": [
+ {
+ "$id": "39",
+ "Name": "name",
+ "SerializedName": "name",
+ "Description": "name of the Thing",
+ "Type": {
+ "$id": "40",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "IsRequired": true,
+ "IsReadOnly": false
+ },
+ {
+ "$id": "41",
+ "Name": "requiredUnion",
+ "SerializedName": "requiredUnion",
+ "Description": "required Union",
+ "Type": {
+ "$id": "42",
+ "Kind": "Union",
+ "Name": "Union",
+ "UnionItemTypes": [
+ {
+ "$id": "43",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ {
+ "$id": "44",
+ "Kind": "Array",
+ "Name": "Array",
+ "ElementType": {
+ "$id": "45",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "IsNullable": false
+ },
+ {
+ "$id": "46",
+ "Kind": "Primitive",
+ "Name": "Int32",
+ "IsNullable": false
+ }
+ ],
+ "IsNullable": false
+ },
+ "IsRequired": true,
+ "IsReadOnly": false
+ },
+ {
+ "$id": "47",
+ "Name": "requiredLiteralString",
+ "SerializedName": "requiredLiteralString",
+ "Description": "required literal string",
+ "Type": {
+ "$id": "48",
+ "Kind": "Literal",
+ "Name": "Literal",
+ "LiteralValueType": {
+ "$ref": "2"
+ },
+ "Value": "accept",
+ "IsNullable": false
+ },
+ "IsRequired": true,
+ "IsReadOnly": false
+ },
+ {
+ "$id": "49",
+ "Name": "requiredLiteralInt",
+ "SerializedName": "requiredLiteralInt",
+ "Description": "required literal int",
+ "Type": {
+ "$id": "50",
+ "Kind": "Literal",
+ "Name": "Literal",
+ "LiteralValueType": {
+ "$ref": "4"
+ },
+ "Value": 123,
+ "IsNullable": false
+ },
+ "IsRequired": true,
+ "IsReadOnly": false
+ },
+ {
+ "$id": "51",
+ "Name": "requiredLiteralFloat",
+ "SerializedName": "requiredLiteralFloat",
+ "Description": "required literal float",
+ "Type": {
+ "$id": "52",
+ "Kind": "Literal",
+ "Name": "Literal",
+ "LiteralValueType": {
+ "$ref": "6"
+ },
+ "Value": 1.23,
+ "IsNullable": false
+ },
+ "IsRequired": true,
+ "IsReadOnly": false
+ },
+ {
+ "$id": "53",
+ "Name": "requiredLiteralBool",
+ "SerializedName": "requiredLiteralBool",
+ "Description": "required literal bool",
+ "Type": {
+ "$id": "54",
+ "Kind": "Literal",
+ "Name": "Literal",
+ "LiteralValueType": {
+ "$id": "55",
+ "Kind": "Primitive",
+ "Name": "Boolean",
+ "IsNullable": false
+ },
+ "Value": false,
+ "IsNullable": false
+ },
+ "IsRequired": true,
+ "IsReadOnly": false
+ },
+ {
+ "$id": "56",
+ "Name": "optionalLiteralString",
+ "SerializedName": "optionalLiteralString",
+ "Description": "optional literal string",
+ "Type": {
+ "$id": "57",
+ "Kind": "Literal",
+ "Name": "Literal",
+ "LiteralValueType": {
+ "$ref": "8"
+ },
+ "Value": "reject",
+ "IsNullable": false
+ },
+ "IsRequired": false,
+ "IsReadOnly": false
+ },
+ {
+ "$id": "58",
+ "Name": "optionalLiteralInt",
+ "SerializedName": "optionalLiteralInt",
+ "Description": "optional literal int",
+ "Type": {
+ "$id": "59",
+ "Kind": "Literal",
+ "Name": "Literal",
+ "LiteralValueType": {
+ "$ref": "10"
+ },
+ "Value": 456,
+ "IsNullable": false
+ },
+ "IsRequired": false,
+ "IsReadOnly": false
+ },
+ {
+ "$id": "60",
+ "Name": "optionalLiteralFloat",
+ "SerializedName": "optionalLiteralFloat",
+ "Description": "optional literal float",
+ "Type": {
+ "$id": "61",
+ "Kind": "Literal",
+ "Name": "Literal",
+ "LiteralValueType": {
+ "$ref": "12"
+ },
+ "Value": 4.56,
+ "IsNullable": false
+ },
+ "IsRequired": false,
+ "IsReadOnly": false
+ },
+ {
+ "$id": "62",
+ "Name": "optionalLiteralBool",
+ "SerializedName": "optionalLiteralBool",
+ "Description": "optional literal bool",
+ "Type": {
+ "$id": "63",
+ "Kind": "Literal",
+ "Name": "Literal",
+ "LiteralValueType": {
+ "$id": "64",
+ "Kind": "Primitive",
+ "Name": "Boolean",
+ "IsNullable": false
+ },
+ "Value": true,
+ "IsNullable": false
+ },
+ "IsRequired": false,
+ "IsReadOnly": false
+ },
+ {
+ "$id": "65",
+ "Name": "requiredBadDescription",
+ "SerializedName": "requiredBadDescription",
+ "Description": "description with xml <|endoftext|>",
+ "Type": {
+ "$id": "66",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "IsRequired": true,
+ "IsReadOnly": false
+ },
+ {
+ "$id": "67",
+ "Name": "optionalNullableList",
+ "SerializedName": "optionalNullableList",
+ "Description": "optional nullable collection",
+ "Type": {
+ "$id": "68",
+ "Kind": "Array",
+ "Name": "Array",
+ "ElementType": {
+ "$id": "69",
+ "Kind": "Primitive",
+ "Name": "Int32",
+ "IsNullable": false
+ },
+ "IsNullable": true
+ },
+ "IsRequired": false,
+ "IsReadOnly": false
+ },
+ {
+ "$id": "70",
+ "Name": "requiredNullableList",
+ "SerializedName": "requiredNullableList",
+ "Description": "required nullable collection",
+ "Type": {
+ "$id": "71",
+ "Kind": "Array",
+ "Name": "Array",
+ "ElementType": {
+ "$id": "72",
+ "Kind": "Primitive",
+ "Name": "Int32",
+ "IsNullable": false
+ },
+ "IsNullable": true
+ },
+ "IsRequired": true,
+ "IsReadOnly": false
+ }
+ ]
+ },
+ {
+ "$id": "73",
+ "Kind": "Model",
+ "Name": "RoundTripModel",
+ "Namespace": "UnbrandedTypeSpec",
+ "Description": "this is a roundtrip model",
+ "IsNullable": false,
+ "Usage": "RoundTrip",
+ "Properties": [
+ {
+ "$id": "74",
+ "Name": "requiredString",
+ "SerializedName": "requiredString",
+ "Description": "Required string, illustrating a reference type property.",
+ "Type": {
+ "$id": "75",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "IsRequired": true,
+ "IsReadOnly": false
+ },
+ {
+ "$id": "76",
+ "Name": "requiredInt",
+ "SerializedName": "requiredInt",
+ "Description": "Required int, illustrating a value type property.",
+ "Type": {
+ "$id": "77",
+ "Kind": "Primitive",
+ "Name": "Int32",
+ "IsNullable": false
+ },
+ "IsRequired": true,
+ "IsReadOnly": false
+ },
+ {
+ "$id": "78",
+ "Name": "requiredCollection",
+ "SerializedName": "requiredCollection",
+ "Description": "Required collection of enums",
+ "Type": {
+ "$id": "79",
+ "Kind": "Array",
+ "Name": "Array",
+ "ElementType": {
+ "$ref": "14"
+ },
+ "IsNullable": false
+ },
+ "IsRequired": true,
+ "IsReadOnly": false
+ },
+ {
+ "$id": "80",
+ "Name": "requiredDictionary",
+ "SerializedName": "requiredDictionary",
+ "Description": "Required dictionary of enums",
+ "Type": {
+ "$id": "81",
+ "Kind": "Dictionary",
+ "Name": "Dictionary",
+ "KeyType": {
+ "$id": "82",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "ValueType": {
+ "$ref": "18"
+ },
+ "IsNullable": false
+ },
+ "IsRequired": true,
+ "IsReadOnly": false
+ },
+ {
+ "$id": "83",
+ "Name": "requiredModel",
+ "SerializedName": "requiredModel",
+ "Description": "Required model",
+ "Type": {
+ "$ref": "38"
+ },
+ "IsRequired": true,
+ "IsReadOnly": false
+ },
+ {
+ "$id": "84",
+ "Name": "intExtensibleEnum",
+ "SerializedName": "intExtensibleEnum",
+ "Description": "this is an int based extensible enum",
+ "Type": {
+ "$ref": "22"
+ },
+ "IsRequired": false,
+ "IsReadOnly": false
+ },
+ {
+ "$id": "85",
+ "Name": "intExtensibleEnumCollection",
+ "SerializedName": "intExtensibleEnumCollection",
+ "Description": "this is a collection of int based extensible enum",
+ "Type": {
+ "$id": "86",
+ "Kind": "Array",
+ "Name": "Array",
+ "ElementType": {
+ "$ref": "22"
+ },
+ "IsNullable": false
+ },
+ "IsRequired": false,
+ "IsReadOnly": false
+ },
+ {
+ "$id": "87",
+ "Name": "floatExtensibleEnum",
+ "SerializedName": "floatExtensibleEnum",
+ "Description": "this is a float based extensible enum",
+ "Type": {
+ "$ref": "26"
+ },
+ "IsRequired": false,
+ "IsReadOnly": false
+ },
+ {
+ "$id": "88",
+ "Name": "floatExtensibleEnumCollection",
+ "SerializedName": "floatExtensibleEnumCollection",
+ "Description": "this is a collection of float based extensible enum",
+ "Type": {
+ "$id": "89",
+ "Kind": "Array",
+ "Name": "Array",
+ "ElementType": {
+ "$ref": "26"
+ },
+ "IsNullable": false
+ },
+ "IsRequired": false,
+ "IsReadOnly": false
+ },
+ {
+ "$id": "90",
+ "Name": "floatFixedEnum",
+ "SerializedName": "floatFixedEnum",
+ "Description": "this is a float based fixed enum",
+ "Type": {
+ "$ref": "30"
+ },
+ "IsRequired": false,
+ "IsReadOnly": false
+ },
+ {
+ "$id": "91",
+ "Name": "floatFixedEnumCollection",
+ "SerializedName": "floatFixedEnumCollection",
+ "Description": "this is a collection of float based fixed enum",
+ "Type": {
+ "$id": "92",
+ "Kind": "Array",
+ "Name": "Array",
+ "ElementType": {
+ "$ref": "30"
+ },
+ "IsNullable": false
+ },
+ "IsRequired": false,
+ "IsReadOnly": false
+ },
+ {
+ "$id": "93",
+ "Name": "intFixedEnum",
+ "SerializedName": "intFixedEnum",
+ "Description": "this is a int based fixed enum",
+ "Type": {
+ "$ref": "34"
+ },
+ "IsRequired": false,
+ "IsReadOnly": false
+ },
+ {
+ "$id": "94",
+ "Name": "intFixedEnumCollection",
+ "SerializedName": "intFixedEnumCollection",
+ "Description": "this is a collection of int based fixed enum",
+ "Type": {
+ "$id": "95",
+ "Kind": "Array",
+ "Name": "Array",
+ "ElementType": {
+ "$ref": "34"
+ },
+ "IsNullable": false
+ },
+ "IsRequired": false,
+ "IsReadOnly": false
+ },
+ {
+ "$id": "96",
+ "Name": "stringFixedEnum",
+ "SerializedName": "stringFixedEnum",
+ "Description": "this is a string based fixed enum",
+ "Type": {
+ "$ref": "14"
+ },
+ "IsRequired": false,
+ "IsReadOnly": false
+ },
+ {
+ "$id": "97",
+ "Name": "requiredUnknown",
+ "SerializedName": "requiredUnknown",
+ "Description": "required unknown",
+ "Type": {
+ "$id": "98",
+ "Kind": "Intrinsic",
+ "Name": "unknown",
+ "IsNullable": false
+ },
+ "IsRequired": true,
+ "IsReadOnly": false
+ },
+ {
+ "$id": "99",
+ "Name": "optionalUnknown",
+ "SerializedName": "optionalUnknown",
+ "Description": "optional unknown",
+ "Type": {
+ "$id": "100",
+ "Kind": "Intrinsic",
+ "Name": "unknown",
+ "IsNullable": false
+ },
+ "IsRequired": false,
+ "IsReadOnly": false
+ },
+ {
+ "$id": "101",
+ "Name": "requiredRecordUnknown",
+ "SerializedName": "requiredRecordUnknown",
+ "Description": "required record of unknown",
+ "Type": {
+ "$id": "102",
+ "Kind": "Dictionary",
+ "Name": "Dictionary",
+ "KeyType": {
+ "$id": "103",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "ValueType": {
+ "$id": "104",
+ "Kind": "Intrinsic",
+ "Name": "unknown",
+ "IsNullable": false
+ },
+ "IsNullable": false
+ },
+ "IsRequired": true,
+ "IsReadOnly": false
+ },
+ {
+ "$id": "105",
+ "Name": "optionalRecordUnknown",
+ "SerializedName": "optionalRecordUnknown",
+ "Description": "optional record of unknown",
+ "Type": {
+ "$id": "106",
+ "Kind": "Dictionary",
+ "Name": "Dictionary",
+ "KeyType": {
+ "$id": "107",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "ValueType": {
+ "$id": "108",
+ "Kind": "Intrinsic",
+ "Name": "unknown",
+ "IsNullable": false
+ },
+ "IsNullable": false
+ },
+ "IsRequired": false,
+ "IsReadOnly": false
+ },
+ {
+ "$id": "109",
+ "Name": "readOnlyRequiredRecordUnknown",
+ "SerializedName": "readOnlyRequiredRecordUnknown",
+ "Description": "required readonly record of unknown",
+ "Type": {
+ "$id": "110",
+ "Kind": "Dictionary",
+ "Name": "Dictionary",
+ "KeyType": {
+ "$id": "111",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "ValueType": {
+ "$id": "112",
+ "Kind": "Intrinsic",
+ "Name": "unknown",
+ "IsNullable": false
+ },
+ "IsNullable": false
+ },
+ "IsRequired": true,
+ "IsReadOnly": true
+ },
+ {
+ "$id": "113",
+ "Name": "readOnlyOptionalRecordUnknown",
+ "SerializedName": "readOnlyOptionalRecordUnknown",
+ "Description": "optional readonly record of unknown",
+ "Type": {
+ "$id": "114",
+ "Kind": "Dictionary",
+ "Name": "Dictionary",
+ "KeyType": {
+ "$id": "115",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "ValueType": {
+ "$id": "116",
+ "Kind": "Intrinsic",
+ "Name": "unknown",
+ "IsNullable": false
+ },
+ "IsNullable": false
+ },
+ "IsRequired": false,
+ "IsReadOnly": true
+ },
+ {
+ "$id": "117",
+ "Name": "modelWithRequiredNullable",
+ "SerializedName": "modelWithRequiredNullable",
+ "Description": "this is a model with required nullable properties",
+ "Type": {
+ "$id": "118",
+ "Kind": "Model",
+ "Name": "ModelWithRequiredNullableProperties",
+ "Namespace": "UnbrandedTypeSpec",
+ "Description": "A model with a few required nullable properties",
+ "IsNullable": false,
+ "Usage": "RoundTrip",
+ "Properties": [
+ {
+ "$id": "119",
+ "Name": "requiredNullablePrimitive",
+ "SerializedName": "requiredNullablePrimitive",
+ "Description": "required nullable primitive type",
+ "Type": {
+ "$id": "120",
+ "Kind": "Primitive",
+ "Name": "Int32",
+ "IsNullable": true
+ },
+ "IsRequired": true,
+ "IsReadOnly": false
+ },
+ {
+ "$id": "121",
+ "Name": "requiredExtensibleEnum",
+ "SerializedName": "requiredExtensibleEnum",
+ "Description": "required nullable extensible enum type",
+ "Type": {
+ "$ref": "18"
+ },
+ "IsRequired": true,
+ "IsReadOnly": false
+ },
+ {
+ "$id": "122",
+ "Name": "requiredFixedEnum",
+ "SerializedName": "requiredFixedEnum",
+ "Description": "required nullable fixed enum type",
+ "Type": {
+ "$ref": "14"
+ },
+ "IsRequired": true,
+ "IsReadOnly": false
+ }
+ ]
+ },
+ "IsRequired": true,
+ "IsReadOnly": false
+ }
+ ]
+ },
+ {
+ "$ref": "118"
+ },
+ {
+ "$id": "123",
+ "Kind": "Model",
+ "Name": "Friend",
+ "Namespace": "UnbrandedTypeSpec",
+ "Description": "this is not a friendly model but with a friendly name",
+ "IsNullable": false,
+ "Usage": "RoundTrip",
+ "Properties": [
+ {
+ "$id": "124",
+ "Name": "name",
+ "SerializedName": "name",
+ "Description": "name of the NotFriend",
+ "Type": {
+ "$id": "125",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "IsRequired": true,
+ "IsReadOnly": false
+ }
+ ]
+ },
+ {
+ "$id": "126",
+ "Kind": "Model",
+ "Name": "ModelWithFormat",
+ "Namespace": "UnbrandedTypeSpec",
+ "IsNullable": false,
+ "Usage": "Input",
+ "Properties": [
+ {
+ "$id": "127",
+ "Name": "sourceUrl",
+ "SerializedName": "sourceUrl",
+ "Description": "url format",
+ "Type": {
+ "$id": "128",
+ "Kind": "Primitive",
+ "Name": "Uri",
+ "IsNullable": false
+ },
+ "IsRequired": true,
+ "IsReadOnly": false
+ },
+ {
+ "$id": "129",
+ "Name": "guid",
+ "SerializedName": "guid",
+ "Description": "uuid format",
+ "Type": {
+ "$id": "130",
+ "Kind": "Primitive",
+ "Name": "Guid",
+ "IsNullable": false
+ },
+ "IsRequired": true,
+ "IsReadOnly": false
+ }
+ ]
+ },
+ {
+ "$id": "131",
+ "Kind": "Model",
+ "Name": "ProjectedModel",
+ "Namespace": "UnbrandedTypeSpec",
+ "Description": "this is a model with a projected name",
+ "IsNullable": false,
+ "Usage": "RoundTrip",
+ "Properties": [
+ {
+ "$id": "132",
+ "Name": "name",
+ "SerializedName": "name",
+ "Description": "name of the ModelWithProjectedName",
+ "Type": {
+ "$id": "133",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "IsRequired": true,
+ "IsReadOnly": false
+ }
+ ]
+ },
+ {
+ "$id": "134",
+ "Kind": "Model",
+ "Name": "ReturnsAnonymousModelResponse",
+ "Namespace": "UnbrandedTypeSpec",
+ "IsNullable": false,
+ "Usage": "Output",
+ "Properties": []
+ }
+ ],
+ "Clients": [
+ {
+ "$id": "135",
+ "Name": "UnbrandedTypeSpecClient",
+ "Description": "This is a sample typespec project.",
+ "Operations": [
+ {
+ "$id": "136",
+ "Name": "sayHi",
+ "ResourceName": "UnbrandedTypeSpec",
+ "Description": "Return hi",
+ "Parameters": [
+ {
+ "$id": "137",
+ "Name": "unbrandedTypeSpecUrl",
+ "NameInRequest": "unbrandedTypeSpecUrl",
+ "Type": {
+ "$id": "138",
+ "Kind": "Primitive",
+ "Name": "Uri",
+ "IsNullable": false
+ },
+ "Location": "Uri",
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsRequired": true,
+ "IsEndpoint": true,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Client"
+ },
+ {
+ "$id": "139",
+ "Name": "headParameter",
+ "NameInRequest": "head-parameter",
+ "Type": {
+ "$id": "140",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Location": "Header",
+ "IsRequired": true,
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Method"
+ },
+ {
+ "$id": "141",
+ "Name": "queryParameter",
+ "NameInRequest": "queryParameter",
+ "Type": {
+ "$id": "142",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Location": "Query",
+ "IsRequired": true,
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Method"
+ },
+ {
+ "$id": "143",
+ "Name": "optionalQuery",
+ "NameInRequest": "optionalQuery",
+ "Type": {
+ "$id": "144",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Location": "Query",
+ "IsRequired": false,
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Method"
+ },
+ {
+ "$id": "145",
+ "Name": "accept",
+ "NameInRequest": "Accept",
+ "Type": {
+ "$id": "146",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Location": "Header",
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsRequired": true,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Constant",
+ "DefaultValue": {
+ "$id": "147",
+ "Type": {
+ "$ref": "146"
+ },
+ "Value": "application/json"
+ }
+ }
+ ],
+ "Responses": [
+ {
+ "$id": "148",
+ "StatusCodes": [200],
+ "BodyType": {
+ "$ref": "38"
+ },
+ "BodyMediaType": "Json",
+ "Headers": [],
+ "IsErrorResponse": false,
+ "ContentTypes": ["application/json"]
+ }
+ ],
+ "HttpMethod": "GET",
+ "RequestBodyMediaType": "None",
+ "Uri": "{unbrandedTypeSpecUrl}",
+ "Path": "/hello",
+ "BufferResponse": true,
+ "GenerateProtocolMethod": true,
+ "GenerateConvenienceMethod": false
+ },
+ {
+ "$id": "149",
+ "Name": "helloAgain",
+ "ResourceName": "UnbrandedTypeSpec",
+ "Description": "Return hi again",
+ "Parameters": [
+ {
+ "$ref": "137"
+ },
+ {
+ "$id": "150",
+ "Name": "p1",
+ "NameInRequest": "p1",
+ "Type": {
+ "$id": "151",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Location": "Header",
+ "IsRequired": true,
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Method"
+ },
+ {
+ "$id": "152",
+ "Name": "contentType",
+ "NameInRequest": "content-type",
+ "Type": {
+ "$id": "153",
+ "Kind": "Literal",
+ "Name": "Literal",
+ "LiteralValueType": {
+ "$id": "154",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Value": "text/plain",
+ "IsNullable": false
+ },
+ "Location": "Header",
+ "DefaultValue": {
+ "$id": "155",
+ "Type": {
+ "$ref": "153"
+ },
+ "Value": "text/plain"
+ },
+ "IsRequired": true,
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": true,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Constant"
+ },
+ {
+ "$id": "156",
+ "Name": "p2",
+ "NameInRequest": "p2",
+ "Type": {
+ "$id": "157",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Location": "Path",
+ "IsRequired": true,
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Method"
+ },
+ {
+ "$id": "158",
+ "Name": "action",
+ "NameInRequest": "action",
+ "Type": {
+ "$ref": "73"
+ },
+ "Location": "Body",
+ "IsRequired": true,
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Method"
+ },
+ {
+ "$id": "159",
+ "Name": "accept",
+ "NameInRequest": "Accept",
+ "Type": {
+ "$id": "160",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Location": "Header",
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsRequired": true,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Constant",
+ "DefaultValue": {
+ "$id": "161",
+ "Type": {
+ "$ref": "160"
+ },
+ "Value": "application/json"
+ }
+ }
+ ],
+ "Responses": [
+ {
+ "$id": "162",
+ "StatusCodes": [200],
+ "BodyType": {
+ "$ref": "73"
+ },
+ "BodyMediaType": "Json",
+ "Headers": [],
+ "IsErrorResponse": false,
+ "ContentTypes": ["application/json"]
+ }
+ ],
+ "HttpMethod": "GET",
+ "RequestBodyMediaType": "Json",
+ "Uri": "{unbrandedTypeSpecUrl}",
+ "Path": "/againHi/{p2}",
+ "RequestMediaTypes": ["text/plain"],
+ "BufferResponse": true,
+ "GenerateProtocolMethod": true,
+ "GenerateConvenienceMethod": true
+ },
+ {
+ "$id": "163",
+ "Name": "noContentType",
+ "ResourceName": "UnbrandedTypeSpec",
+ "Description": "Return hi again",
+ "Parameters": [
+ {
+ "$ref": "137"
+ },
+ {
+ "$id": "164",
+ "Name": "p1",
+ "NameInRequest": "p1",
+ "Type": {
+ "$id": "165",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Location": "Header",
+ "IsRequired": true,
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Method"
+ },
+ {
+ "$id": "166",
+ "Name": "p2",
+ "NameInRequest": "p2",
+ "Type": {
+ "$id": "167",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Location": "Path",
+ "IsRequired": true,
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Method"
+ },
+ {
+ "$id": "168",
+ "Name": "action",
+ "NameInRequest": "action",
+ "Type": {
+ "$ref": "73"
+ },
+ "Location": "Body",
+ "IsRequired": true,
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Method"
+ },
+ {
+ "$id": "169",
+ "Name": "accept",
+ "NameInRequest": "Accept",
+ "Type": {
+ "$id": "170",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Location": "Header",
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsRequired": true,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Constant",
+ "DefaultValue": {
+ "$id": "171",
+ "Type": {
+ "$ref": "170"
+ },
+ "Value": "application/json"
+ }
+ },
+ {
+ "$id": "172",
+ "Name": "contentType",
+ "NameInRequest": "Content-Type",
+ "Type": {
+ "$id": "173",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Location": "Header",
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": true,
+ "IsRequired": true,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Constant",
+ "DefaultValue": {
+ "$id": "174",
+ "Type": {
+ "$ref": "173"
+ },
+ "Value": "application/json"
+ }
+ }
+ ],
+ "Responses": [
+ {
+ "$id": "175",
+ "StatusCodes": [200],
+ "BodyType": {
+ "$ref": "73"
+ },
+ "BodyMediaType": "Json",
+ "Headers": [],
+ "IsErrorResponse": false,
+ "ContentTypes": ["application/json"]
+ }
+ ],
+ "HttpMethod": "GET",
+ "RequestBodyMediaType": "Json",
+ "Uri": "{unbrandedTypeSpecUrl}",
+ "Path": "/noContentType/{p2}",
+ "RequestMediaTypes": ["application/json"],
+ "BufferResponse": true,
+ "GenerateProtocolMethod": true,
+ "GenerateConvenienceMethod": false
+ },
+ {
+ "$id": "176",
+ "Name": "helloDemo2",
+ "ResourceName": "UnbrandedTypeSpec",
+ "Description": "Return hi in demo2",
+ "Parameters": [
+ {
+ "$ref": "137"
+ },
+ {
+ "$id": "177",
+ "Name": "accept",
+ "NameInRequest": "Accept",
+ "Type": {
+ "$id": "178",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Location": "Header",
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsRequired": true,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Constant",
+ "DefaultValue": {
+ "$id": "179",
+ "Type": {
+ "$ref": "178"
+ },
+ "Value": "application/json"
+ }
+ }
+ ],
+ "Responses": [
+ {
+ "$id": "180",
+ "StatusCodes": [200],
+ "BodyType": {
+ "$ref": "38"
+ },
+ "BodyMediaType": "Json",
+ "Headers": [],
+ "IsErrorResponse": false,
+ "ContentTypes": ["application/json"]
+ }
+ ],
+ "HttpMethod": "GET",
+ "RequestBodyMediaType": "None",
+ "Uri": "{unbrandedTypeSpecUrl}",
+ "Path": "/demoHi",
+ "BufferResponse": true,
+ "GenerateProtocolMethod": true,
+ "GenerateConvenienceMethod": true
+ },
+ {
+ "$id": "181",
+ "Name": "createLiteral",
+ "ResourceName": "UnbrandedTypeSpec",
+ "Description": "Create with literal value",
+ "Parameters": [
+ {
+ "$ref": "137"
+ },
+ {
+ "$id": "182",
+ "Name": "body",
+ "NameInRequest": "body",
+ "Type": {
+ "$ref": "38"
+ },
+ "Location": "Body",
+ "IsRequired": true,
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Method"
+ },
+ {
+ "$id": "183",
+ "Name": "accept",
+ "NameInRequest": "Accept",
+ "Type": {
+ "$id": "184",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Location": "Header",
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsRequired": true,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Constant",
+ "DefaultValue": {
+ "$id": "185",
+ "Type": {
+ "$ref": "184"
+ },
+ "Value": "application/json"
+ }
+ },
+ {
+ "$id": "186",
+ "Name": "contentType",
+ "NameInRequest": "Content-Type",
+ "Type": {
+ "$id": "187",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Location": "Header",
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": true,
+ "IsRequired": true,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Constant",
+ "DefaultValue": {
+ "$id": "188",
+ "Type": {
+ "$ref": "187"
+ },
+ "Value": "application/json"
+ }
+ }
+ ],
+ "Responses": [
+ {
+ "$id": "189",
+ "StatusCodes": [200],
+ "BodyType": {
+ "$ref": "38"
+ },
+ "BodyMediaType": "Json",
+ "Headers": [],
+ "IsErrorResponse": false,
+ "ContentTypes": ["application/json"]
+ }
+ ],
+ "HttpMethod": "POST",
+ "RequestBodyMediaType": "Json",
+ "Uri": "{unbrandedTypeSpecUrl}",
+ "Path": "/literal",
+ "RequestMediaTypes": ["application/json"],
+ "BufferResponse": true,
+ "GenerateProtocolMethod": true,
+ "GenerateConvenienceMethod": true
+ },
+ {
+ "$id": "190",
+ "Name": "helloLiteral",
+ "ResourceName": "UnbrandedTypeSpec",
+ "Description": "Send literal parameters",
+ "Parameters": [
+ {
+ "$ref": "137"
+ },
+ {
+ "$id": "191",
+ "Name": "p1",
+ "NameInRequest": "p1",
+ "Type": {
+ "$id": "192",
+ "Kind": "Literal",
+ "Name": "Literal",
+ "LiteralValueType": {
+ "$id": "193",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Value": "test",
+ "IsNullable": false
+ },
+ "Location": "Header",
+ "DefaultValue": {
+ "$id": "194",
+ "Type": {
+ "$ref": "192"
+ },
+ "Value": "test"
+ },
+ "IsRequired": true,
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Constant"
+ },
+ {
+ "$id": "195",
+ "Name": "p2",
+ "NameInRequest": "p2",
+ "Type": {
+ "$id": "196",
+ "Kind": "Literal",
+ "Name": "Literal",
+ "LiteralValueType": {
+ "$id": "197",
+ "Kind": "Primitive",
+ "Name": "Int32",
+ "IsNullable": false
+ },
+ "Value": 123,
+ "IsNullable": false
+ },
+ "Location": "Path",
+ "DefaultValue": {
+ "$id": "198",
+ "Type": {
+ "$ref": "196"
+ },
+ "Value": 123
+ },
+ "IsRequired": true,
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Constant"
+ },
+ {
+ "$id": "199",
+ "Name": "p3",
+ "NameInRequest": "p3",
+ "Type": {
+ "$id": "200",
+ "Kind": "Literal",
+ "Name": "Literal",
+ "LiteralValueType": {
+ "$id": "201",
+ "Kind": "Primitive",
+ "Name": "Boolean",
+ "IsNullable": false
+ },
+ "Value": true,
+ "IsNullable": false
+ },
+ "Location": "Query",
+ "DefaultValue": {
+ "$id": "202",
+ "Type": {
+ "$ref": "200"
+ },
+ "Value": true
+ },
+ "IsRequired": true,
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Constant"
+ },
+ {
+ "$id": "203",
+ "Name": "accept",
+ "NameInRequest": "Accept",
+ "Type": {
+ "$id": "204",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Location": "Header",
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsRequired": true,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Constant",
+ "DefaultValue": {
+ "$id": "205",
+ "Type": {
+ "$ref": "204"
+ },
+ "Value": "application/json"
+ }
+ }
+ ],
+ "Responses": [
+ {
+ "$id": "206",
+ "StatusCodes": [200],
+ "BodyType": {
+ "$ref": "38"
+ },
+ "BodyMediaType": "Json",
+ "Headers": [],
+ "IsErrorResponse": false,
+ "ContentTypes": ["application/json"]
+ }
+ ],
+ "HttpMethod": "GET",
+ "RequestBodyMediaType": "None",
+ "Uri": "{unbrandedTypeSpecUrl}",
+ "Path": "/helloLiteral/{p2}",
+ "BufferResponse": true,
+ "GenerateProtocolMethod": true,
+ "GenerateConvenienceMethod": true
+ },
+ {
+ "$id": "207",
+ "Name": "topAction",
+ "ResourceName": "UnbrandedTypeSpec",
+ "Description": "top level method",
+ "Parameters": [
+ {
+ "$ref": "137"
+ },
+ {
+ "$id": "208",
+ "Name": "action",
+ "NameInRequest": "action",
+ "Type": {
+ "$id": "209",
+ "Kind": "Primitive",
+ "Name": "DateTime",
+ "IsNullable": false
+ },
+ "Location": "Path",
+ "IsRequired": true,
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Method"
+ },
+ {
+ "$id": "210",
+ "Name": "accept",
+ "NameInRequest": "Accept",
+ "Type": {
+ "$id": "211",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Location": "Header",
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsRequired": true,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Constant",
+ "DefaultValue": {
+ "$id": "212",
+ "Type": {
+ "$ref": "211"
+ },
+ "Value": "application/json"
+ }
+ }
+ ],
+ "Responses": [
+ {
+ "$id": "213",
+ "StatusCodes": [200],
+ "BodyType": {
+ "$ref": "38"
+ },
+ "BodyMediaType": "Json",
+ "Headers": [],
+ "IsErrorResponse": false,
+ "ContentTypes": ["application/json"]
+ }
+ ],
+ "HttpMethod": "GET",
+ "RequestBodyMediaType": "None",
+ "Uri": "{unbrandedTypeSpecUrl}",
+ "Path": "/top/{action}",
+ "BufferResponse": true,
+ "GenerateProtocolMethod": true,
+ "GenerateConvenienceMethod": true
+ },
+ {
+ "$id": "214",
+ "Name": "topAction2",
+ "ResourceName": "UnbrandedTypeSpec",
+ "Description": "top level method2",
+ "Parameters": [
+ {
+ "$ref": "137"
+ },
+ {
+ "$id": "215",
+ "Name": "accept",
+ "NameInRequest": "Accept",
+ "Type": {
+ "$id": "216",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Location": "Header",
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsRequired": true,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Constant",
+ "DefaultValue": {
+ "$id": "217",
+ "Type": {
+ "$ref": "216"
+ },
+ "Value": "application/json"
+ }
+ }
+ ],
+ "Responses": [
+ {
+ "$id": "218",
+ "StatusCodes": [200],
+ "BodyType": {
+ "$ref": "38"
+ },
+ "BodyMediaType": "Json",
+ "Headers": [],
+ "IsErrorResponse": false,
+ "ContentTypes": ["application/json"]
+ }
+ ],
+ "HttpMethod": "GET",
+ "RequestBodyMediaType": "None",
+ "Uri": "{unbrandedTypeSpecUrl}",
+ "Path": "/top2",
+ "BufferResponse": true,
+ "GenerateProtocolMethod": true,
+ "GenerateConvenienceMethod": false
+ },
+ {
+ "$id": "219",
+ "Name": "patchAction",
+ "ResourceName": "UnbrandedTypeSpec",
+ "Description": "top level patch",
+ "Parameters": [
+ {
+ "$ref": "137"
+ },
+ {
+ "$id": "220",
+ "Name": "body",
+ "NameInRequest": "body",
+ "Type": {
+ "$ref": "38"
+ },
+ "Location": "Body",
+ "IsRequired": true,
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Method"
+ },
+ {
+ "$id": "221",
+ "Name": "accept",
+ "NameInRequest": "Accept",
+ "Type": {
+ "$id": "222",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Location": "Header",
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsRequired": true,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Constant",
+ "DefaultValue": {
+ "$id": "223",
+ "Type": {
+ "$ref": "222"
+ },
+ "Value": "application/json"
+ }
+ },
+ {
+ "$id": "224",
+ "Name": "contentType",
+ "NameInRequest": "Content-Type",
+ "Type": {
+ "$id": "225",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Location": "Header",
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": true,
+ "IsRequired": true,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Constant",
+ "DefaultValue": {
+ "$id": "226",
+ "Type": {
+ "$ref": "225"
+ },
+ "Value": "application/json"
+ }
+ }
+ ],
+ "Responses": [
+ {
+ "$id": "227",
+ "StatusCodes": [200],
+ "BodyType": {
+ "$ref": "38"
+ },
+ "BodyMediaType": "Json",
+ "Headers": [],
+ "IsErrorResponse": false,
+ "ContentTypes": ["application/json"]
+ }
+ ],
+ "HttpMethod": "PATCH",
+ "RequestBodyMediaType": "Json",
+ "Uri": "{unbrandedTypeSpecUrl}",
+ "Path": "/patch",
+ "RequestMediaTypes": ["application/json"],
+ "BufferResponse": true,
+ "GenerateProtocolMethod": true,
+ "GenerateConvenienceMethod": false
+ },
+ {
+ "$id": "228",
+ "Name": "anonymousBody",
+ "ResourceName": "UnbrandedTypeSpec",
+ "Description": "body parameter without body decorator",
+ "Parameters": [
+ {
+ "$ref": "137"
+ },
+ {
+ "$id": "229",
+ "Name": "Thing",
+ "NameInRequest": "Thing",
+ "Description": "A model with a few properties of literal types",
+ "Type": {
+ "$ref": "38"
+ },
+ "Location": "Body",
+ "IsRequired": true,
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Method"
+ },
+ {
+ "$id": "230",
+ "Name": "accept",
+ "NameInRequest": "Accept",
+ "Type": {
+ "$id": "231",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Location": "Header",
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsRequired": true,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Constant",
+ "DefaultValue": {
+ "$id": "232",
+ "Type": {
+ "$ref": "231"
+ },
+ "Value": "application/json"
+ }
+ },
+ {
+ "$id": "233",
+ "Name": "contentType",
+ "NameInRequest": "Content-Type",
+ "Type": {
+ "$id": "234",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Location": "Header",
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": true,
+ "IsRequired": true,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Constant",
+ "DefaultValue": {
+ "$id": "235",
+ "Type": {
+ "$ref": "234"
+ },
+ "Value": "application/json"
+ }
+ }
+ ],
+ "Responses": [
+ {
+ "$id": "236",
+ "StatusCodes": [200],
+ "BodyType": {
+ "$ref": "38"
+ },
+ "BodyMediaType": "Json",
+ "Headers": [],
+ "IsErrorResponse": false,
+ "ContentTypes": ["application/json"]
+ }
+ ],
+ "HttpMethod": "POST",
+ "RequestBodyMediaType": "Json",
+ "Uri": "{unbrandedTypeSpecUrl}",
+ "Path": "/anonymousBody",
+ "RequestMediaTypes": ["application/json"],
+ "BufferResponse": true,
+ "GenerateProtocolMethod": true,
+ "GenerateConvenienceMethod": true
+ },
+ {
+ "$id": "237",
+ "Name": "friendlyModel",
+ "ResourceName": "UnbrandedTypeSpec",
+ "Description": "Model can have its friendly name",
+ "Parameters": [
+ {
+ "$ref": "137"
+ },
+ {
+ "$id": "238",
+ "Name": "Friend",
+ "NameInRequest": "NotFriend",
+ "Description": "this is not a friendly model but with a friendly name",
+ "Type": {
+ "$ref": "123"
+ },
+ "Location": "Body",
+ "IsRequired": true,
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Method"
+ },
+ {
+ "$id": "239",
+ "Name": "accept",
+ "NameInRequest": "Accept",
+ "Type": {
+ "$id": "240",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Location": "Header",
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsRequired": true,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Constant",
+ "DefaultValue": {
+ "$id": "241",
+ "Type": {
+ "$ref": "240"
+ },
+ "Value": "application/json"
+ }
+ },
+ {
+ "$id": "242",
+ "Name": "contentType",
+ "NameInRequest": "Content-Type",
+ "Type": {
+ "$id": "243",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Location": "Header",
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": true,
+ "IsRequired": true,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Constant",
+ "DefaultValue": {
+ "$id": "244",
+ "Type": {
+ "$ref": "243"
+ },
+ "Value": "application/json"
+ }
+ }
+ ],
+ "Responses": [
+ {
+ "$id": "245",
+ "StatusCodes": [200],
+ "BodyType": {
+ "$ref": "123"
+ },
+ "BodyMediaType": "Json",
+ "Headers": [],
+ "IsErrorResponse": false,
+ "ContentTypes": ["application/json"]
+ }
+ ],
+ "HttpMethod": "POST",
+ "RequestBodyMediaType": "Json",
+ "Uri": "{unbrandedTypeSpecUrl}",
+ "Path": "/friendlyName",
+ "RequestMediaTypes": ["application/json"],
+ "BufferResponse": true,
+ "GenerateProtocolMethod": true,
+ "GenerateConvenienceMethod": true
+ },
+ {
+ "$id": "246",
+ "Name": "addTimeHeader",
+ "ResourceName": "UnbrandedTypeSpec",
+ "Parameters": [
+ {
+ "$ref": "137"
+ },
+ {
+ "$id": "247",
+ "Name": "repeatabilityFirstSent",
+ "NameInRequest": "Repeatability-First-Sent",
+ "Type": {
+ "$id": "248",
+ "Kind": "Primitive",
+ "Name": "DateTime",
+ "IsNullable": false
+ },
+ "Location": "Header",
+ "IsRequired": false,
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Method"
+ },
+ {
+ "$id": "249",
+ "Name": "accept",
+ "NameInRequest": "Accept",
+ "Type": {
+ "$id": "250",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Location": "Header",
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsRequired": true,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Constant",
+ "DefaultValue": {
+ "$id": "251",
+ "Type": {
+ "$ref": "250"
+ },
+ "Value": "application/json"
+ }
+ }
+ ],
+ "Responses": [
+ {
+ "$id": "252",
+ "StatusCodes": [204],
+ "BodyMediaType": "Json",
+ "Headers": [],
+ "IsErrorResponse": false
+ }
+ ],
+ "HttpMethod": "GET",
+ "RequestBodyMediaType": "None",
+ "Uri": "{unbrandedTypeSpecUrl}",
+ "Path": "/",
+ "BufferResponse": true,
+ "GenerateProtocolMethod": true,
+ "GenerateConvenienceMethod": false
+ },
+ {
+ "$id": "253",
+ "Name": "stringFormat",
+ "ResourceName": "UnbrandedTypeSpec",
+ "Description": "parameter has string format.",
+ "Parameters": [
+ {
+ "$ref": "137"
+ },
+ {
+ "$id": "254",
+ "Name": "subscriptionId",
+ "NameInRequest": "subscriptionId",
+ "Type": {
+ "$id": "255",
+ "Kind": "Primitive",
+ "Name": "Guid",
+ "IsNullable": false
+ },
+ "Location": "Path",
+ "IsRequired": true,
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Method"
+ },
+ {
+ "$id": "256",
+ "Name": "body",
+ "NameInRequest": "body",
+ "Type": {
+ "$ref": "126"
+ },
+ "Location": "Body",
+ "IsRequired": true,
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Method"
+ },
+ {
+ "$id": "257",
+ "Name": "contentType",
+ "NameInRequest": "Content-Type",
+ "Type": {
+ "$id": "258",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Location": "Header",
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": true,
+ "IsRequired": true,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Constant",
+ "DefaultValue": {
+ "$id": "259",
+ "Type": {
+ "$ref": "258"
+ },
+ "Value": "application/json"
+ }
+ },
+ {
+ "$id": "260",
+ "Name": "accept",
+ "NameInRequest": "Accept",
+ "Type": {
+ "$id": "261",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Location": "Header",
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsRequired": true,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Constant",
+ "DefaultValue": {
+ "$id": "262",
+ "Type": {
+ "$ref": "261"
+ },
+ "Value": "application/json"
+ }
+ }
+ ],
+ "Responses": [
+ {
+ "$id": "263",
+ "StatusCodes": [204],
+ "BodyMediaType": "Json",
+ "Headers": [],
+ "IsErrorResponse": false
+ }
+ ],
+ "HttpMethod": "POST",
+ "RequestBodyMediaType": "Json",
+ "Uri": "{unbrandedTypeSpecUrl}",
+ "Path": "/stringFormat/{subscriptionId}",
+ "RequestMediaTypes": ["application/json"],
+ "BufferResponse": true,
+ "GenerateProtocolMethod": true,
+ "GenerateConvenienceMethod": true
+ },
+ {
+ "$id": "264",
+ "Name": "projectedNameModel",
+ "ResourceName": "UnbrandedTypeSpec",
+ "Description": "Model can have its projected name",
+ "Parameters": [
+ {
+ "$ref": "137"
+ },
+ {
+ "$id": "265",
+ "Name": "ProjectedModel",
+ "NameInRequest": "ModelWithProjectedName",
+ "Description": "this is a model with a projected name",
+ "Type": {
+ "$ref": "131"
+ },
+ "Location": "Body",
+ "IsRequired": true,
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Method"
+ },
+ {
+ "$id": "266",
+ "Name": "accept",
+ "NameInRequest": "Accept",
+ "Type": {
+ "$id": "267",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Location": "Header",
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsRequired": true,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Constant",
+ "DefaultValue": {
+ "$id": "268",
+ "Type": {
+ "$ref": "267"
+ },
+ "Value": "application/json"
+ }
+ },
+ {
+ "$id": "269",
+ "Name": "contentType",
+ "NameInRequest": "Content-Type",
+ "Type": {
+ "$id": "270",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Location": "Header",
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": true,
+ "IsRequired": true,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Constant",
+ "DefaultValue": {
+ "$id": "271",
+ "Type": {
+ "$ref": "270"
+ },
+ "Value": "application/json"
+ }
+ }
+ ],
+ "Responses": [
+ {
+ "$id": "272",
+ "StatusCodes": [200],
+ "BodyType": {
+ "$ref": "131"
+ },
+ "BodyMediaType": "Json",
+ "Headers": [],
+ "IsErrorResponse": false,
+ "ContentTypes": ["application/json"]
+ }
+ ],
+ "HttpMethod": "POST",
+ "RequestBodyMediaType": "Json",
+ "Uri": "{unbrandedTypeSpecUrl}",
+ "Path": "/projectedName",
+ "RequestMediaTypes": ["application/json"],
+ "BufferResponse": true,
+ "GenerateProtocolMethod": true,
+ "GenerateConvenienceMethod": true
+ },
+ {
+ "$id": "273",
+ "Name": "returnsAnonymousModel",
+ "ResourceName": "UnbrandedTypeSpec",
+ "Description": "return anonymous model",
+ "Parameters": [
+ {
+ "$ref": "137"
+ },
+ {
+ "$id": "274",
+ "Name": "accept",
+ "NameInRequest": "Accept",
+ "Type": {
+ "$id": "275",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Location": "Header",
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsRequired": true,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Constant",
+ "DefaultValue": {
+ "$id": "276",
+ "Type": {
+ "$ref": "275"
+ },
+ "Value": "application/json"
+ }
+ }
+ ],
+ "Responses": [
+ {
+ "$id": "277",
+ "StatusCodes": [200],
+ "BodyType": {
+ "$ref": "134"
+ },
+ "BodyMediaType": "Json",
+ "Headers": [],
+ "IsErrorResponse": false,
+ "ContentTypes": ["application/json"]
+ }
+ ],
+ "HttpMethod": "POST",
+ "RequestBodyMediaType": "None",
+ "Uri": "{unbrandedTypeSpecUrl}",
+ "Path": "/returnsAnonymousModel",
+ "BufferResponse": true,
+ "GenerateProtocolMethod": true,
+ "GenerateConvenienceMethod": true
+ },
+ {
+ "$id": "278",
+ "Name": "getUnknownValue",
+ "ResourceName": "UnbrandedTypeSpec",
+ "Description": "get extensible enum",
+ "Parameters": [
+ {
+ "$ref": "137"
+ },
+ {
+ "$id": "279",
+ "Name": "accept",
+ "NameInRequest": "Accept",
+ "Type": {
+ "$id": "280",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Location": "Header",
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsRequired": true,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Constant",
+ "DefaultValue": {
+ "$id": "281",
+ "Type": {
+ "$ref": "280"
+ },
+ "Value": "application/json"
+ }
+ }
+ ],
+ "Responses": [
+ {
+ "$id": "282",
+ "StatusCodes": [200],
+ "BodyType": {
+ "$id": "283",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "BodyMediaType": "Json",
+ "Headers": [],
+ "IsErrorResponse": false,
+ "ContentTypes": ["application/json"]
+ }
+ ],
+ "HttpMethod": "GET",
+ "RequestBodyMediaType": "None",
+ "Uri": "{unbrandedTypeSpecUrl}",
+ "Path": "/unknown-value",
+ "BufferResponse": true,
+ "GenerateProtocolMethod": true,
+ "GenerateConvenienceMethod": false
+ },
+ {
+ "$id": "284",
+ "Name": "internalProtocol",
+ "ResourceName": "UnbrandedTypeSpec",
+ "Description": "When set protocol false and convenient true, then the protocol method should be internal",
+ "Parameters": [
+ {
+ "$ref": "137"
+ },
+ {
+ "$id": "285",
+ "Name": "body",
+ "NameInRequest": "body",
+ "Type": {
+ "$ref": "38"
+ },
+ "Location": "Body",
+ "IsRequired": true,
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Method"
+ },
+ {
+ "$id": "286",
+ "Name": "accept",
+ "NameInRequest": "Accept",
+ "Type": {
+ "$id": "287",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Location": "Header",
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsRequired": true,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Constant",
+ "DefaultValue": {
+ "$id": "288",
+ "Type": {
+ "$ref": "287"
+ },
+ "Value": "application/json"
+ }
+ },
+ {
+ "$id": "289",
+ "Name": "contentType",
+ "NameInRequest": "Content-Type",
+ "Type": {
+ "$id": "290",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Location": "Header",
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": true,
+ "IsRequired": true,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Constant",
+ "DefaultValue": {
+ "$id": "291",
+ "Type": {
+ "$ref": "290"
+ },
+ "Value": "application/json"
+ }
+ }
+ ],
+ "Responses": [
+ {
+ "$id": "292",
+ "StatusCodes": [200],
+ "BodyType": {
+ "$ref": "38"
+ },
+ "BodyMediaType": "Json",
+ "Headers": [],
+ "IsErrorResponse": false,
+ "ContentTypes": ["application/json"]
+ }
+ ],
+ "HttpMethod": "POST",
+ "RequestBodyMediaType": "Json",
+ "Uri": "{unbrandedTypeSpecUrl}",
+ "Path": "/internalProtocol",
+ "RequestMediaTypes": ["application/json"],
+ "BufferResponse": true,
+ "GenerateProtocolMethod": false,
+ "GenerateConvenienceMethod": true
+ },
+ {
+ "$id": "293",
+ "Name": "stillConvenient",
+ "ResourceName": "UnbrandedTypeSpec",
+ "Description": "When set protocol false and convenient true, the convenient method should be generated even it has the same signature as protocol one",
+ "Parameters": [
+ {
+ "$ref": "137"
+ },
+ {
+ "$id": "294",
+ "Name": "accept",
+ "NameInRequest": "Accept",
+ "Type": {
+ "$id": "295",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Location": "Header",
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsRequired": true,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Constant",
+ "DefaultValue": {
+ "$id": "296",
+ "Type": {
+ "$ref": "295"
+ },
+ "Value": "application/json"
+ }
+ }
+ ],
+ "Responses": [
+ {
+ "$id": "297",
+ "StatusCodes": [204],
+ "BodyMediaType": "Json",
+ "Headers": [],
+ "IsErrorResponse": false
+ }
+ ],
+ "HttpMethod": "GET",
+ "RequestBodyMediaType": "None",
+ "Uri": "{unbrandedTypeSpecUrl}",
+ "Path": "/stillConvenient",
+ "BufferResponse": true,
+ "GenerateProtocolMethod": false,
+ "GenerateConvenienceMethod": true
+ },
+ {
+ "$id": "298",
+ "Name": "headAsBoolean",
+ "ResourceName": "UnbrandedTypeSpec",
+ "Description": "head as boolean.",
+ "Parameters": [
+ {
+ "$ref": "137"
+ },
+ {
+ "$id": "299",
+ "Name": "id",
+ "NameInRequest": "id",
+ "Type": {
+ "$id": "300",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Location": "Path",
+ "IsRequired": true,
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Method"
+ },
+ {
+ "$id": "301",
+ "Name": "accept",
+ "NameInRequest": "Accept",
+ "Type": {
+ "$id": "302",
+ "Kind": "Primitive",
+ "Name": "String",
+ "IsNullable": false
+ },
+ "Location": "Header",
+ "IsApiVersion": false,
+ "IsResourceParameter": false,
+ "IsContentType": false,
+ "IsRequired": true,
+ "IsEndpoint": false,
+ "SkipUrlEncoding": false,
+ "Explode": false,
+ "Kind": "Constant",
+ "DefaultValue": {
+ "$id": "303",
+ "Type": {
+ "$ref": "302"
+ },
+ "Value": "application/json"
+ }
+ }
+ ],
+ "Responses": [
+ {
+ "$id": "304",
+ "StatusCodes": [204],
+ "BodyMediaType": "Json",
+ "Headers": [],
+ "IsErrorResponse": false
+ }
+ ],
+ "HttpMethod": "HEAD",
+ "RequestBodyMediaType": "None",
+ "Uri": "{unbrandedTypeSpecUrl}",
+ "Path": "/headAsBoolean/{id}",
+ "BufferResponse": true,
+ "GenerateProtocolMethod": true,
+ "GenerateConvenienceMethod": true
+ }
+ ],
+ "Protocol": {
+ "$id": "305"
+ },
+ "Creatable": true
+ }
+ ],
+ "Auth": {
+ "$id": "306",
+ "ApiKey": {
+ "$id": "307",
+ "Name": "my-api-key"
+ }
+ }
+}
diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/tspconfig.yaml b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/tspconfig.yaml
new file mode 100644
index 0000000000..26f2148ad7
--- /dev/null
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/tspconfig.yaml
@@ -0,0 +1,6 @@
+options:
+ "@azure-tools/typespec-csharp":
+ generate-convenience-methods: false
+ deserialize-null-collection-as-null-value: true
+ head-as-boolean: true
+ generate-test-project: true
diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/ClientModelCodeWriterExtensionMethods.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/ClientModelCodeWriterExtensionMethods.cs
new file mode 100644
index 0000000000..8bb63de910
--- /dev/null
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/ClientModelCodeWriterExtensionMethods.cs
@@ -0,0 +1,15 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+namespace Microsoft.Generator.CSharp.ClientModel
+{
+ public class ClientModelCodeWriterExtensionMethods : CodeWriterExtensionMethods
+ {
+ public override void WriteMethod(CodeWriter writer, Method method)
+ {
+ writer.Append($"// Sample plugin implementation of WriteMethod from {GetType()}");
+ writer.WriteLine();
+ base.WriteMethod(writer, method);
+ }
+ }
+}
diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/ClientModelPlugin.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/ClientModelPlugin.cs
new file mode 100644
index 0000000000..e2842a982c
--- /dev/null
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/ClientModelPlugin.cs
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System;
+using System.ComponentModel.Composition;
+using Microsoft.Generator.CSharp.ClientModel.Expressions;
+using Microsoft.Generator.CSharp.ClientModel.Output;
+using Microsoft.Generator.CSharp.ClientModel.Writers;
+using Microsoft.Generator.CSharp.Expressions;
+using Microsoft.Generator.CSharp.Input;
+using Microsoft.Generator.CSharp.Writers;
+
+namespace Microsoft.Generator.CSharp.ClientModel
+{
+ public class ClientModelPlugin : CodeModelPlugin
+ {
+ private static ClientModelPlugin? _instance;
+ internal static ClientModelPlugin Instance => _instance ?? throw new InvalidOperationException("ClientModelPlugin is not loaded.");
+ public override ApiTypes ApiTypes { get; }
+ public override CodeWriterExtensionMethods CodeWriterExtensionMethods { get; }
+
+ public override OutputLibrary GetOutputLibrary(InputNamespace input) => new ScmOutputLibrary(input);
+
+ public override ExpressionTypeProviderWriter GetExpressionTypeProviderWriter(CodeWriter writer, ModelTypeProvider model) => new ScmExpressionTypeProviderWriter(writer, model);
+
+ public override TypeFactory TypeFactory { get; }
+
+ public override ExtensibleSnippets ExtensibleSnippets { get; }
+
+ [ImportingConstructor]
+ public ClientModelPlugin(GeneratorContext context)
+ : base(context)
+ {
+ TypeFactory = new GeneratorCSharpTypeFactory();
+ ExtensibleSnippets = new SystemExtensibleSnippets();
+ ApiTypes = new SystemApiTypes();
+ CodeWriterExtensionMethods = new ClientModelCodeWriterExtensionMethods();
+ _instance = this;
+ }
+ }
+}
diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Expressions/MessagePipelineExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Expressions/MessagePipelineExpression.cs
new file mode 100644
index 0000000000..2cd1007154
--- /dev/null
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Expressions/MessagePipelineExpression.cs
@@ -0,0 +1,42 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System.ClientModel.Primitives.Pipeline;
+using System.Collections.Generic;
+using Microsoft.Generator.CSharp.Expressions;
+
+namespace Microsoft.Generator.CSharp.ClientModel.Expressions
+{
+ internal sealed record MessagePipelineExpression(ValueExpression Untyped) : TypedValueExpression(Untyped)
+ {
+ public PipelineMessageExpression CreateMessage(RequestOptionsExpression requestContext, ValueExpression responseClassifier) => new(Invoke(nameof(MessagePipeline.CreateMessage), requestContext, responseClassifier));
+ public PipelineResponseExpression ProcessMessage(TypedValueExpression message, RequestOptionsExpression? requestContext, CancellationTokenExpression? cancellationToken, bool async)
+ {
+ var arguments = new List
+ {
+ Untyped,
+ message,
+ requestContext ?? Snippets.Null
+ };
+
+ if (cancellationToken != null)
+ {
+ arguments.Add(cancellationToken);
+ }
+
+ return ClientPipelineExtensionsProvider.Instance.ProcessMessage(arguments, async);
+ }
+
+ public ResultExpression ProcessHeadAsBoolMessage(TypedValueExpression message, RequestOptionsExpression? requestContext, bool async)
+ {
+ var arguments = new List
+ {
+ Untyped,
+ message,
+ requestContext ?? Snippets.Null
+ };
+
+ return ClientPipelineExtensionsProvider.Instance.ProcessHeadAsBoolMessage(arguments, async);
+ }
+ }
+}
diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Expressions/PipelineMessageExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Expressions/PipelineMessageExpression.cs
new file mode 100644
index 0000000000..c25e460a32
--- /dev/null
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Expressions/PipelineMessageExpression.cs
@@ -0,0 +1,13 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System.ClientModel.Primitives;
+using Microsoft.Generator.CSharp.Expressions;
+
+namespace Microsoft.Generator.CSharp.ClientModel.Expressions
+{
+ internal sealed record PipelineMessageExpression(ValueExpression Untyped) : TypedValueExpression(Untyped)
+ {
+ public PipelineRequestExpression Request => new(Property(nameof(PipelineMessage.Request)));
+ }
+}
diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Expressions/PipelineRequestExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Expressions/PipelineRequestExpression.cs
new file mode 100644
index 0000000000..3adf3f8f9f
--- /dev/null
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Expressions/PipelineRequestExpression.cs
@@ -0,0 +1,18 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System;
+using System.ClientModel.Primitives;
+using Microsoft.Generator.CSharp.Expressions;
+using static Microsoft.Generator.CSharp.Expressions.Snippets;
+
+namespace Microsoft.Generator.CSharp.ClientModel.Expressions
+{
+ internal sealed record PipelineRequestExpression(ValueExpression Untyped) : TypedValueExpression(Untyped)
+ {
+ public TypedValueExpression Uri => new FrameworkTypeExpression(typeof(Uri), Property(nameof(PipelineRequest.Uri)));
+ public RequestBodyExpression Content => new(Property(nameof(PipelineRequest.Content)));
+ public MethodBodyStatement SetMethod(string method) => new InvokeInstanceMethodStatement(Untyped, nameof(PipelineRequest.SetMethod), Literal(method));
+ public MethodBodyStatement SetHeaderValue(string name, StringExpression value) => new InvokeInstanceMethodStatement(Untyped, nameof(PipelineRequest.SetHeaderValue), Literal(name), value);
+ }
+}
diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Expressions/PipelineResponseExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Expressions/PipelineResponseExpression.cs
new file mode 100644
index 0000000000..e0e2f65a97
--- /dev/null
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Expressions/PipelineResponseExpression.cs
@@ -0,0 +1,15 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System.ClientModel.Primitives;
+using Microsoft.Generator.CSharp.Expressions;
+
+namespace Microsoft.Generator.CSharp.ClientModel.Expressions
+{
+ internal sealed record PipelineResponseExpression(ValueExpression Untyped) : TypedValueExpression(Untyped)
+ {
+ public BinaryDataExpression Content => new(Property(nameof(PipelineResponse.Content)));
+
+ public StreamExpression ContentStream => new(Property(nameof(PipelineResponse.ContentStream)));
+ }
+}
diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Expressions/RequestBodyExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Expressions/RequestBodyExpression.cs
new file mode 100644
index 0000000000..1381d2b4f7
--- /dev/null
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Expressions/RequestBodyExpression.cs
@@ -0,0 +1,10 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System.ClientModel.Primitives;
+using Microsoft.Generator.CSharp.Expressions;
+
+namespace Microsoft.Generator.CSharp.ClientModel.Expressions
+{
+ internal sealed record RequestBodyExpression(ValueExpression Untyped) : TypedValueExpression(Untyped);
+}
diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Expressions/RequestOptionsExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Expressions/RequestOptionsExpression.cs
new file mode 100644
index 0000000000..ff0e267439
--- /dev/null
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Expressions/RequestOptionsExpression.cs
@@ -0,0 +1,15 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System.ClientModel;
+using Microsoft.Generator.CSharp.Expressions;
+
+
+namespace Microsoft.Generator.CSharp.ClientModel.Expressions
+{
+ internal sealed record RequestOptionsExpression(ValueExpression Untyped) : TypedValueExpression(Untyped)
+ {
+ public static RequestOptionsExpression FromCancellationToken()
+ => new(new InvokeStaticMethodExpression(null, nameof(FromCancellationToken), new ValueExpression[] { KnownParameters.CancellationTokenParameter }));
+ }
+}
diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Expressions/ResultExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Expressions/ResultExpression.cs
new file mode 100644
index 0000000000..14822d6288
--- /dev/null
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Expressions/ResultExpression.cs
@@ -0,0 +1,33 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System;
+using System.ClientModel;
+using Microsoft.Generator.CSharp.Expressions;
+
+namespace Microsoft.Generator.CSharp.ClientModel.Expressions
+{
+ internal sealed record ResultExpression(ValueExpression Untyped) : TypedValueExpression(Untyped)
+ {
+ public ValueExpression Value => Property(nameof(Result