Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump core from 1d6d1ce to 8ed1d82 #225

Merged
merged 7 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/sour-brooms-mix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@azure-tools/typespec-autorest": patch
---

Emit warning if using opendIdConnect http auth scheme
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"packageManager": "[email protected]",
"scripts": {
"run-all": "pnpm -r --filter='!./core'",
"run-all": "pnpm -r --filter=!./core/",
"build": "pnpm run-all --workspace-concurrency=Infinity --aggregate-output --reporter=append-only build ",
"check-format": "pnpm run prettier --check",
"check-version-mismatch": "syncpack list-mismatches",
Expand Down
6 changes: 6 additions & 0 deletions packages/typespec-autorest/src/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,12 @@ const libDef = {
default: paramMessage`'${"schema"}' format '${"format"}' is not supported in Autorest. It will not be emitted.`,
},
},
"unsupported-auth": {
severity: "warning",
messages: {
default: paramMessage`Authentication "${"authType"}" is not a known authentication by the openapi3 emitter, it will be ignored.`,
},
},
},
emitter: {
options: EmitterOptionsSchema as JSONSchemaType<AutorestEmitterOptions>,
Expand Down
11 changes: 9 additions & 2 deletions packages/typespec-autorest/src/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ function createOAPIEmitter(
},
};
let root: OpenAPI2Document;
let currentService: Service;
let currentEndpoint: OpenAPI2Operation;
let currentConsumes: Set<string>;
let currentProduces: Set<string>;
Expand Down Expand Up @@ -327,6 +328,7 @@ function createOAPIEmitter(
services.push({ type: program.getGlobalNamespaceType() });
}
for (const service of services) {
currentService = service;
const originalProgram = program;
const versions = buildVersionProjections(program, service.type).filter(
(v) => !options.version || options.version === v.version
Expand Down Expand Up @@ -2228,9 +2230,14 @@ function createOAPIEmitter(
} as any,
flow.scopes.map((x) => x.value),
];
case "openIdConnect":
default:
const _assertNever: never = auth;
compilerAssert(false, "Unreachable");
reportDiagnostic(program, {
code: "unsupported-auth",
format: { authType: (auth as any).type },
target: currentService.type,
});
return undefined;
}
}

Expand Down
Loading