-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1,121 changed files
with
112,647 additions
and
3,057 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
changeKind: feature | ||
packages: | ||
- typespec-vscode | ||
--- | ||
|
||
integrate client SDK generation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
changeKind: fix | ||
packages: | ||
- "@typespec/internal-build-utils" | ||
--- | ||
|
||
resolve the program crash when there is no package name in package.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
changeKind: internal | ||
packages: | ||
- typespec-vscode | ||
--- | ||
|
||
remove vscode settings for code generation |
7 changes: 7 additions & 0 deletions
7
.chronus/changes/openapi3-json-decorators-2024-11-18-14-22-8.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
changeKind: feature | ||
packages: | ||
- "@typespec/openapi3" | ||
--- | ||
|
||
Adds support for @typespec/json-schema decorators with Open API 3.0 and 3.1 emitters. |
8 changes: 8 additions & 0 deletions
8
.chronus/changes/openapi3-output-spec-versions-2024-10-1-11-53-51.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
changeKind: feature | ||
packages: | ||
- "@typespec/openapi3" | ||
--- | ||
|
||
Adds support for emitting Open API 3.1 models using the `openapi-versions` emitter configuration option. | ||
Open API 3.0 is emitted by default. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
changeKind: feature | ||
packages: | ||
- "@typespec/playground" | ||
--- | ||
|
||
Add support for displaying array-based emitter options |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
changeKind: feature | ||
packages: | ||
- "@typespec/compiler" | ||
- typespec-vscode | ||
--- | ||
|
||
Support Emitters section in Init Template when creating TypeSpec project in vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
changeKind: fix | ||
packages: | ||
- "@typespec/openapi3" | ||
--- | ||
|
||
Fix: OpenAPI YAML converts strings to boolean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
packages/http-client-csharp/emitter/test/Unit/auth.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import { TestHost } from "@typespec/compiler/testing"; | ||
import { ok, strictEqual } from "assert"; | ||
import { beforeEach, describe, it } from "vitest"; | ||
import { createModel } from "../../src/lib/client-model-builder.js"; | ||
import { | ||
createEmitterContext, | ||
createEmitterTestHost, | ||
createNetSdkContext, | ||
typeSpecCompile, | ||
} from "./utils/test-util.js"; | ||
|
||
describe("Test auth", () => { | ||
let runner: TestHost; | ||
|
||
beforeEach(async () => { | ||
runner = await createEmitterTestHost(); | ||
}); | ||
|
||
it("cookie header is not supported", async () => { | ||
const program = await typeSpecCompile( | ||
` | ||
op test(): NoContentResponse; | ||
`, | ||
runner, | ||
{ | ||
AuthDecorator: `@useAuth(ApiKeyAuth<ApiKeyLocation.cookie, "api-key-name">)`, | ||
}, | ||
); | ||
const context = createEmitterContext(program); | ||
const sdkContext = await createNetSdkContext(context); | ||
const root = createModel(sdkContext); | ||
const diagnostics = context.program.diagnostics; | ||
|
||
const noAuthDiagnostic = diagnostics.find( | ||
(d) => d.code === "@typespec/http-client-csharp/unsupported-auth", | ||
); | ||
ok(noAuthDiagnostic); | ||
strictEqual( | ||
noAuthDiagnostic.message, | ||
"Only header is supported for ApiKey authentication. cookie is not supported.", | ||
); | ||
strictEqual(root.Auth, undefined); // we do not support it therefore it falls back to undefined | ||
}); | ||
|
||
it("query header is not supported", async () => { | ||
const program = await typeSpecCompile( | ||
` | ||
op test(): NoContentResponse; | ||
`, | ||
runner, | ||
{ | ||
AuthDecorator: `@useAuth(ApiKeyAuth<ApiKeyLocation.query, "api-key-name">)`, | ||
}, | ||
); | ||
const context = createEmitterContext(program); | ||
const sdkContext = await createNetSdkContext(context); | ||
const root = createModel(sdkContext); | ||
const diagnostics = context.program.diagnostics; | ||
|
||
const noAuthDiagnostic = diagnostics.find( | ||
(d) => d.code === "@typespec/http-client-csharp/unsupported-auth", | ||
); | ||
ok(noAuthDiagnostic); | ||
strictEqual( | ||
noAuthDiagnostic.message, | ||
"Only header is supported for ApiKey authentication. query is not supported.", | ||
); | ||
strictEqual(root.Auth, undefined); // we do not support it therefore it falls back to undefined | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.