@azure-tools/typespec-azure-resource-manager 0.75.0-dev.1 → 0.75.0-dev.2

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.
package/README.md CHANGED
@@ -59,7 +59,7 @@ Available ruleSets:
59
59
  | [`@azure-tools/typespec-azure-resource-manager/arm-feature-file-usage-discourage`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/arm-feature-file-usage-discourage) | Verify the usage of @featureFiles decorator. |
60
60
  | [`@azure-tools/typespec-azure-resource-manager/beyond-nesting-levels`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/beyond-nesting-levels) | Tracked Resources must use 3 or fewer levels of nesting. |
61
61
  | [`@azure-tools/typespec-azure-resource-manager/list-response-envelope`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/list-response-envelope) | ARM list responses must use a value array and the standard nextLink envelope. |
62
- | [`@azure-tools/typespec-azure-resource-manager/no-query-in-collection`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/no-query-in-collection) | ARM collection GET operations must not declare query parameters beyond api-version and $filter. |
62
+ | [`@azure-tools/typespec-azure-resource-manager/no-query-in-collection`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/no-query-in-collection) | ARM collection GET and list operations must not declare query parameters beyond api-version and $filter. |
63
63
  | [`@azure-tools/typespec-azure-resource-manager/use-interface`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/use-interface) | Validate ARM Resource operations are defined inside an interface declaration. |
64
64
  | [`@azure-tools/typespec-azure-resource-manager/no-resource-delete-operation`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/no-resource-delete-operation) | Check for resources that must have a delete operation. |
65
65
  | [`@azure-tools/typespec-azure-resource-manager/empty-updateable-properties`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/empty-updateable-properties) | Should have updateable properties. |
@@ -1 +1 @@
1
- {"version":3,"file":"no-query-in-collection.d.ts","sourceRoot":"","sources":["../../../src/rules/no-query-in-collection.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,uBAAuB;;yBAyClC,CAAC"}
1
+ {"version":3,"file":"no-query-in-collection.d.ts","sourceRoot":"","sources":["../../../src/rules/no-query-in-collection.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,uBAAuB;;yBA4ClC,CAAC"}
@@ -1,21 +1,22 @@
1
- import { createRule, fileRef, paramMessage } from "@typespec/compiler";
1
+ import { createRule, fileRef, isList, paramMessage } from "@typespec/compiler";
2
2
  import { getHttpOperation } from "@typespec/http";
3
3
  import { isApiVersionParameterName, isCollectionPath } from "./utils.js";
4
4
  export const noQueryInCollectionRule = createRule({
5
5
  name: "no-query-in-collection",
6
6
  docs: fileRef.fromPackageRoot("src/rules/no-query-in-collection.md"),
7
- description: "ARM collection GET operations must not declare query parameters beyond api-version and $filter.",
7
+ description: "ARM collection GET and list operations must not declare query parameters beyond api-version and $filter.",
8
8
  severity: "warning",
9
9
  url: "https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/no-query-in-collection",
10
10
  messages: {
11
- default: paramMessage `Query parameter '${"name"}' should be removed. Collection GET operations must not have query parameters other than api-version and $filter.`,
11
+ default: paramMessage `Query parameter '${"name"}' should be removed. Collection GET and list operations must not have query parameters other than api-version and $filter.`,
12
12
  },
13
13
  create(context) {
14
14
  const reportedParameters = new Set();
15
15
  return {
16
16
  operation: (operation) => {
17
17
  const [httpOperation] = getHttpOperation(context.program, operation);
18
- if (httpOperation.verb !== "get" || !isCollectionPath(httpOperation.path)) {
18
+ if (!isList(context.program, operation) &&
19
+ (httpOperation.verb !== "get" || !isCollectionPath(httpOperation.path))) {
19
20
  return;
20
21
  }
21
22
  for (const parameter of httpOperation.parameters.properties) {
@@ -1 +1 @@
1
- {"version":3,"file":"no-query-in-collection.js","sourceRoot":"","sources":["../../../src/rules/no-query-in-collection.ts"],"names":[],"mappings":"AAAA,OAAO,E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AI,KAAK,KAAK,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,EACvE,CAAC;oBACD,OAAO;gBACT,CAAC;gBAED,KAAK,MAAM,SAAS,IAAI,aAAa,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC;oBAC5D,MAAM,eAAe,GAAG,SAAS,CAAC,QAAQ,CAAC,IAAI,IAAI,SAAS,CAAC,QAAQ,CAAC;oBACtE,IACE,SAAS,CAAC,IAAI,KAAK,OAAO;wBAC1B,uBAAuB,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC;wBAC/C,kBAAkB,CAAC,GAAG,CAAC,eAAe,CAAC,EACvC,CAAC;wBACD,SAAS;oBACX,CAAC;oBACD,kBAAkB,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;oBAExC,OAAO,CAAC,gBAAgB,CAAC;wBACvB,MAAM,EAAE,SAAS,CAAC,QAAQ;wBAC1B,MAAM,EAAE;4BACN,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,IAAI;yBAC7B;qBACF,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AAEH,SAAS,uBAAuB,CAAC,IAAY;IAC3C,OAAO,yBAAyB,CAAC,IAAI,CAAC,IAAI,IAAI,KAAK,SAAS,CAAC;AAC/D,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure-tools/typespec-azure-resource-manager",
3
- "version": "0.75.0-dev.1",
3
+ "version": "0.75.0-dev.2",
4
4
  "author": "Microsoft Corporation",
5
5
  "description": "TypeSpec Azure Resource Manager library",
6
6
  "homepage": "https://azure.github.io/typespec-azure",
@@ -48,9 +48,9 @@
48
48
  },
49
49
  "peerDependencies": {
50
50
  "@azure-tools/typespec-azure-core": "^0.74.0 || >= 0.75.0-dev.0",
51
- "@typespec/compiler": "^1.18.0",
52
- "@typespec/rest": "^0.88.0",
53
51
  "@typespec/http": "^1.18.0",
52
+ "@typespec/rest": "^0.88.0",
53
+ "@typespec/compiler": "^1.18.0",
54
54
  "@typespec/openapi": "^1.18.0",
55
55
  "@typespec/versioning": "^0.88.0"
56
56
  },
@@ -63,11 +63,11 @@
63
63
  "rimraf": "^6.1.3",
64
64
  "typescript": "npm:@typescript/typescript6@~6.0.2",
65
65
  "vitest": "^5.0.5",
66
- "@typespec/library-linter": "^0.88.0",
67
66
  "@typespec/http": "^1.18.0",
68
67
  "@typespec/compiler": "^1.18.0",
69
- "@typespec/rest": "^0.88.0",
68
+ "@typespec/library-linter": "^0.88.0",
70
69
  "@typespec/tspd": "^0.78.0",
70
+ "@typespec/rest": "^0.88.0",
71
71
  "@typespec/versioning": "^0.88.0",
72
72
  "@typespec/openapi": "^1.18.0"
73
73
  },