@azure-tools/typespec-azure-core 0.30.0 → 0.30.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"no-operation-id.d.ts","sourceRoot":"","sources":["../../../src/rules/no-operation-id.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,eAAe,mCAgB1B,CAAC"}
1
+ {"version":3,"file":"no-operation-id.d.ts","sourceRoot":"","sources":["../../../src/rules/no-operation-id.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,eAAe,mCAmB1B,CAAC"}
@@ -1,5 +1,4 @@
1
1
  import { createRule } from "@typespec/lint";
2
- import { getOperationId } from "@typespec/openapi";
3
2
  import { reportDiagnostic } from "../lib.js";
4
3
  import { isExcludedCoreType } from "./utils.js";
5
4
  export const operationIdRule = createRule({
@@ -9,12 +8,15 @@ export const operationIdRule = createRule({
9
8
  operation: (operation) => {
10
9
  if (isExcludedCoreType(program, operation))
11
10
  return;
12
- if (getOperationId(program, operation)) {
13
- reportDiagnostic(program, {
14
- code: "no-operation-id",
15
- format: { operationId: operation.name },
16
- target: operation,
17
- });
11
+ for (const dec of operation.decorators) {
12
+ // See issue https://github.com/microsoft/typespec/issues/1943 for more precise
13
+ if (dec.decorator.name === "$operationId") {
14
+ reportDiagnostic(program, {
15
+ code: "no-operation-id",
16
+ format: { operationId: operation.name },
17
+ target: operation,
18
+ });
19
+ }
18
20
  }
19
21
  },
20
22
  };
@@ -1 +1 @@
1
- {"version":3,"file":"no-operation-id.js","sourceRoot":"","sources":["../../../src/rules/no-operation-id.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,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,MAAM,EAAE,SAAS;yBAClB,CAAC,CAAC;qBACJ;iBACF;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure-tools/typespec-azure-core",
3
- "version": "0.30.0",
3
+ "version": "0.30.1",
4
4
  "author": "Microsoft Corporation",
5
5
  "description": "TypeSpec Azure Core library",
6
6
  "homepage": "https://azure.github.io/typespec-azure",