@azure-tools/typespec-azure-resource-manager 0.75.0-dev.1 → 0.75.0-dev.3
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 +2 -3
- package/dist/src/linter.d.ts.map +1 -1
- package/dist/src/linter.js +0 -2
- package/dist/src/linter.js.map +1 -1
- package/dist/src/rules/list-response-envelope.d.ts +4 -2
- package/dist/src/rules/list-response-envelope.d.ts.map +1 -1
- package/dist/src/rules/list-response-envelope.js +171 -111
- package/dist/src/rules/list-response-envelope.js.map +1 -1
- package/dist/src/rules/no-query-in-collection.d.ts.map +1 -1
- package/dist/src/rules/no-query-in-collection.js +5 -4
- package/dist/src/rules/no-query-in-collection.js.map +1 -1
- package/package.json +4 -4
- package/dist/src/rules/list-operation-missing-pageable.d.ts +0 -4
- package/dist/src/rules/list-operation-missing-pageable.d.ts.map +0 -1
- package/dist/src/rules/list-operation-missing-pageable.js +0 -45
- package/dist/src/rules/list-operation-missing-pageable.js.map +0 -1
package/README.md
CHANGED
|
@@ -58,8 +58,8 @@ Available ruleSets:
|
|
|
58
58
|
| [`@azure-tools/typespec-azure-resource-manager/arm-custom-resource-usage-discourage`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/arm-custom-resource-usage-discourage) | Verify the usage of @customAzureResource decorator. |
|
|
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
|
-
| [`@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
|
|
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.
|
|
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 operations must declare paging metadata and use the standard response 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 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. |
|
|
@@ -68,7 +68,6 @@ Available ruleSets:
|
|
|
68
68
|
| [`@azure-tools/typespec-azure-resource-manager/improper-subscription-list-operation`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/improper-subscription-list-operation) | Tenant and Extension resources should not define a list by subscription operation. |
|
|
69
69
|
| [`@azure-tools/typespec-azure-resource-manager/lro-location-header`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/lro-location-header) | A 202 response should include a Location response header. |
|
|
70
70
|
| [`@azure-tools/typespec-azure-resource-manager/lro-missing-polling-metadata`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/lro-missing-polling-metadata) | ARM operations indicating asynchronous processing must have native polling metadata. |
|
|
71
|
-
| [`@azure-tools/typespec-azure-resource-manager/list-operation-missing-pageable`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/list-operation-missing-pageable) | ARM GET operations on list paths must define TypeSpec paging metadata. |
|
|
72
71
|
| [`@azure-tools/typespec-azure-resource-manager/missing-x-ms-identifiers`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/missing-x-ms-identifiers) | Array properties should describe their identifying properties with x-ms-identifiers. Decorate the property with @OpenAPI.extension("x-ms-identifiers", #[id-prop]) where "id-prop" is a list of the names of identifying properties in the item type. |
|
|
73
72
|
| [`@azure-tools/typespec-azure-resource-manager/no-response-body`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/no-response-body) | Check that 202, 204 and DELETE 200 responses have no body, and other success (2xx) responses have a body except for HEAD and POST 200. |
|
|
74
73
|
| [`@azure-tools/typespec-azure-resource-manager/no-query-in-post`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/no-query-in-post) | ARM POST operations must not declare query parameters other than api-version. |
|
package/dist/src/linter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linter.d.ts","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"linter.d.ts","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"AA2IA,eAAO,MAAM,OAAO,+CAYlB,CAAC"}
|
package/dist/src/linter.js
CHANGED
|
@@ -25,7 +25,6 @@ import { armResourceProvisioningStateRule } from "./rules/arm-resource-provision
|
|
|
25
25
|
import { beyondNestingRule } from "./rules/beyond-nesting-levels.js";
|
|
26
26
|
import { envelopePropertiesRules } from "./rules/envelope-properties.js";
|
|
27
27
|
import { improperSubscriptionListOperationRule } from "./rules/improper-subscription-list-operation.js";
|
|
28
|
-
import { listOperationMissingPageableRule } from "./rules/list-operation-missing-pageable.js";
|
|
29
28
|
import { listResponseEnvelopeRule } from "./rules/list-response-envelope.js";
|
|
30
29
|
import { lroLocationHeaderRule } from "./rules/lro-location-header.js";
|
|
31
30
|
import { lroMissingPollingMetadataRule } from "./rules/lro-missing-polling-metadata.js";
|
|
@@ -108,7 +107,6 @@ const rules = [
|
|
|
108
107
|
improperSubscriptionListOperationRule,
|
|
109
108
|
lroLocationHeaderRule,
|
|
110
109
|
lroMissingPollingMetadataRule,
|
|
111
|
-
listOperationMissingPageableRule,
|
|
112
110
|
missingXmsIdentifiersRule,
|
|
113
111
|
noResponseBodyRule,
|
|
114
112
|
noQueryInPostRule,
|
package/dist/src/linter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linter.js","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,kCAAkC,EAAE,MAAM,gDAAgD,CAAC;AACpG,OAAO,EAAE,uCAAuC,EAAE,MAAM,qDAAqD,CAAC;AAC9G,OAAO,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAChF,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,gCAAgC,EAAE,MAAM,iDAAiD,CAAC;AACnG,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;AAC7F,OAAO,EAAE,4BAA4B,EAAE,MAAM,yCAAyC,CAAC;AACvF,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,8BAA8B,EAAE,MAAM,2CAA2C,CAAC;AAC3F,OAAO,EAAE,kCAAkC,EAAE,MAAM,4CAA4C,CAAC;AAChG,OAAO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B,cAAc;IACd,gCAAgC;IAChC,qCAAqC;IACrC,qBAAqB;IACrB,6BAA6B;IAC7B,yBAAyB;IACzB,kBAAkB;IAClB,iBAAiB;IACjB,sBAAsB;IACtB,8BAA8B;IAC9B,4BAA4B;IAC5B,mBAAmB;IACnB,8BAA8B;IAC9B,gBAAgB;IAChB,uBAAuB;IACvB,cAAc;IACd,mBAAmB;IACnB,uBAAuB;IACvB,4BAA4B;IAC5B,cAAc;IACd,YAAY;IACZ,uBAAuB;IACvB,8BAA8B;IAC9B,yBAAyB;IACzB,qBAAqB;IACrB,oBAAoB;IACpB,yBAAyB;IACzB,+BAA+B;IAC/B,4BAA4B;IAC5B,0BAA0B;IAC1B,wBAAwB;IACxB,yBAAyB;CAC1B,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,YAAY,CAAC;IAClC,KAAK;IACL,QAAQ,EAAE;QACR,GAAG,EAAE;YACH,MAAM,EAAE,MAAM,CAAC,WAAW,CACxB,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;gBAClB,gDAAgD,IAAI,CAAC,IAAI,EAAE;gBAC3D,IAAI,KAAK,+BAA+B;aACzC,CAAC,CACH;SACF;KACF;CACF,CAAC,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export declare const listResponseEnvelopeRule: import("@typespec/compiler").LinterRuleDefinition<"list-response-envelope", {
|
|
2
|
-
readonly
|
|
3
|
-
readonly valueArray: "
|
|
2
|
+
readonly invalidEnvelope: "Collection response models must contain exactly `value` and `nextLink` properties.";
|
|
3
|
+
readonly valueArray: "Collection responses must declare a 'value' property of array type.";
|
|
4
|
+
readonly missingList: "Collection GET operations must use `@list`.";
|
|
5
|
+
readonly pagingMetadata: "Collection responses must use JSON-named `value` and `nextLink` properties with `@pageItems` and `@nextLink` metadata.";
|
|
4
6
|
}, Record<string, never>>;
|
|
5
7
|
//# sourceMappingURL=list-response-envelope.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-response-envelope.d.ts","sourceRoot":"","sources":["../../../src/rules/list-response-envelope.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list-response-envelope.d.ts","sourceRoot":"","sources":["../../../src/rules/list-response-envelope.ts"],"names":[],"mappings":"AAiCA,eAAO,MAAM,wBAAwB;;;;;yBAoEnC,CAAC"}
|
|
@@ -1,145 +1,205 @@
|
|
|
1
|
-
import { createRule, fileRef, getLocationContext,
|
|
2
|
-
import { getHttpOperation } from "@typespec/http";
|
|
3
|
-
import {
|
|
1
|
+
import { createRule, fileRef, getLocationContext, getNamespaceFullName, getPagingOperation, isArrayModelType, isList, isTemplateDeclaration, isTemplateDeclarationOrInstance, resolveEncodedName, walkPropertiesInherited, } from "@typespec/compiler";
|
|
2
|
+
import { createMetadataInfo, getHttpOperation, Visibility, } from "@typespec/http";
|
|
3
|
+
import { isCollectionPath } from "./utils.js";
|
|
4
4
|
export const listResponseEnvelopeRule = createRule({
|
|
5
5
|
name: "list-response-envelope",
|
|
6
6
|
docs: fileRef.fromPackageRoot("src/rules/list-response-envelope.md"),
|
|
7
|
-
description: "ARM list
|
|
7
|
+
description: "ARM list operations must declare paging metadata and use the standard response envelope.",
|
|
8
8
|
severity: "warning",
|
|
9
9
|
url: "https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/list-response-envelope",
|
|
10
10
|
messages: {
|
|
11
|
-
|
|
12
|
-
valueArray: "
|
|
11
|
+
invalidEnvelope: "Collection response models must contain exactly `value` and `nextLink` properties.",
|
|
12
|
+
valueArray: "Collection responses must declare a 'value' property of array type.",
|
|
13
|
+
missingList: "Collection GET operations must use `@list`.",
|
|
14
|
+
pagingMetadata: "Collection responses must use JSON-named `value` and `nextLink` properties with `@pageItems` and `@nextLink` metadata.",
|
|
13
15
|
},
|
|
14
16
|
create(context) {
|
|
17
|
+
const program = context.program;
|
|
18
|
+
const metadata = createMetadataInfo(program);
|
|
15
19
|
return {
|
|
16
20
|
operation: (operation) => {
|
|
17
|
-
|
|
18
|
-
const collection = operation.namespace !== undefined &&
|
|
19
|
-
getArmProviderNamespace(context.program, operation.namespace) !== undefined &&
|
|
20
|
-
httpOperation.verb === "get" &&
|
|
21
|
-
isCollectionGetPath(httpOperation.path);
|
|
22
|
-
const [paging] = isList(context.program, operation)
|
|
23
|
-
? getPagingOperation(context.program, operation)
|
|
24
|
-
: [];
|
|
25
|
-
const paged = getLocationContext(context.program, operation).type === "project" &&
|
|
26
|
-
paging?.output.nextLink !== undefined;
|
|
27
|
-
if (!collection && !paged) {
|
|
21
|
+
if (shouldSkipOperation(program, operation))
|
|
28
22
|
return;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
continue;
|
|
34
|
-
for (const { body } of response.responses) {
|
|
35
|
-
if (body === undefined)
|
|
36
|
-
continue;
|
|
37
|
-
const invalidValue = getInvalidValueTarget(operation, body.type);
|
|
38
|
-
if (invalidValue !== undefined) {
|
|
39
|
-
context.reportDiagnostic({
|
|
40
|
-
target: getDiagnosticTarget(context.program, operation, invalidValue),
|
|
41
|
-
messageId: "valueArray",
|
|
42
|
-
});
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
if (body.type.kind === "Model") {
|
|
46
|
-
const invalidTargets = getInvalidTargets(body.type);
|
|
47
|
-
for (const invalidTarget of invalidTargets) {
|
|
48
|
-
context.reportDiagnostic({
|
|
49
|
-
target: getDiagnosticTarget(context.program, operation, invalidTarget),
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
if (invalidTargets.length > 0)
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
const responseModel = get200ResponseModel(httpOperation.responses);
|
|
60
|
-
if (responseModel === undefined) {
|
|
23
|
+
const [httpOperation] = getHttpOperation(program, operation);
|
|
24
|
+
const list = isList(program, operation);
|
|
25
|
+
const collection = isCollectionGet(httpOperation.verb, httpOperation.path);
|
|
26
|
+
if (!list && !collection)
|
|
61
27
|
return;
|
|
62
|
-
|
|
63
|
-
const value = getProperty(responseModel, "value");
|
|
64
|
-
if (value !== undefined && (value.type.kind !== "Model" || !isArrayModelType(value.type))) {
|
|
28
|
+
if (!list) {
|
|
65
29
|
context.reportDiagnostic({
|
|
66
|
-
target: getDiagnosticTarget(
|
|
67
|
-
messageId: "
|
|
30
|
+
target: getDiagnosticTarget(program, operation, operation),
|
|
31
|
+
messageId: "missingList",
|
|
68
32
|
});
|
|
69
|
-
return;
|
|
70
33
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
34
|
+
const [paging] = getPagingOperation(program, operation);
|
|
35
|
+
const diagnostics = createDiagnosticCollector((target, messageId) => context.reportDiagnostic({
|
|
36
|
+
target: getDiagnosticTarget(program, operation, target),
|
|
37
|
+
messageId,
|
|
38
|
+
}));
|
|
39
|
+
if (list && collection && !paging?.output.nextLink) {
|
|
40
|
+
diagnostics.report(operation, "pagingMetadata");
|
|
75
41
|
}
|
|
42
|
+
for (const response of httpOperation.responses) {
|
|
43
|
+
if (!includes200(response.statusCodes))
|
|
44
|
+
continue;
|
|
45
|
+
for (const { body } of response.responses) {
|
|
46
|
+
if (body === undefined || body.bodyKind !== "single") {
|
|
47
|
+
if (list)
|
|
48
|
+
diagnostics.report(body?.property ?? operation, "valueArray");
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
checkResponseBody(program, operation, body.type, body.isExplicit, paging, list, metadata, diagnostics.report);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (list)
|
|
56
|
+
checkPagingMetadata(operation, program, paging, diagnostics);
|
|
57
|
+
diagnostics.emit();
|
|
76
58
|
},
|
|
77
59
|
};
|
|
78
60
|
},
|
|
79
61
|
});
|
|
80
|
-
function
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
return
|
|
62
|
+
function shouldSkipOperation(program, operation) {
|
|
63
|
+
if (isTemplateDeclarationOrInstance(operation) ||
|
|
64
|
+
(operation.interface !== undefined && isTemplateDeclaration(operation.interface))) {
|
|
65
|
+
return true;
|
|
84
66
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
67
|
+
if (getLocationContext(program, operation).type === "project")
|
|
68
|
+
return false;
|
|
69
|
+
return (operation.interface === undefined ||
|
|
70
|
+
getLocationContext(program, operation.interface).type !== "project");
|
|
89
71
|
}
|
|
90
|
-
function
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
72
|
+
function isCollectionGet(verb, path) {
|
|
73
|
+
return (verb === "get" &&
|
|
74
|
+
isCollectionPath(path.split("?")[0], {
|
|
75
|
+
excludeTerminalPathParameter: true,
|
|
76
|
+
excludeDefaultSegment: true,
|
|
77
|
+
}));
|
|
78
|
+
}
|
|
79
|
+
function createDiagnosticCollector(emitDiagnostic) {
|
|
80
|
+
const reported = new Map();
|
|
81
|
+
const report = (target, messageId) => {
|
|
82
|
+
let messages = reported.get(target);
|
|
83
|
+
if (!messages)
|
|
84
|
+
reported.set(target, (messages = new Set()));
|
|
85
|
+
messages.add(messageId);
|
|
86
|
+
};
|
|
87
|
+
const has = (messageId) => [...reported.values()].some((messages) => messages.has(messageId));
|
|
88
|
+
return {
|
|
89
|
+
report,
|
|
90
|
+
has,
|
|
91
|
+
hasPagingCloneDiagnostic: (original) => [...reported].some(([target, messages]) => target.kind === "ModelProperty" &&
|
|
92
|
+
messages.has("pagingMetadata") &&
|
|
93
|
+
isHttpPayloadCloneOf(target, original)),
|
|
94
|
+
emit: () => {
|
|
95
|
+
for (const [target, messages] of reported) {
|
|
96
|
+
for (const messageId of messages) {
|
|
97
|
+
emitDiagnostic(target, messageId);
|
|
98
|
+
}
|
|
103
99
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
return undefined;
|
|
100
|
+
},
|
|
101
|
+
};
|
|
108
102
|
}
|
|
109
|
-
function
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
for (const property of walkPropertiesInherited(responseModel)) {
|
|
114
|
-
if (property.name === "value") {
|
|
115
|
-
hasValue = true;
|
|
103
|
+
function checkResponseBody(program, operation, type, isExplicit, paging, list, metadata, report) {
|
|
104
|
+
if (type.kind === "Union") {
|
|
105
|
+
for (const variant of type.variants.values()) {
|
|
106
|
+
checkResponseBody(program, operation, variant.type, isExplicit, paging, list, metadata, report);
|
|
116
107
|
}
|
|
117
|
-
|
|
118
|
-
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
if (type.kind !== "Model" || isArrayModelType(type)) {
|
|
111
|
+
if (list)
|
|
112
|
+
report(type.kind === "Model" ? type : operation, "valueArray");
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const properties = [...walkPropertiesInherited(type)].filter((property) => metadata.isPayloadProperty(property, Visibility.Read, isExplicit));
|
|
116
|
+
const jsonName = (property) => resolveEncodedName(program, property, "application/json");
|
|
117
|
+
const value = properties.find((property) => jsonName(property) === "value");
|
|
118
|
+
const nextLink = properties.find((property) => jsonName(property) === "nextLink");
|
|
119
|
+
if (list && (!value || value.type.kind !== "Model" || !isArrayModelType(value.type))) {
|
|
120
|
+
report(value ?? type, "valueArray");
|
|
121
|
+
}
|
|
122
|
+
else if (list &&
|
|
123
|
+
value &&
|
|
124
|
+
paging?.output.pageItems.property !== value &&
|
|
125
|
+
!hasPagingDecorator(value, "@pageItems")) {
|
|
126
|
+
report(value, "pagingMetadata");
|
|
127
|
+
}
|
|
128
|
+
if (list && value && value.name !== "value")
|
|
129
|
+
report(value, "pagingMetadata");
|
|
130
|
+
if (list &&
|
|
131
|
+
nextLink &&
|
|
132
|
+
paging?.output.nextLink?.property !== nextLink &&
|
|
133
|
+
!hasPagingDecorator(nextLink, "@nextLink")) {
|
|
134
|
+
report(nextLink, "pagingMetadata");
|
|
135
|
+
}
|
|
136
|
+
if (list && nextLink && nextLink.name !== "nextLink")
|
|
137
|
+
report(nextLink, "pagingMetadata");
|
|
138
|
+
const hasExtraProperty = properties.some((property) => {
|
|
139
|
+
const name = jsonName(property);
|
|
140
|
+
return name !== "value" && name !== "nextLink";
|
|
141
|
+
});
|
|
142
|
+
let hasIndexer = false;
|
|
143
|
+
for (let model = type; model; model = model.baseModel) {
|
|
144
|
+
if (model.indexer !== undefined) {
|
|
145
|
+
hasIndexer = true;
|
|
146
|
+
break;
|
|
119
147
|
}
|
|
120
|
-
|
|
121
|
-
|
|
148
|
+
}
|
|
149
|
+
if (!value || !nextLink || hasExtraProperty || hasIndexer)
|
|
150
|
+
report(type, "invalidEnvelope");
|
|
151
|
+
}
|
|
152
|
+
function checkPagingMetadata(operation, program, paging, diagnostics) {
|
|
153
|
+
for (const pagingProperty of [paging?.output.pageItems, paging?.output.nextLink]) {
|
|
154
|
+
const property = pagingProperty?.property;
|
|
155
|
+
if (property &&
|
|
156
|
+
property.name !== resolveEncodedName(program, property, "application/json") &&
|
|
157
|
+
!diagnostics.hasPagingCloneDiagnostic(property)) {
|
|
158
|
+
diagnostics.report(property, "pagingMetadata");
|
|
122
159
|
}
|
|
123
160
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
161
|
+
if (paging === undefined &&
|
|
162
|
+
!diagnostics.has("pagingMetadata") &&
|
|
163
|
+
!diagnostics.has("valueArray")) {
|
|
164
|
+
diagnostics.report(operation, "pagingMetadata");
|
|
165
|
+
}
|
|
166
|
+
if (!(paging?.output.nextLink || hasNextLink(operation.returnType)) &&
|
|
167
|
+
!diagnostics.has("pagingMetadata")) {
|
|
168
|
+
diagnostics.report(operation, "pagingMetadata");
|
|
169
|
+
}
|
|
127
170
|
}
|
|
128
|
-
function
|
|
129
|
-
|
|
130
|
-
|
|
171
|
+
function includes200(status) {
|
|
172
|
+
return status === 200 || (typeof status === "object" && status.start <= 200 && status.end >= 200);
|
|
173
|
+
}
|
|
174
|
+
// HTTP may synthesize a filtered body model whose properties clone the original response properties.
|
|
175
|
+
function isHttpPayloadCloneOf(clone, original) {
|
|
176
|
+
const model = clone.model;
|
|
177
|
+
return (clone.sourceProperty === original &&
|
|
178
|
+
model?.node === undefined &&
|
|
179
|
+
model !== undefined &&
|
|
180
|
+
model.sourceModels.some(({ model: source }) => [...walkPropertiesInherited(source)].includes(original)));
|
|
181
|
+
}
|
|
182
|
+
// Paging metadata can be absent or point to another property when the compiler reports errors.
|
|
183
|
+
function hasPagingDecorator(property, name) {
|
|
184
|
+
return property.decorators.some((x) => x.definition?.name === name && getNamespaceFullName(x.definition.namespace) === "TypeSpec");
|
|
185
|
+
}
|
|
186
|
+
function hasNextLink(type, visited = new Set()) {
|
|
187
|
+
if (visited.has(type))
|
|
188
|
+
return false;
|
|
189
|
+
visited.add(type);
|
|
190
|
+
if (type.kind === "Union") {
|
|
191
|
+
return [...type.variants.values()].some((variant) => hasNextLink(variant.type, visited));
|
|
131
192
|
}
|
|
132
|
-
if (
|
|
133
|
-
return
|
|
193
|
+
if (type.kind === "Model") {
|
|
194
|
+
return [...walkPropertiesInherited(type)].some((property) => hasPagingDecorator(property, "@nextLink") || hasNextLink(property.type, visited));
|
|
134
195
|
}
|
|
135
|
-
return
|
|
196
|
+
return false;
|
|
136
197
|
}
|
|
137
|
-
function
|
|
138
|
-
if (type
|
|
139
|
-
return
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
return value.type.kind === "Model" && isArrayModelType(value.type) ? undefined : value;
|
|
198
|
+
function getDiagnosticTarget(program, operation, target) {
|
|
199
|
+
if (getLocationContext(program, target).type === "project")
|
|
200
|
+
return target;
|
|
201
|
+
return getLocationContext(program, operation).type === "project"
|
|
202
|
+
? operation
|
|
203
|
+
: (operation.interface ?? operation);
|
|
144
204
|
}
|
|
145
205
|
//# sourceMappingURL=list-response-envelope.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-response-envelope.js","sourceRoot":"","sources":["../../../src/rules/list-response-envelope.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"list-response-envelope.js","sourceRoot":"","sources":["../../../src/rules/list-response-envelope.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,OAAO,EACP,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,MAAM,EACN,qBAAqB,EACrB,+BAA+B,EAC/B,kBAAkB,EAClB,uBAAuB,GAOxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,UAAU,GAEX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAQ9C,MAAM,CAAC,MAAM,wBAAwB,GAAG,UAAU,CAAC;IACjD,IAAI,EAAE,wBAAwB;IAC9B,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,qCAAqC,CAAC;IACpE,WAAW,EACT,0FAA0F;IAC5F,QAAQ,EAAE,SAAS;IACnB,GAAG,EAAE,2GAA2G;IAChH,QAAQ,EAAE;QACR,eAAe,EACb,oFAAoF;QACtF,UAAU,EAAE,qEAAqE;QACjF,WAAW,EAAE,6CAA6C;QAC1D,cAAc,EACZ,wHAAwH;KAC3H;IACD,MAAM,CAAC,OAAO;QACZ,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAChC,MAAM,QAAQ,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;QAC7C,OAAO;YACL,SAAS,EAAE,CAAC,SAAS,EAAE,EAAE;gBACvB,IAAI,mBAAmB,CAAC,OAAO,EAAE,SAAS,CAAC;oBAAE,OAAO;gBAEpD,MAAM,CAAC,aAAa,CAAC,GAAG,gBAAgB,CAAC,OAAO,EAAE,SAAS,CAAC,CAA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IAAI,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QAC1B,OAAO,CAAC,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAC5C,CAAC,QAAQ,EAAE,EAAE,CACX,kBAAkB,CAAC,QAAQ,EAAE,WAAW,CAAC,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CACnF,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,mBAAmB,CAC1B,OAAgB,EAChB,SAAoB,EACpB,MAAyC;IAEzC,IAAI,kBAAkB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC;IAC1E,OAAO,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,IAAI,KAAK,SAAS;QAC9D,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,IAAI,SAAS,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -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;;
|
|
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 (
|
|
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,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"no-query-in-collection.js","sourceRoot":"","sources":["../../../src/rules/no-query-in-collection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEzE,MAAM,CAAC,MAAM,uBAAuB,GAAG,UAAU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C;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.
|
|
3
|
+
"version": "0.75.0-dev.3",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
5
|
"description": "TypeSpec Azure Resource Manager library",
|
|
6
6
|
"homepage": "https://azure.github.io/typespec-azure",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"@azure-tools/typespec-azure-core": "^0.74.0 || >= 0.75.0-dev.0",
|
|
51
51
|
"@typespec/compiler": "^1.18.0",
|
|
52
52
|
"@typespec/rest": "^0.88.0",
|
|
53
|
-
"@typespec/http": "^1.18.0",
|
|
54
53
|
"@typespec/openapi": "^1.18.0",
|
|
54
|
+
"@typespec/http": "^1.18.0",
|
|
55
55
|
"@typespec/versioning": "^0.88.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
@@ -63,9 +63,9 @@
|
|
|
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
|
-
"@typespec/http": "^1.18.0",
|
|
68
66
|
"@typespec/compiler": "^1.18.0",
|
|
67
|
+
"@typespec/http": "^1.18.0",
|
|
68
|
+
"@typespec/library-linter": "^0.88.0",
|
|
69
69
|
"@typespec/rest": "^0.88.0",
|
|
70
70
|
"@typespec/tspd": "^0.78.0",
|
|
71
71
|
"@typespec/versioning": "^0.88.0",
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const listOperationMissingPageableRule: import("@typespec/compiler").LinterRuleDefinition<"list-operation-missing-pageable", {
|
|
2
|
-
readonly default: "This GET operation uses a collection route but does not define TypeSpec paging metadata. Use an ARM list operation template or add `@list` with `@pageItems` and `@nextLink`.";
|
|
3
|
-
}, Record<string, never>>;
|
|
4
|
-
//# sourceMappingURL=list-operation-missing-pageable.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list-operation-missing-pageable.d.ts","sourceRoot":"","sources":["../../../src/rules/list-operation-missing-pageable.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,gCAAgC;;yBAkD3C,CAAC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { createRule, fileRef, getPagingOperation, isList, isTemplateDeclaration, } from "@typespec/compiler";
|
|
2
|
-
import { getHttpOperation } from "@typespec/http";
|
|
3
|
-
import { getArmProviderNamespace } from "../namespace.js";
|
|
4
|
-
import { isCollectionPath } from "./utils.js";
|
|
5
|
-
export const listOperationMissingPageableRule = createRule({
|
|
6
|
-
name: "list-operation-missing-pageable",
|
|
7
|
-
docs: fileRef.fromPackageRoot("src/rules/list-operation-missing-pageable.md"),
|
|
8
|
-
description: "ARM GET operations on list paths must define TypeSpec paging metadata.",
|
|
9
|
-
severity: "warning",
|
|
10
|
-
url: "https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/list-operation-missing-pageable",
|
|
11
|
-
messages: {
|
|
12
|
-
default: "This GET operation uses a collection route but does not define TypeSpec paging metadata. Use an ARM list operation template or add `@list` with `@pageItems` and `@nextLink`.",
|
|
13
|
-
},
|
|
14
|
-
create(context) {
|
|
15
|
-
return {
|
|
16
|
-
operation: (operation) => {
|
|
17
|
-
if (isTemplateDeclaration(operation) ||
|
|
18
|
-
(operation.interface !== undefined && isTemplateDeclaration(operation.interface))) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
const namespace = operation.interface?.namespace ?? operation.namespace;
|
|
22
|
-
if (namespace === undefined ||
|
|
23
|
-
getArmProviderNamespace(context.program, namespace) === undefined) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
const [httpOperation] = getHttpOperation(context.program, operation);
|
|
27
|
-
if (httpOperation.verb !== "get" ||
|
|
28
|
-
!isCollectionPath(httpOperation.path, {
|
|
29
|
-
excludeTerminalPathParameter: true,
|
|
30
|
-
excludeDefaultSegment: true,
|
|
31
|
-
})) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
const [pagingOperation] = getPagingOperation(context.program, operation);
|
|
35
|
-
if (isList(context.program, operation) && pagingOperation?.output.nextLink !== undefined) {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
context.reportDiagnostic({
|
|
39
|
-
target: operation,
|
|
40
|
-
});
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
},
|
|
44
|
-
});
|
|
45
|
-
//# sourceMappingURL=list-operation-missing-pageable.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list-operation-missing-pageable.js","sourceRoot":"","sources":["../../../src/rules/list-operation-missing-pageable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,OAAO,EACP,kBAAkB,EAClB,MAAM,EACN,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,MAAM,CAAC,MAAM,gCAAgC,GAAG,UAAU,CAAC;IACzD,IAAI,EAAE,iCAAiC;IACvC,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,8CAA8C,CAAC;IAC7E,WAAW,EAAE,wEAAwE;IACrF,QAAQ,EAAE,SAAS;IACnB,GAAG,EAAE,oHAAoH;IACzH,QAAQ,EAAE;QACR,OAAO,EACL,+KAA+K;KAClL;IACD,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