diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index b812ce27f..10d49049b 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -22,6 +22,9 @@ jobs: - script: 'node common/scripts/install-run-rush.js regen-ruleindex' displayName: 'rush regen rule index' + + - script: 'node common/scripts/install-run-rush.js prettier-check' + displayName: 'prettier' - script: node common/scripts/install-run-rush.js change -v condition: and(succeeded(), not(or(startsWith(variables['System.PullRequest.SourceBranch'], 'publish/'), startsWith(variables['System.PullRequest.SourceBranch'], 'backmerge/')))) diff --git a/.prettierrc b/.prettierrc index b3cee2db7..ad5c7ecf5 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,4 +1,4 @@ { "semi": false, "printWidth": 140 -} +} \ No newline at end of file diff --git a/common/changes/@microsoft.azure/openapi-validator-rulesets/some-fixes_2023-01-30-06-50.json b/common/changes/@microsoft.azure/openapi-validator-rulesets/some-fixes_2023-01-30-06-50.json new file mode 100644 index 000000000..9b6255093 --- /dev/null +++ b/common/changes/@microsoft.azure/openapi-validator-rulesets/some-fixes_2023-01-30-06-50.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@microsoft.azure/openapi-validator-rulesets", + "comment": "bugfix for 4 rules", + "type": "patch" + } + ], + "packageName": "@microsoft.azure/openapi-validator-rulesets" +} \ No newline at end of file diff --git a/common/config/rush/command-line.json b/common/config/rush/command-line.json index caeab1db6..f03516bf6 100644 --- a/common/config/rush/command-line.json +++ b/common/config/rush/command-line.json @@ -57,6 +57,18 @@ "name": "lint", "summary": "Lint projects. Runs `npm run lint` on all projects.", "enableParallelism": true + }, + { + "commandKind": "bulk", + "name": "prettier", + "summary": "Using prettier to format code.", + "enableParallelism": true + }, + { + "commandKind": "bulk", + "name": "prettier-check", + "summary": "Using prettier to check code style.", + "enableParallelism": true } ] -} +} \ No newline at end of file diff --git a/docs/missing-default-response.md b/docs/missing-default-response.md new file mode 100644 index 000000000..ac2a2e13e --- /dev/null +++ b/docs/missing-default-response.md @@ -0,0 +1,29 @@ +# MissingDefaultResponse + +## Category + +Management Plane Error + +## Applies to + +Management Plane OpenAPI specs + +## Output Message + +Operation is missing a default response. + +## Description + +All operations should have a default (error) response. + +## CreatedAt + +January 30, 2023 + +## LastModifiedAt + +January 30, 2023 + +## How to fix the violation + +Add a default response for the operation. diff --git a/docs/rules.md b/docs/rules.md index d78604ca9..686f14817 100644 --- a/docs/rules.md +++ b/docs/rules.md @@ -50,7 +50,7 @@ Please refer to [api-version-enum.md](./api-version-enum.md) for details. ### ApiVersionParameterRequired -This rule applies when the 'api-version' parameter is missing in any operations. +Operation is missing the 'api-version' parameter. Please refer to [api-version-parameter-required.md](./api-version-parameter-required.md) for details. @@ -59,10 +59,6 @@ Please refer to [api-version-parameter-required.md](./api-version-parameter-requ The API Version parameter MUST be in the Year-Month-Date format (i.e. 2016-07-04.) NOTE that this is the en-US ordering of month and date. The date MAY optionally be followed by one of: * -preview - Indicates the API version is in (public) preview -* -alpha -* -beta -* -rc (release candidate) -* -privatepreview Please refer to [api-version-pattern.md](./api-version-pattern.md) for details. @@ -484,6 +480,12 @@ The long running operation with final-state-via:original-uri should have a sibli Please refer to [lro-with-original-url-as-final-state.md](./lro-with-original-url-as-final-state.md) for details. +### MissingDefaultResponse + +All operations should have a default (error) response. + +Please refer to [missing-default-response.md](./missing-default-response.md) for details. + ### MissingTypeObject The rule should apply to any schema with "properties" or "additionalProperties". It is to ensure a schema with "properties" or "additionalProperties" must have explicit "type:object" statement, which means a schema is an object. @@ -763,7 +765,7 @@ Please refer to [path-parameter-schema.md](./path-parameter-schema.md) for detai ### PathResourceProviderMatchNamespace -Verifies whether the last resource provider matches namespace or not. E.g the path /providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.Insights/extResource/{extType}' is allowed only if Microsoft.Insights matches the namespace (Microsoft.Insights). +Verifies whether the resource provider namespace in the last segment of the path matches the namespace to which the specification file belongs. E.g the path /providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.Insights/extResource/{extType}' is allowed only if the segment /Microsoft.Insights matches the namespace name to which the specification file belongs (Microsoft.Insights). Please refer to [path-resource-provider-match-namespace.md](./path-resource-provider-match-namespace.md) for details. diff --git a/packages/azure-openapi-validator/autorest/.eslintrc.yaml b/packages/azure-openapi-validator/autorest/.eslintrc.yaml index 7705b771a..3097c4e7a 100644 --- a/packages/azure-openapi-validator/autorest/.eslintrc.yaml +++ b/packages/azure-openapi-validator/autorest/.eslintrc.yaml @@ -2,4 +2,4 @@ parser: "@typescript-eslint/parser" extends: - "../../../.eslintrc.yaml" rules: - no-console: off + no-console: off diff --git a/packages/azure-openapi-validator/autorest/CHANGELOG.md b/packages/azure-openapi-validator/autorest/CHANGELOG.md index d356d9721..a611b4be4 100644 --- a/packages/azure-openapi-validator/autorest/CHANGELOG.md +++ b/packages/azure-openapi-validator/autorest/CHANGELOG.md @@ -3,7 +3,7 @@ This log was last generated on Thu, 24 Nov 2022 04:00:42 GMT and should not be manually modified. ## 2.0.0 + Thu, 24 Nov 2022 04:00:42 GMT _Initial release_ - diff --git a/packages/azure-openapi-validator/autorest/package.json b/packages/azure-openapi-validator/autorest/package.json index c9f1bdf41..ddaca9f4f 100644 --- a/packages/azure-openapi-validator/autorest/package.json +++ b/packages/azure-openapi-validator/autorest/package.json @@ -8,7 +8,9 @@ "build": "tsc", "test": "tsc", "lint:fix": "eslint ./src --fix --ext .ts", - "lint": "eslint ./src --ext .ts --max-warnings=0" + "lint": "eslint ./src --ext .ts --max-warnings=0", + "prettier": "prettier -w .", + "prettier-check": "prettier -c ." }, "repository": { "type": "git", diff --git a/packages/azure-openapi-validator/autorest/readme.md b/packages/azure-openapi-validator/autorest/readme.md index c3c0be873..8b5062705 100644 --- a/packages/azure-openapi-validator/autorest/readme.md +++ b/packages/azure-openapi-validator/autorest/readme.md @@ -4,21 +4,21 @@ Azure OpenAPI validator (Typescript) ## Validation -``` yaml $(azure-validator) && $(v3) +```yaml $(azure-validator) && $(v3) pipeline: swagger-document/openapi-validator: input: swagger-document/loader-swagger - scope: azure-validator-individual + scope: azure-validator-individual ``` -``` yaml $(spectral) && $(v3) +```yaml $(spectral) && $(v3) pipeline: swagger-document/spectral: input: swagger-document/loader-swagger - scope: azure-validator-individual + scope: azure-validator-individual ``` -``` yaml $(azure-validator) || $(spectral) || $(v3) +```yaml $(azure-validator) || $(spectral) || $(v3) azure-validator-composed: merge-state: composed azure-validator-individual: diff --git a/packages/azure-openapi-validator/autorest/src/index.ts b/packages/azure-openapi-validator/autorest/src/index.ts index ff48ea27d..f67353db9 100644 --- a/packages/azure-openapi-validator/autorest/src/index.ts +++ b/packages/azure-openapi-validator/autorest/src/index.ts @@ -3,21 +3,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { fileURLToPath } from 'url'; -import { createFileOrFolderUri, resolveUri } from "@azure-tools/uri"; -import {lint, getOpenapiType, LintResultMessage, isUriAbsolute, isExample} from "@microsoft.azure/openapi-validator-core" -import {nativeRulesets} from "@microsoft.azure/openapi-validator-rulesets" -import {Resolver} from "@stoplight/json-ref-resolver" +import { fileURLToPath } from "url" +import { createFileOrFolderUri, resolveUri } from "@azure-tools/uri" +import { lint, getOpenapiType, LintResultMessage, isUriAbsolute, isExample } from "@microsoft.azure/openapi-validator-core" +import { nativeRulesets } from "@microsoft.azure/openapi-validator-rulesets" +import { Resolver } from "@stoplight/json-ref-resolver" import { safeLoad } from "js-yaml" import { AutoRestPluginHost } from "./jsonrpc/plugin-host" import { JsonPath, Message } from "./jsonrpc/types" -import {getRuleSet,mergeRulesets} from "./loader" +import { getRuleSet, mergeRulesets } from "./loader" const { Spectral } = require("@stoplight/spectral-core") +const cachedFiles = new Map() -const cachedFiles = new Map() - -function convertLintMsgToAutoRestMsg(message:LintResultMessage):Message { +function convertLintMsgToAutoRestMsg(message: LintResultMessage): Message { // try to extract provider namespace and resource type const path = message.jsonpath?.[1] === "paths" && message.jsonpath[2] const pathComponents = typeof path === "string" && path.split("/") @@ -32,26 +31,25 @@ function convertLintMsgToAutoRestMsg(message:LintResultMessage):Message { Key: [message.code], Source: [ { - document : message?.sources?.[0] || "", + document: message?.sources?.[0] || "", Position: { path: message.jsonpath, //...message.range?.start as Position - } - } + }, + }, ], Details: { - jsonpath:message.jsonpath, + jsonpath: message.jsonpath, validationCategory: message.category, providerNamespace: pathComponentProviderNamespace, resourceType: pathComponentResourceType, range: message.range, - } + }, } return msg } -async function runSpectral(doc:any,filePath:string, sendMessage: (m: Message) => void, spectral:any) { - +async function runSpectral(doc: any, filePath: string, sendMessage: (m: Message) => void, spectral: any) { const mergedResults = [] const convertSeverity = (severity: number) => { switch (severity) { @@ -69,26 +67,25 @@ async function runSpectral(doc:any,filePath:string, sendMessage: (m: Message) => return { start: { line: range.start.line + 1, - column: range.start.character + column: range.start.character, }, end: { line: range.end.line + 1, - column: range.end.character - } + column: range.end.character, + }, } } // this function is added temporarily , should be remove after the autorest fix this issues. - const removeXmsExampleFromPath = (paths:JsonPath) => { - const index = paths.findIndex(item => item === "x-ms-examples") - if (index !== -1 && paths.length > index+2) { - return paths.slice(0,index+2) + const removeXmsExampleFromPath = (paths: JsonPath) => { + const index = paths.findIndex((item) => item === "x-ms-examples") + if (index !== -1 && paths.length > index + 2) { + return paths.slice(0, index + 2) } return paths } - const format = (result:any, spec:string) => { - + const format = (result: any, spec: string) => { return { code: result.code, message: result.message, @@ -98,12 +95,12 @@ async function runSpectral(doc:any,filePath:string, sendMessage: (m: Message) => sources: [`${spec}`], location: { line: result.range.start.line + 1, - column: result.range.start.character - } + column: result.range.start.character, + }, } } const results = await spectral.run(doc) - mergedResults.push(...results.map((result:any) => format(result, createFileOrFolderUri(filePath)))) + mergedResults.push(...results.map((result: any) => format(result, createFileOrFolderUri(filePath)))) for (const message of mergedResults) { sendMessage(convertLintMsgToAutoRestMsg(message)) } @@ -111,12 +108,12 @@ async function runSpectral(doc:any,filePath:string, sendMessage: (m: Message) => return mergedResults } -function isCommonTypes(filePath:string) { +function isCommonTypes(filePath: string) { const regex = new RegExp(/.*common-types\/resource-management\/v.*.json/) return regex.test(filePath) } -async function getOpenapiTypeStr(initiator:any) { +async function getOpenapiTypeStr(initiator: any) { let openapiType: string = await initiator.GetValue("openapi-type") let subType: string = await initiator.GetValue("openapi-subtype") subType = subType === "providerHub" ? "rpaas" : subType @@ -126,17 +123,16 @@ async function getOpenapiTypeStr(initiator:any) { return openapiType } - async function main() { const pluginHost = new AutoRestPluginHost() - pluginHost.Add("openapi-validator", async initiator => { - const files = await (await initiator.ListInputs()).filter(f => !isCommonTypes(f)) + pluginHost.Add("openapi-validator", async (initiator) => { + const files = await (await initiator.ListInputs()).filter((f) => !isCommonTypes(f)) const openapiType: string = await getOpenapiTypeStr(initiator) - const sendMessage = (msg:LintResultMessage)=> { - initiator.Message(convertLintMsgToAutoRestMsg(msg)) + const sendMessage = (msg: LintResultMessage) => { + initiator.Message(convertLintMsgToAutoRestMsg(msg)) } - const readFile = async (fileUri:string) => { + const readFile = async (fileUri: string) => { if (isExample(fileUri)) { return "" } @@ -146,88 +142,87 @@ async function main() { if (!file) { throw new Error(`Could not read file: ${fileUri} .`) } - cachedFiles.set(fileUri,file) + cachedFiles.set(fileUri, file) } return file } const defaultFleSystem = { - read: readFile + read: readFile, } initiator.Message({ Channel: "verbose", - Text: `Validating '${files.join("\n")}'` + Text: `Validating '${files.join("\n")}'`, }) try { const mergedRuleset = mergeRulesets(Object.values(nativeRulesets)) - await lint(files,{ruleSet:mergedRuleset, fileSystem:defaultFleSystem,openapiType:getOpenapiType(openapiType)},sendMessage) + await lint(files, { ruleSet: mergedRuleset, fileSystem: defaultFleSystem, openapiType: getOpenapiType(openapiType) }, sendMessage) } catch (e) { initiator.Message({ Channel: "fatal", - Text: `Failed validating:` + e + Text: `Failed validating:` + e, }) } }) - pluginHost.Add("spectral", async initiator => { - const files = (await initiator.ListInputs()).filter(f => !isCommonTypes(f)) + pluginHost.Add("spectral", async (initiator) => { + const files = (await initiator.ListInputs()).filter((f) => !isCommonTypes(f)) const openapiType: string = await getOpenapiTypeStr(initiator) - - const readFile = async (fileUri:string) => { + + const readFile = async (fileUri: string) => { let file = cachedFiles.get(fileUri) if (!file) { file = await initiator.ReadFile(fileUri) if (!file) { throw new Error(`Could not read file: ${fileUri} .`) } - cachedFiles.set(fileUri,file) + cachedFiles.set(fileUri, file) } return file } - + const rules = await getRuleSet(getOpenapiType(openapiType)) for (const file of files) { if (file.includes("common-types/resource-management")) { continue } - const resolveFile = (uri:any) =>{ - const ref = uri.href(); - const fileUri = isUriAbsolute(ref) ? ref : resolveUri(file,ref) - const content = readFile(fileUri); - return content - } + const resolveFile = (uri: any) => { + const ref = uri.href() + const fileUri = isUriAbsolute(ref) ? ref : resolveUri(file, ref) + const content = readFile(fileUri) + return content + } const resolver = new Resolver({ - resolvers: { - file: { - resolve: resolveFile - }, - http: { - resolve: resolveFile + resolvers: { + file: { + resolve: resolveFile, + }, + http: { + resolve: resolveFile, + }, + https: { + resolve: resolveFile, + }, }, - https:{ - resolve: resolveFile - } - }, - }); - const spectral = new Spectral({resolver}) - spectral.setRuleset(rules) + }) + const spectral = new Spectral({ resolver }) + spectral.setRuleset(rules) initiator.Message({ Channel: "verbose", - Text: `Validating '${file}'` + Text: `Validating '${file}'`, }) try { const openapiDefinitionDocument = await readFile(file) const openapiDefinitionObject = safeLoad(openapiDefinitionDocument) const normolizedFile = file.startsWith("file:///") ? fileURLToPath(file) : file - await runSpectral(openapiDefinitionObject,normolizedFile, initiator.Message.bind(initiator),spectral) - + await runSpectral(openapiDefinitionObject, normolizedFile, initiator.Message.bind(initiator), spectral) } catch (e) { initiator.Message({ Channel: "fatal", - Text: `Failed validating: '${file}', error encountered: ` + e + Text: `Failed validating: '${file}', error encountered: ` + e, }) } } @@ -239,4 +234,4 @@ async function main() { main().then( () => {}, () => {} -) \ No newline at end of file +) diff --git a/packages/azure-openapi-validator/autorest/src/jsonrpc/plugin-host.ts b/packages/azure-openapi-validator/autorest/src/jsonrpc/plugin-host.ts index 65fe0a48e..2edc7da3e 100644 --- a/packages/azure-openapi-validator/autorest/src/jsonrpc/plugin-host.ts +++ b/packages/azure-openapi-validator/autorest/src/jsonrpc/plugin-host.ts @@ -2,14 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { - createMessageConnection, - NotificationType2, - NotificationType4, - RequestType0, - RequestType1, - RequestType2 -} from "vscode-jsonrpc" +import { createMessageConnection, NotificationType2, NotificationType4, RequestType0, RequestType1, RequestType2 } from "vscode-jsonrpc" import { Mapping, Message, RawSourceMap } from "./types" namespace IAutoRestPluginTarget_Types { @@ -56,7 +49,7 @@ export class AutoRestPluginHost { }, warn(message) { console.error("warn: ", message) - } + }, }) channel.onRequest(IAutoRestPluginTarget_Types.GetPluginNames, async () => Object.keys(this.plugins)) @@ -82,14 +75,14 @@ export class AutoRestPluginHost { }, Message(message: Message): void { channel.sendNotification(IAutoRestPluginInitiator_Types.Message, sessionId, message) - } + }, }) return true } catch (e) { channel.sendNotification(IAutoRestPluginInitiator_Types.Message, sessionId, { Channel: "fatal" as any, Text: "" + e, - Details: e + Details: e, } as Message) return false } diff --git a/packages/azure-openapi-validator/autorest/src/loader.ts b/packages/azure-openapi-validator/autorest/src/loader.ts index 0d5579090..399f1319e 100644 --- a/packages/azure-openapi-validator/autorest/src/loader.ts +++ b/packages/azure-openapi-validator/autorest/src/loader.ts @@ -2,24 +2,24 @@ import { IRuleSet, OpenApiTypes } from "@microsoft.azure/openapi-validator-core" import { spectralRulesets } from "@microsoft.azure/openapi-validator-rulesets" import { Ruleset } from "@stoplight/spectral-core" -export async function getRuleSet(openapiType:OpenApiTypes) { - let ruleset - switch(openapiType) { - case OpenApiTypes.arm :{ +export async function getRuleSet(openapiType: OpenApiTypes) { + let ruleset + switch (openapiType) { + case OpenApiTypes.arm: { ruleset = spectralRulesets.azARM - break; + break } - case OpenApiTypes.dataplane:{ + case OpenApiTypes.dataplane: { ruleset = spectralRulesets.azDataplane - break; + break } default: { ruleset = spectralRulesets.azCommon } } - return new Ruleset(ruleset,{severity:"recommended"}) - /*const ruleset = await bundleRuleset(rulesetFile, { + return new Ruleset(ruleset, { severity: "recommended" }) + /*const ruleset = await bundleRuleset(rulesetFile, { target: 'node', format: 'commonjs', plugins: [builtins(), commonjs(), ...node({ fs, fetch })], @@ -29,18 +29,18 @@ export async function getRuleSet(openapiType:OpenApiTypes) { source: rulesetFile, }); */ } - -export const mergeRulesets = (rulesets:IRuleSet[]):IRuleSet=> { + +export const mergeRulesets = (rulesets: IRuleSet[]): IRuleSet => { let rules = {} - rulesets.forEach((set)=> { + rulesets.forEach((set) => { rules = { ...rules, - ...set.rules + ...set.rules, } }) const mergedRuleSet: IRuleSet = { documentationUrl: "", - rules - } + rules, + } return mergedRuleSet -} \ No newline at end of file +} diff --git a/packages/azure-openapi-validator/autorest/tsconfig.json b/packages/azure-openapi-validator/autorest/tsconfig.json index b6977c782..9a2b453ba 100644 --- a/packages/azure-openapi-validator/autorest/tsconfig.json +++ b/packages/azure-openapi-validator/autorest/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../tsconfig-base.json", - "include": [ - "./src/**/*.ts" - ], - "compilerOptions": { - "outDir": "dist" - } -} \ No newline at end of file + "extends": "../../../tsconfig-base.json", + "include": ["./src/**/*.ts"], + "compilerOptions": { + "outDir": "dist" + } +} diff --git a/packages/azure-openapi-validator/core/.eslintrc.yaml b/packages/azure-openapi-validator/core/.eslintrc.yaml index bf277beb9..9705e1115 100644 --- a/packages/azure-openapi-validator/core/.eslintrc.yaml +++ b/packages/azure-openapi-validator/core/.eslintrc.yaml @@ -2,8 +2,8 @@ parser: "@typescript-eslint/parser" extends: - "../../../.eslintrc.yaml" rules: - unicorn/filename-case: + unicorn/filename-case: - warn - cases: - kebabCase: true - camelCase: true \ No newline at end of file + kebabCase: true + camelCase: true diff --git a/packages/azure-openapi-validator/core/index.ts b/packages/azure-openapi-validator/core/index.ts index 6297d0a46..4d39a12bd 100644 --- a/packages/azure-openapi-validator/core/index.ts +++ b/packages/azure-openapi-validator/core/index.ts @@ -9,5 +9,3 @@ export * from "./src/runner" export * from "./src/ruleLoader" export * from "./src/api" export * from "./src/utils" - - diff --git a/packages/azure-openapi-validator/core/package.json b/packages/azure-openapi-validator/core/package.json index ade01fd48..8dc0842ed 100644 --- a/packages/azure-openapi-validator/core/package.json +++ b/packages/azure-openapi-validator/core/package.json @@ -7,7 +7,9 @@ "build": "tsc", "test": "npm run build && jest", "lint:fix": "eslint ./src --fix --ext .ts", - "lint": "eslint ./src --ext .ts --max-warnings=0" + "lint": "eslint ./src --ext .ts --max-warnings=0", + "prettier": "prettier -w .", + "prettier-check": "prettier -c ." }, "repository": { "type": "git", @@ -81,4 +83,4 @@ ], "preset": "ts-jest" } -} \ No newline at end of file +} diff --git a/packages/azure-openapi-validator/core/src/document.ts b/packages/azure-openapi-validator/core/src/document.ts index 51e94eace..e3a8d2431 100644 --- a/packages/azure-openapi-validator/core/src/document.ts +++ b/packages/azure-openapi-validator/core/src/document.ts @@ -1,13 +1,12 @@ import { JsonInstance, JsonParser } from "./jsonParser" import { Resolver } from "./resolver" -import { JsonPath,IFileSystem } from "./types" +import { JsonPath, IFileSystem } from "./types" export class OpenapiDocument { - private _content :string|undefined = undefined - private _doc:any = undefined + private _content: string | undefined = undefined + private _doc: any = undefined private jsonInstance: JsonInstance private resolver: Resolver - constructor(private _specPath: string, private parser: JsonParser,private fileSystem:IFileSystem) { - } + constructor(private _specPath: string, private parser: JsonParser, private fileSystem: IFileSystem) {} async resolve() { this._content = await this.fileSystem.read(this._specPath) this.jsonInstance = this.parser.parse(this._content) diff --git a/packages/azure-openapi-validator/core/src/jsonParser.ts b/packages/azure-openapi-validator/core/src/jsonParser.ts index 1316eaa3c..32dfd1802 100644 --- a/packages/azure-openapi-validator/core/src/jsonParser.ts +++ b/packages/azure-openapi-validator/core/src/jsonParser.ts @@ -12,7 +12,7 @@ export interface IJsonParser { export class JsonParser implements IJsonParser { parse(text: string) { - const errors :any[] = [] + const errors: any[] = [] const rootNode = parseTree(text, errors, { disallowComments: true }) if (errors.length || rootNode == undefined) { throw new Error("Parser failed with errors:" + JSON.stringify(errors)) @@ -35,7 +35,7 @@ export class JsonParser implements IJsonParser { }, getValue: () => { return Object.assign({}, getNodeValue(rootNode)) - } + }, } } } @@ -52,13 +52,13 @@ function getLocation(text: string, offset: number) { } return { line, - column + column, } } function getRange(text: string, node: Node) { return { start: getLocation(text, node.offset), - end: getLocation(text, node.offset + node.length) + end: getLocation(text, node.offset + node.length), } } diff --git a/packages/azure-openapi-validator/core/src/jsonpath.ts b/packages/azure-openapi-validator/core/src/jsonpath.ts index f95eebfe9..52e627ec3 100644 --- a/packages/azure-openapi-validator/core/src/jsonpath.ts +++ b/packages/azure-openapi-validator/core/src/jsonpath.ts @@ -3,13 +3,11 @@ import * as JSONPath from "jsonpath-plus" export function nodes(obj: any, pathExpression: string) { try { const result = JSONPath.JSONPath({ json: obj, path: pathExpression, resultType: "all" }) - return result.map((v:any) => ({ path: JSONPath.JSONPath.toPathArray(v.path), value: v.value, parent: v.parent })) + return result.map((v: any) => ({ path: JSONPath.JSONPath.toPathArray(v.path), value: v.value, parent: v.parent })) + } catch (e) { + // throw new Error(`Encountered exception when run jsonpath ${pathExpression}, ${JSON.stringify(e)}`) + return [] } - catch(e) { - // throw new Error(`Encountered exception when run jsonpath ${pathExpression}, ${JSON.stringify(e)}`) - return [] - } - } export function stringify(path: string[]) { diff --git a/packages/azure-openapi-validator/core/src/resolver.ts b/packages/azure-openapi-validator/core/src/resolver.ts index a42ae16f6..213aa37cc 100644 --- a/packages/azure-openapi-validator/core/src/resolver.ts +++ b/packages/azure-openapi-validator/core/src/resolver.ts @@ -1,5 +1,5 @@ -import { resolveUri } from "@azure-tools/uri"; -import { isExample, traverse ,isUriAbsolute} from "./utils" +import { resolveUri } from "@azure-tools/uri" +import { isExample, traverse, isUriAbsolute } from "./utils" export class Resolver { private references = new Set() @@ -9,7 +9,7 @@ export class Resolver { async resolve() { const references = this.references const currentFile = this.currentFile - await traverse(this.innerDoc, ["/"], new Set(), {references,currentFile}, updateFileRefs) + await traverse(this.innerDoc, ["/"], new Set(), { references, currentFile }, updateFileRefs) } getReferences() { @@ -17,15 +17,15 @@ export class Resolver { } } -const updateFileRefs = (node: any, path: string[], ctx: any) =>{ +const updateFileRefs = (node: any, path: string[], ctx: any) => { if (typeof node === "object" && typeof node.$ref === "string") { const slices = node.$ref.split("#") as string[] if (slices.length === 2 && slices[0] && !isUriAbsolute(slices[0])) { - const referenceFile = resolveUri(ctx.currentFile,slices[0]) + const referenceFile = resolveUri(ctx.currentFile, slices[0]) node.$ref = referenceFile + `#${slices[1]}` if (!isExample(referenceFile)) ctx.references.add(referenceFile) } return false } return true -} \ No newline at end of file +} diff --git a/packages/azure-openapi-validator/core/src/ruleLoader.ts b/packages/azure-openapi-validator/core/src/ruleLoader.ts index 8a0fcd716..4d680668e 100644 --- a/packages/azure-openapi-validator/core/src/ruleLoader.ts +++ b/packages/azure-openapi-validator/core/src/ruleLoader.ts @@ -7,8 +7,7 @@ export class BuiltInRuleLoader { getRuleSet(): IRuleSet { return { documentationUrl: "", - rules: { - } + rules: {}, } } -} \ No newline at end of file +} diff --git a/packages/azure-openapi-validator/core/src/runner.ts b/packages/azure-openapi-validator/core/src/runner.ts index c9ef407dd..067882cd0 100644 --- a/packages/azure-openapi-validator/core/src/runner.ts +++ b/packages/azure-openapi-validator/core/src/runner.ts @@ -1,11 +1,11 @@ -import { LintCallBack, LintOptions, } from "./api" +import { LintCallBack, LintOptions } from "./api" import { OpenapiDocument } from "./document" import { nodes } from "./jsonpath" -import { IRuleLoader} from "./ruleLoader" +import { IRuleLoader } from "./ruleLoader" import { SwaggerInventory } from "./swaggerInventory" -import { OpenApiTypes, ValidationMessage,LintResultMessage , IRule, IRuleSet, RuleScope } from "./types" +import { OpenApiTypes, ValidationMessage, LintResultMessage, IRule, IRuleSet, RuleScope } from "./types" -import {getRange,convertJsonPath} from "./utils" +import { getRange, convertJsonPath } from "./utils" const isLegacyRule = (rule: IRule) => { return rule.then.execute.name === "run" @@ -23,10 +23,12 @@ export class LintRunner { inventory: SwaggerInventory, scope: RuleScope = "File" ) => { - const rulesToRun = Object.entries(ruleset.rules).filter(rule => rule[1].openapiType & openapiType && (rule[1].scope || "File") === scope) + const rulesToRun = Object.entries(ruleset.rules).filter( + (rule) => rule[1].openapiType & openapiType && (rule[1].scope || "File") === scope + ) const getArgs = (rule: IRule, section: any, doc: any, location: string[]) => { if (isLegacyRule(rule)) { - return [doc, section, location, { specPath: document, inventory}] + return [doc, section, location, { specPath: document, inventory }] } else { return [ section, @@ -35,8 +37,8 @@ export class LintRunner { document: doc, location, specPath: document, - inventory - } + inventory, + }, ] } } @@ -70,22 +72,22 @@ export class LintRunner { function emitResult(ruleName: string, rule: IRule, message: ValidationMessage) { const readableCategory = rule.category - const range = getRange(inventory,document,message.location) - const msg:LintResultMessage = { + const range = getRange(inventory, document, message.location) + const msg: LintResultMessage = { id: rule.id, type: rule.severity, category: readableCategory, message: message.message, code: ruleName, sources: [document], - jsonpath: convertJsonPath(openapiDefinition,message.location as string[]), - range + jsonpath: convertJsonPath(openapiDefinition, message.location as string[]), + range, } sendMessage(msg) } } - async execute(swaggerPaths: string[], options: LintOptions,cb?:LintCallBack) { + async execute(swaggerPaths: string[], options: LintOptions, cb?: LintCallBack) { const specsPromises = [] for (const spec of swaggerPaths) { specsPromises.push(this.inventory.loadDocument(spec)) @@ -94,18 +96,17 @@ export class LintRunner { const msgs: LintResultMessage[] = [] const sendMessage = (msg: LintResultMessage) => { msgs.push(msg) - if (cb){ + if (cb) { cb(msg) } } const runPromises = [] - let runGlobalRuleFlag = false; + let runGlobalRuleFlag = false for (const doc of documents) { - for (const scope of ["Global","File"]){ + for (const scope of ["Global", "File"]) { if (scope === "Global" && runGlobalRuleFlag) { continue - } - else { + } else { runGlobalRuleFlag = true } const promise = this.runRules( @@ -114,7 +115,8 @@ export class LintRunner { sendMessage, options.openapiType, await this.loader.getRuleSet(), - this.inventory,scope as RuleScope + this.inventory, + scope as RuleScope ) runPromises.push(promise) } @@ -123,4 +125,3 @@ export class LintRunner { return msgs } } - diff --git a/packages/azure-openapi-validator/core/src/utils.ts b/packages/azure-openapi-validator/core/src/utils.ts index ce37b2b18..319f9c6b1 100644 --- a/packages/azure-openapi-validator/core/src/utils.ts +++ b/packages/azure-openapi-validator/core/src/utils.ts @@ -1,8 +1,8 @@ -import { createFileOrFolderUri,readUri } from "@azure-tools/uri"; +import { createFileOrFolderUri, readUri } from "@azure-tools/uri" import _ from "lodash" import { nodes, stringify } from "./jsonpath" -import { SwaggerInventory } from "./swaggerInventory"; -import { ISwaggerInventory, OpenApiTypes,JsonPath } from "./types" +import { SwaggerInventory } from "./swaggerInventory" +import { ISwaggerInventory, OpenApiTypes, JsonPath } from "./types" /** * * @param doc @@ -10,8 +10,8 @@ import { ISwaggerInventory, OpenApiTypes,JsonPath } from "./types" * @param inventory * @returns the schema that the reference pointed to, this will not de-reference the child item of this reference. */ -export function followReference(doc: any, schema: any, inventory?: ISwaggerInventory):any { - const getRefModel = (docToSearch:any,refValue: string, visited: string[]) => { +export function followReference(doc: any, schema: any, inventory?: ISwaggerInventory): any { + const getRefModel = (docToSearch: any, refValue: string, visited: string[]) => { if (visited.includes(refValue)) { throw new Error("Found circle reference: " + visited.join("->")) } @@ -32,7 +32,7 @@ export function followReference(doc: any, schema: any, inventory?: ISwaggerInven if (inventory && refSlices[0]) { doc = inventory.getDocuments(refSlices[0]) } - schema = getRefModel(doc,`#${refSlices[1]}`, []) + schema = getRefModel(doc, `#${refSlices[1]}`, []) return followReference(doc, schema, inventory) } return schema @@ -40,8 +40,8 @@ export function followReference(doc: any, schema: any, inventory?: ISwaggerInven return undefined } -export function isUriAbsolute(url:string) { - return /^[a-z]+:\/\//.test(url); +export function isUriAbsolute(url: string) { + return /^[a-z]+:\/\//.test(url) } export const normalizePath = (path: string) => { @@ -55,7 +55,13 @@ export const parseJsonRef = (ref: string): string[] => { return ref.split("#") } -export function traverse(obj: unknown, path: string[], visited: Set, options: any, visitor: (obj:any, path:string[], context:any) => boolean) { +export function traverse( + obj: unknown, + path: string[], + visited: Set, + options: any, + visitor: (obj: any, path: string[], context: any) => boolean +) { if (!obj) { return } @@ -104,12 +110,12 @@ export function getOpenapiType(type: string) { } export const defaultFileSystem = { - read:async (uri:string)=>{ - return await readUri(uri) - } + read: async (uri: string) => { + return await readUri(uri) + }, } -export function getRange(inventory:SwaggerInventory,specPath:string,path:JsonPath) { +export function getRange(inventory: SwaggerInventory, specPath: string, path: JsonPath) { const document = inventory.getInternalDocument(specPath) if (path && path[0] === "$") { path = path.slice(1) @@ -117,18 +123,18 @@ export function getRange(inventory:SwaggerInventory,specPath:string,path:JsonPat return document?.getPositionFromJsonPath(path) } -export function convertJsonPath(doc:any, paths:string[]) { +export function convertJsonPath(doc: any, paths: string[]) { if (paths && doc) { - const convertedPaths:JsonPath = [] + const convertedPaths: JsonPath = [] paths = paths[0] === "$" ? paths.slice(1) : paths for (const path of paths) { if (!doc || typeof doc !== "object") { return convertedPaths } - convertedPaths.push(Array.isArray(doc) ? Number.parseInt(path):path) + convertedPaths.push(Array.isArray(doc) ? Number.parseInt(path) : path) doc = doc[path] } return convertedPaths } return [] -} \ No newline at end of file +} diff --git a/packages/azure-openapi-validator/core/tests/utils.test.ts b/packages/azure-openapi-validator/core/tests/utils.test.ts index 974b36506..c23bac2ed 100644 --- a/packages/azure-openapi-validator/core/tests/utils.test.ts +++ b/packages/azure-openapi-validator/core/tests/utils.test.ts @@ -1,17 +1,20 @@ - -import {convertJsonPath, normalizePath} from "../src/utils" -import { deepStrictEqual, strictEqual } from "assert"; +import { convertJsonPath, normalizePath } from "../src/utils" +import { deepStrictEqual, strictEqual } from "assert" describe("Test utils", () => { - test("test resolve reference",async ()=>{ - strictEqual(normalizePath("C:\\test\\a.jaon"),"file:///C:/test/a.jaon") - }); + test("test resolve reference", async () => { + strictEqual(normalizePath("C:\\test\\a.jaon"), "file:///C:/test/a.jaon") + }) - test("test convert json path",async ()=>{ - deepStrictEqual(convertJsonPath({ - consumes: [ - "application/json" - ] - },["consumes","0"]),["consumes",0]) - }); -}); \ No newline at end of file + test("test convert json path", async () => { + deepStrictEqual( + convertJsonPath( + { + consumes: ["application/json"], + }, + ["consumes", "0"] + ), + ["consumes", 0] + ) + }) +}) diff --git a/packages/azure-openapi-validator/core/tsconfig.json b/packages/azure-openapi-validator/core/tsconfig.json index e794de088..1f7d66536 100644 --- a/packages/azure-openapi-validator/core/tsconfig.json +++ b/packages/azure-openapi-validator/core/tsconfig.json @@ -1,11 +1,7 @@ { - "extends": "../../../tsconfig-base.json", - "include": [ - "./src/*.ts", - "./tests/*.ts", - "index.ts" - ], - "compilerOptions": { - "outDir": "dist" - } -} \ No newline at end of file + "extends": "../../../tsconfig-base.json", + "include": ["./src/*.ts", "./tests/*.ts", "index.ts"], + "compilerOptions": { + "outDir": "dist" + } +} diff --git a/packages/rulesets/.eslintrc.yaml b/packages/rulesets/.eslintrc.yaml index d0f71f5f0..c9add88ea 100644 --- a/packages/rulesets/.eslintrc.yaml +++ b/packages/rulesets/.eslintrc.yaml @@ -2,8 +2,7 @@ parser: "@typescript-eslint/parser" extends: - "../../.eslintrc.yaml" overrides: - - files: - - "**/legacyRules/*.ts" + - files: + - "**/legacyRules/*.ts" rules: unicorn/filename-case: off - diff --git a/packages/rulesets/CHANGELOG.md b/packages/rulesets/CHANGELOG.md index b1318db2b..54bfcd921 100644 --- a/packages/rulesets/CHANGELOG.md +++ b/packages/rulesets/CHANGELOG.md @@ -3,9 +3,9 @@ This log was last generated on Thu, 24 Nov 2022 04:00:42 GMT and should not be manually modified. ## 1.0.1 + Thu, 24 Nov 2022 04:00:42 GMT ### Patches - fix rule DefinitionsPropertiesNamesCamelCase & validFormats - diff --git a/packages/rulesets/jest.config.js b/packages/rulesets/jest.config.js index abcc12639..56de4f38e 100644 --- a/packages/rulesets/jest.config.js +++ b/packages/rulesets/jest.config.js @@ -1,50 +1,28 @@ // @ts-check module.exports = { - testEnvironment: 'node', - moduleFileExtensions: [ - 'js', - 'json', - 'node', - 'ts', - ], + testEnvironment: "node", + moduleFileExtensions: ["js", "json", "node", "ts"], collectCoverage: true, - coverageReporters: [ - 'json', - 'lcov', - 'cobertura', - 'text', - 'html', - 'clover', - ], - coveragePathIgnorePatterns: [ - '/node_modules/', - '.*/tests/.*', - ], + coverageReporters: ["json", "lcov", "cobertura", "text", "html", "clover"], + coveragePathIgnorePatterns: ["/node_modules/", ".*/tests/.*"], globals: { - 'ts-jest': { - tsconfig: 'tsconfig.json', + "ts-jest": { + tsconfig: "tsconfig.json", }, }, - testMatch: [ - '**/test/*.test.ts', - '!**/test/**/*.d.ts', - ], + testMatch: ["**/test/*.test.ts", "!**/test/**/*.d.ts"], verbose: true, - preset: 'ts-jest', - collectCoverageFrom: [ - "src/spectral/functions/*.ts", - "!spectral/*.d.ts", - "!spectral/functions/*.d.ts", - ], + preset: "ts-jest", + collectCoverageFrom: ["src/spectral/functions/*.ts", "!spectral/*.d.ts", "!spectral/functions/*.d.ts"], coverageThreshold: { "src/spectral/functions/*.ts": { - "statements": 80 - } + statements: 80, + }, }, moduleNameMapper: { "^nimma/legacy$": "/node_modules/nimma/dist/legacy/cjs/index.js", "^nimma/(.*)": "/node_modules/nimma/dist/cjs/$1", - "^@stoplight/spectral-ruleset-bundler/(.*)$": "/node_modules/@stoplight/spectral-ruleset-bundler/dist/$1" + "^@stoplight/spectral-ruleset-bundler/(.*)$": "/node_modules/@stoplight/spectral-ruleset-bundler/dist/$1", }, } diff --git a/packages/rulesets/jest.native.config.js b/packages/rulesets/jest.native.config.js index da01e0928..864d835e2 100644 --- a/packages/rulesets/jest.native.config.js +++ b/packages/rulesets/jest.native.config.js @@ -1,40 +1,19 @@ // @ts-check module.exports = { - testEnvironment: 'node', - moduleFileExtensions: [ - 'js', - 'json', - 'node', - 'ts', - ], + testEnvironment: "node", + moduleFileExtensions: ["js", "json", "node", "ts"], collectCoverage: true, - coverageReporters: [ - 'json', - 'lcov', - 'cobertura', - 'text', - 'html', - 'clover', - ], - coveragePathIgnorePatterns: [ - '/node_modules/', - '.*/tests/.*', - ], + coverageReporters: ["json", "lcov", "cobertura", "text", "html", "clover"], + coveragePathIgnorePatterns: ["/node_modules/", ".*/tests/.*"], globals: { - 'ts-jest': { - tsconfig: 'tsconfig.json', + "ts-jest": { + tsconfig: "tsconfig.json", }, }, - testMatch: [ - '**/native/tests/*-test.ts', - '**/native/tests/*-tests.ts', - '!**/native/tests/**/*.d.ts', - ], + testMatch: ["**/native/tests/*-test.ts", "**/native/tests/*-tests.ts", "!**/native/tests/**/*.d.ts"], verbose: true, - preset: 'ts-jest', - collectCoverageFrom: [ - ], - moduleNameMapper: { - } + preset: "ts-jest", + collectCoverageFrom: [], + moduleNameMapper: {}, } diff --git a/packages/rulesets/package.json b/packages/rulesets/package.json index 4e528283e..866958da2 100644 --- a/packages/rulesets/package.json +++ b/packages/rulesets/package.json @@ -11,7 +11,9 @@ "test-native": "jest -u --max-old-space-size=10192 --ci --reporters=default --config ./jest.native.config.js", "test-spectral": "jest -u --max-old-space-size=10192 --ci --reporters=default --config ./jest.config.js", "lint:fix": "eslint ./src --fix --ext .ts", - "lint": "eslint ./src --ext .ts --max-warnings=0" + "lint": "eslint ./src --ext .ts --max-warnings=0", + "prettier": "prettier -w ./src", + "prettier-check": "prettier -c ./src" }, "engines": { "node": ">=12" @@ -92,4 +94,4 @@ "^@stoplight/spectral-ruleset-bundler/(.*)$": "/node_modules/@stoplight/spectral-ruleset-bundler/dist/$1" } } -} +} \ No newline at end of file diff --git a/packages/rulesets/rollup.config.js b/packages/rulesets/rollup.config.js index 1c4f3aa84..9cac48e68 100644 --- a/packages/rulesets/rollup.config.js +++ b/packages/rulesets/rollup.config.js @@ -1,34 +1,34 @@ -import commonjs from '@rollup/plugin-commonjs' -import json from '@rollup/plugin-json'; +import commonjs from "@rollup/plugin-commonjs" +import json from "@rollup/plugin-json" export default [ { - input: ['esm/spectral/az-arm.js'], - output: { - dir: 'generated/spectral', - format: 'es', - exports: 'default' + input: ["esm/spectral/az-arm.js"], + output: { + dir: "generated/spectral", + format: "es", + exports: "default", + }, + plugins: [commonjs(), json()], + external: ["@stoplight/spectral-functions", "@stoplight/spectral-formats", "@stoplight/spectral-rulesets"], }, - plugins: [commonjs(),json()], - external:["@stoplight/spectral-functions","@stoplight/spectral-formats","@stoplight/spectral-rulesets"] -}, -{ - input: ['esm/spectral/az-dataplane.js'], - output: { - dir: 'generated/spectral', - format: 'es', - exports: 'default' + { + input: ["esm/spectral/az-dataplane.js"], + output: { + dir: "generated/spectral", + format: "es", + exports: "default", + }, + plugins: [commonjs(), json()], + external: ["@stoplight/spectral-functions", "@stoplight/spectral-formats", "@stoplight/spectral-rulesets"], }, - plugins: [commonjs(),json()], - external:["@stoplight/spectral-functions","@stoplight/spectral-formats","@stoplight/spectral-rulesets"] -}, -{ - input: ['esm/spectral/az-common.js'], - output: { - dir: 'generated/spectral', - format: 'es', - exports: 'default' + { + input: ["esm/spectral/az-common.js"], + output: { + dir: "generated/spectral", + format: "es", + exports: "default", + }, + plugins: [commonjs(), json()], + external: ["@stoplight/spectral-functions", "@stoplight/spectral-formats", "@stoplight/spectral-rulesets"], }, - plugins: [commonjs(),json()], - external:["@stoplight/spectral-functions","@stoplight/spectral-formats","@stoplight/spectral-rulesets"] -} -]; \ No newline at end of file +] diff --git a/packages/rulesets/src/index.ts b/packages/rulesets/src/index.ts index da70530a6..1d902628d 100644 --- a/packages/rulesets/src/index.ts +++ b/packages/rulesets/src/index.ts @@ -5,7 +5,7 @@ import azARM from "./spectral/az-arm" import azCommon from "./spectral/az-common" import azDataplane from "./spectral/az-dataplane" -const spectralRulesetDir = join (__dirname,"spectral") +const spectralRulesetDir = join(__dirname, "spectral") export const spectralCommonRulesetFile = join(spectralRulesetDir, "az-common.js") export const spectralArmRulesetFile = join(spectralRulesetDir, "az-arm.js") export const spectralDataplaneRulesetFile = join(spectralRulesetDir, "az-dataplane.js") @@ -13,9 +13,9 @@ export const spectralDataplaneRulesetFile = join(spectralRulesetDir, "az-datapla export const spectralRulesets = { azARM, azCommon, - azDataplane + azDataplane, } export const nativeRulesets = { - azCommon:commonRuleset, - azArm:armRuleset + azCommon: commonRuleset, + azArm: armRuleset, } diff --git a/packages/rulesets/src/native/functions/pattern.ts b/packages/rulesets/src/native/functions/pattern.ts index 88f87b9e4..4c6839f72 100644 --- a/packages/rulesets/src/native/functions/pattern.ts +++ b/packages/rulesets/src/native/functions/pattern.ts @@ -9,13 +9,13 @@ export function* pattern(openapiSection: any, options: PatternOption, ctx?: Rule if (options?.match && matchPattern(options.match, openapiSection)) { yield { location: ctx?.location || [], - message: "Matched the pattern " + options?.match + message: "Matched the pattern " + options?.match, } } if (options?.notMatch && !matchPattern(options.notMatch, openapiSection)) { yield { location: ctx?.location || [], - message: "Not matched the pattern " + options?.notMatch + message: "Not matched the pattern " + options?.notMatch, } } } diff --git a/packages/rulesets/src/native/functions/provider-namespace.ts b/packages/rulesets/src/native/functions/provider-namespace.ts index 220a65bf4..86548cedc 100644 --- a/packages/rulesets/src/native/functions/provider-namespace.ts +++ b/packages/rulesets/src/native/functions/provider-namespace.ts @@ -1,18 +1,18 @@ // Check a sku model to ensure it must have a name property. It can also have 'tier', 'size', 'family', 'capacity' as optional properties. import { RuleContext } from "@microsoft.azure/openapi-validator-core" -import { getProviderNamespace, getProviderNamespaceFromPath } from "../utilities/rules-helper"; +import { getProviderNamespace, getProviderNamespaceFromPath } from "../utilities/rules-helper" -export function* providerNamespace(apiPath:any, options:{},ctx:RuleContext) { - if (apiPath && apiPath !== 'string') { - const path = ctx.location || []; +export function* providerNamespace(apiPath: any, options: {}, ctx: RuleContext) { + if (apiPath && apiPath !== "string") { + const path = ctx.location || [] const nameSpaceFromApiPath = getProviderNamespace(apiPath) const nameSpaceFromFromFilePath = getProviderNamespaceFromPath(ctx.specPath) if (nameSpaceFromApiPath && nameSpaceFromFromFilePath && nameSpaceFromApiPath !== nameSpaceFromFromFilePath) { yield { - message:`The last resource provider '${nameSpaceFromApiPath}' doesn't match the namespace.`, - location: path + message: `The last resource provider '${nameSpaceFromApiPath}' doesn't match the namespace.`, + location: path, } } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/index.ts b/packages/rulesets/src/native/index.ts index 107856034..1784522f3 100644 --- a/packages/rulesets/src/native/index.ts +++ b/packages/rulesets/src/native/index.ts @@ -1,2 +1,2 @@ -export {armRuleset} from "./rulesets/arm" -export {commonRuleset} from "./rulesets/common" \ No newline at end of file +export { armRuleset } from "./rulesets/arm" +export { commonRuleset } from "./rulesets/common" diff --git a/packages/rulesets/src/native/legacyRules/AvoidEmptyResponseSchema.ts b/packages/rulesets/src/native/legacyRules/AvoidEmptyResponseSchema.ts index 26a10749d..f21109de4 100644 --- a/packages/rulesets/src/native/legacyRules/AvoidEmptyResponseSchema.ts +++ b/packages/rulesets/src/native/legacyRules/AvoidEmptyResponseSchema.ts @@ -18,5 +18,5 @@ rules.push({ if (!Object.keys(node).length) { yield { message: `${msg}`, location: path } } - } + }, }) diff --git a/packages/rulesets/src/native/legacyRules/DefaultErrorResponseSchema.ts b/packages/rulesets/src/native/legacyRules/DefaultErrorResponseSchema.ts index 44e7e4293..c04ed51de 100644 --- a/packages/rulesets/src/native/legacyRules/DefaultErrorResponseSchema.ts +++ b/packages/rulesets/src/native/legacyRules/DefaultErrorResponseSchema.ts @@ -20,17 +20,22 @@ rules.push({ "the default error response schema does not correspond to the schema documented at https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-details.md#error-response-content." const response: any = node - if (response.default && response.default.schema) { + if (response.default) { const paths = path.concat(["default"]) - - const schema: any = Workspace.jsonPath(paths.concat("schema"), doc) - if (schema) { - const errorDefinition = Workspace.getProperty({ file: ctx?.specPath!, value: schema }, "error", ctx?.inventory! as SwaggerInventory) - if (errorDefinition && errorDefinition.value) { - const code = Workspace.getProperty(errorDefinition, "code", ctx?.inventory! as SwaggerInventory) - const message = Workspace.getProperty(errorDefinition, "message", ctx?.inventory! as SwaggerInventory) - if (code && message) { - return + if (response.default.schema) { + const schema: any = Workspace.jsonPath(paths.concat("schema"), doc) + if (schema) { + const errorDefinition = Workspace.getProperty( + { file: ctx?.specPath!, value: schema }, + "error", + ctx?.inventory! as SwaggerInventory + ) + if (errorDefinition && errorDefinition.value) { + const code = Workspace.getProperty(errorDefinition, "code", ctx?.inventory! as SwaggerInventory) + const message = Workspace.getProperty(errorDefinition, "message", ctx?.inventory! as SwaggerInventory) + if (code && message) { + return + } } } } diff --git a/packages/rulesets/src/native/legacyRules/DeleteOperationResponses.ts b/packages/rulesets/src/native/legacyRules/DeleteOperationResponses.ts index b7bfaad64..fcacd44b5 100644 --- a/packages/rulesets/src/native/legacyRules/DeleteOperationResponses.ts +++ b/packages/rulesets/src/native/legacyRules/DeleteOperationResponses.ts @@ -22,8 +22,8 @@ rules.push({ if (!node["200"] || !node["204"] || !Object.keys(node["200"]) || !Object.keys(node["204"])) { yield { message: `The delete operation is defined without a 200 or 204 error response implementation,please add it.'`, - location: path + location: path, } } - } + }, }) diff --git a/packages/rulesets/src/native/legacyRules/DeprecatedXmsCodeGenerationSetting.ts b/packages/rulesets/src/native/legacyRules/DeprecatedXmsCodeGenerationSetting.ts index 090f1f530..8de1d0ae4 100644 --- a/packages/rulesets/src/native/legacyRules/DeprecatedXmsCodeGenerationSetting.ts +++ b/packages/rulesets/src/native/legacyRules/DeprecatedXmsCodeGenerationSetting.ts @@ -17,8 +17,8 @@ rules.push({ if (node) { yield { message: `The x-ms-code-generation-setting extension is being deprecated. Please remove it and move settings to readme file for code generation.`, - location: path + location: path, } } - } + }, }) diff --git a/packages/rulesets/src/native/legacyRules/EnumMustHaveType.ts b/packages/rulesets/src/native/legacyRules/EnumMustHaveType.ts index 6e621cb50..e4d622aaa 100644 --- a/packages/rulesets/src/native/legacyRules/EnumMustHaveType.ts +++ b/packages/rulesets/src/native/legacyRules/EnumMustHaveType.ts @@ -25,5 +25,5 @@ rules.push({ yield { message: `${msg}`, location: path } } } - } + }, }) diff --git a/packages/rulesets/src/native/legacyRules/EnumMustNotHaveEmptyValue.ts b/packages/rulesets/src/native/legacyRules/EnumMustNotHaveEmptyValue.ts index d5445c4e5..73759b4e2 100644 --- a/packages/rulesets/src/native/legacyRules/EnumMustNotHaveEmptyValue.ts +++ b/packages/rulesets/src/native/legacyRules/EnumMustNotHaveEmptyValue.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { MergeStates, OpenApiTypes, rules } from "@microsoft.azure/openapi-validator-core" export const EnumMustNotHaveEmptyValue = "EnumMustNotHaveEmptyValue" -import { transformEnum , isValidEnum } from "../utilities/rules-helper" +import { transformEnum, isValidEnum } from "../utilities/rules-helper" rules.push({ id: "R3029", @@ -18,9 +18,9 @@ rules.push({ const msg = `Enum value must not contain empty value.` if (path.indexOf("x-ms-examples") === -1 && isValidEnum(node)) { const enumList = transformEnum(node.type, node.enum) - if (enumList.some((value:any) => value.trim().length === 0)) { + if (enumList.some((value: any) => value.trim().length === 0)) { yield { message: `${msg}`, location: path } } } - } + }, }) diff --git a/packages/rulesets/src/native/legacyRules/EnumMustRespectType.ts b/packages/rulesets/src/native/legacyRules/EnumMustRespectType.ts index 657c04baa..6b079ebdf 100644 --- a/packages/rulesets/src/native/legacyRules/EnumMustRespectType.ts +++ b/packages/rulesets/src/native/legacyRules/EnumMustRespectType.ts @@ -18,7 +18,7 @@ rules.push({ const msg = `Enum values should respect the type.` if (node.enum && isValidEnum(node)) { if ( - node.enum.some((value:any) => { + node.enum.some((value: any) => { if (node.type === "integer") { return !Number.isInteger(value) } @@ -28,5 +28,5 @@ rules.push({ yield { message: `${msg}`, location: path } } } - } + }, }) diff --git a/packages/rulesets/src/native/legacyRules/EnumUniqueValue.ts b/packages/rulesets/src/native/legacyRules/EnumUniqueValue.ts index aa8879a13..2820c3858 100644 --- a/packages/rulesets/src/native/legacyRules/EnumUniqueValue.ts +++ b/packages/rulesets/src/native/legacyRules/EnumUniqueValue.ts @@ -20,7 +20,7 @@ rules.push({ const enumList = transformEnum(node.type, node.enum) const caseInsensitiveSet = new Set() if ( - enumList.some((value:any) => { + enumList.some((value: any) => { if (caseInsensitiveSet.has(value.toLowerCase())) { return true } @@ -31,5 +31,5 @@ rules.push({ yield { message: `${msg}`, location: path } } } - } + }, }) diff --git a/packages/rulesets/src/native/legacyRules/ExtensionResourcePathPattern.ts b/packages/rulesets/src/native/legacyRules/ExtensionResourcePathPattern.ts index 98cef86fa..cdb9f4c77 100644 --- a/packages/rulesets/src/native/legacyRules/ExtensionResourcePathPattern.ts +++ b/packages/rulesets/src/native/legacyRules/ExtensionResourcePathPattern.ts @@ -14,5 +14,5 @@ rules.push({ for (const apiPath of Object.keys(node)) { if (apiPath.indexOf("/providers/") !== apiPath.lastIndexOf("/providers/")) yield { message: msg, location: path.concat(apiPath) } } - } + }, }) diff --git a/packages/rulesets/src/native/legacyRules/ImplementPrivateEndpointAPIs.ts b/packages/rulesets/src/native/legacyRules/ImplementPrivateEndpointAPIs.ts index 55e8738e5..ce75a14f9 100644 --- a/packages/rulesets/src/native/legacyRules/ImplementPrivateEndpointAPIs.ts +++ b/packages/rulesets/src/native/legacyRules/ImplementPrivateEndpointAPIs.ts @@ -1,4 +1,4 @@ -import { rules , MergeStates, OpenApiTypes } from "@microsoft.azure/openapi-validator-core" +import { rules, MergeStates, OpenApiTypes } from "@microsoft.azure/openapi-validator-core" export const ImplementPrivateEndpointAPIs = "ImplementPrivateEndpointAPIs" @@ -32,57 +32,39 @@ rules.push({ for (const apiPath of Object.keys(node)) { if (privateEndpointConnectionPattern.test(apiPath)) { - setMap( - apiPath - .split("/") - .slice(0, -2) - .join("/"), - { PathForPrivateConnection: apiPath } - ) + setMap(apiPath.split("/").slice(0, -2).join("/"), { PathForPrivateConnection: apiPath }) } if (privateEndpointConnectionsPattern.test(apiPath)) { - setMap( - apiPath - .split("/") - .slice(0, -1) - .join("/"), - { pathForListPrivateConnections: apiPath } - ) + setMap(apiPath.split("/").slice(0, -1).join("/"), { pathForListPrivateConnections: apiPath }) } if (privateLinkResourcesPattern.test(apiPath)) { - setMap( - apiPath - .split("/") - .slice(0, -1) - .join("/"), - { pathForListResources: apiPath } - ) + setMap(apiPath.split("/").slice(0, -1).join("/"), { pathForListResources: apiPath }) } } const pathPostfix = [ "/privateEndpointConnections/{privateEndpointConnectionName}", "/privateLinkResources", - "/privateEndpointConnections" + "/privateEndpointConnections", ] for (const [key, value] of supportedResources.entries()) { if (!value.PathForPrivateConnection) { yield { message: msg.replace("{0}", key + pathPostfix[0]), - location: path + location: path, } } if (!value.pathForListResources) { yield { message: msg.replace("{0}", key + pathPostfix[1]), - location: path + location: path, } } if (!value.pathForListPrivateConnections) { yield { message: msg.replace("{0}", key + pathPostfix[2]), - location: path + location: path, } } } - } + }, }) diff --git a/packages/rulesets/src/native/legacyRules/IntegerTypeMustHaveFormat.ts b/packages/rulesets/src/native/legacyRules/IntegerTypeMustHaveFormat.ts index 1606dd707..84a0de824 100644 --- a/packages/rulesets/src/native/legacyRules/IntegerTypeMustHaveFormat.ts +++ b/packages/rulesets/src/native/legacyRules/IntegerTypeMustHaveFormat.ts @@ -21,5 +21,5 @@ rules.push({ yield { message: `${msg}`, location: path } } } - } + }, }) diff --git a/packages/rulesets/src/native/legacyRules/LicenseHeaderMustNotBeSpecified.ts b/packages/rulesets/src/native/legacyRules/LicenseHeaderMustNotBeSpecified.ts index 51d0c5bb6..05637c292 100644 --- a/packages/rulesets/src/native/legacyRules/LicenseHeaderMustNotBeSpecified.ts +++ b/packages/rulesets/src/native/legacyRules/LicenseHeaderMustNotBeSpecified.ts @@ -18,5 +18,5 @@ rules.push({ if (node.header !== undefined) { yield { message: `${msg}`, location: path } } - } + }, }) diff --git a/packages/rulesets/src/native/legacyRules/MissingTypeObject.ts b/packages/rulesets/src/native/legacyRules/MissingTypeObject.ts index 4407c0396..8fb16cb6a 100644 --- a/packages/rulesets/src/native/legacyRules/MissingTypeObject.ts +++ b/packages/rulesets/src/native/legacyRules/MissingTypeObject.ts @@ -37,11 +37,11 @@ rules.push({ if (isMissingTypeObject(node)) { yield { message: msg.replace(`{0}`, path[path.length - 1].toString()), - location: path + location: path, } } if (node.properties) { - Object.keys(node.properties).forEach(p => keys.push({ node: node.properties[p], path: path.concat(["properties", p]) })) + Object.keys(node.properties).forEach((p) => keys.push({ node: node.properties[p], path: path.concat(["properties", p]) })) } if (node.additionalProperties) { keys.push({ node: node.additionalProperties, path: path.concat(["additionalProperties"]) }) @@ -50,10 +50,10 @@ rules.push({ keys.push({ node: node.items, path: path.concat(["items"]) }) } if (node.allOf && Array.isArray(node.allOf)) { - node.allOf.forEach((element:any, index:number) => { + node.allOf.forEach((element: any, index: number) => { keys.push({ node: element, path: path.concat(["allOf", index]) }) }) } } - } + }, }) diff --git a/packages/rulesets/src/native/legacyRules/MissingXmsErrorResponse.ts b/packages/rulesets/src/native/legacyRules/MissingXmsErrorResponse.ts index 94c872de6..430b29b13 100644 --- a/packages/rulesets/src/native/legacyRules/MissingXmsErrorResponse.ts +++ b/packages/rulesets/src/native/legacyRules/MissingXmsErrorResponse.ts @@ -25,5 +25,5 @@ rules.push({ yield { message: `${msg}`.replace("{0}", errorCode), location: path } } } - } + }, }) diff --git a/packages/rulesets/src/native/legacyRules/OperationIdRequired.ts b/packages/rulesets/src/native/legacyRules/OperationIdRequired.ts index 24dddaa83..e906a8aa6 100644 --- a/packages/rulesets/src/native/legacyRules/OperationIdRequired.ts +++ b/packages/rulesets/src/native/legacyRules/OperationIdRequired.ts @@ -24,11 +24,11 @@ rules.push({ if (!node[pathKey][op].operationId) { yield { message: `Missing operationId in path:'${pathKey}', operation:'${op}', consider adding the operationId .`, - location: path.concat([pathKey, op]) + location: path.concat([pathKey, op]), } } } } } - } + }, }) diff --git a/packages/rulesets/src/native/legacyRules/PathResourceProviderNamePascalCase.ts b/packages/rulesets/src/native/legacyRules/PathResourceProviderNamePascalCase.ts index 11b87813e..7b617aa2a 100644 --- a/packages/rulesets/src/native/legacyRules/PathResourceProviderNamePascalCase.ts +++ b/packages/rulesets/src/native/legacyRules/PathResourceProviderNamePascalCase.ts @@ -1,7 +1,6 @@ -import { rules , MergeStates, OpenApiTypes } from "@microsoft.azure/openapi-validator-core" +import { rules, MergeStates, OpenApiTypes } from "@microsoft.azure/openapi-validator-core" import { getAllResourceProvidersFromPath, resourceProviderMustPascalCase } from "../utilities/rules-helper" - export const PathResourceProviderNamePascalCase = "PathResourceProviderNamePascalCase" rules.push({ @@ -19,13 +18,13 @@ rules.push({ for (const it of paths) { const resourceProviders = getAllResourceProvidersFromPath(it) - if (resourceProviders.some(rp => !resourceProviderMustPascalCase(rp))) { + if (resourceProviders.some((rp) => !resourceProviderMustPascalCase(rp))) { yield { message: `${msg} Path: '${it}'`, - location: path.concat(["paths", it]) + location: path.concat(["paths", it]), } } } } - } + }, }) diff --git a/packages/rulesets/src/native/legacyRules/PathResourceTypeNameCamelCase.ts b/packages/rulesets/src/native/legacyRules/PathResourceTypeNameCamelCase.ts index c3e47808e..f9054c603 100644 --- a/packages/rulesets/src/native/legacyRules/PathResourceTypeNameCamelCase.ts +++ b/packages/rulesets/src/native/legacyRules/PathResourceTypeNameCamelCase.ts @@ -1,7 +1,6 @@ -import { rules , MergeStates, OpenApiTypes } from "@microsoft.azure/openapi-validator-core" +import { rules, MergeStates, OpenApiTypes } from "@microsoft.azure/openapi-validator-core" import { getAllResourceProvidersFromPath, getAllWordsFromPath, resourceTypeMustCamelCase } from "../utilities/rules-helper" - export const PathResourceTypeNameCamelCase = "PathResourceTypeNameCamelCase" rules.push({ @@ -19,14 +18,14 @@ rules.push({ for (const it of paths) { const allWords = getAllWordsFromPath(it) const resourceProviders = new Set(getAllResourceProvidersFromPath(it)) - const resourceTypes = allWords.filter(subPath => !resourceProviders.has(subPath)) - if (resourceTypes.some(it => !resourceTypeMustCamelCase(it))) { + const resourceTypes = allWords.filter((subPath) => !resourceProviders.has(subPath)) + if (resourceTypes.some((it) => !resourceTypeMustCamelCase(it))) { yield { message: `${msg} Path: '${it}'`, - location: path.concat(["paths", it]) + location: path.concat(["paths", it]), } } } } - } + }, }) diff --git a/packages/rulesets/src/native/legacyRules/PostOperationIdContainsUrlVerb.ts b/packages/rulesets/src/native/legacyRules/PostOperationIdContainsUrlVerb.ts index b3db00e24..d7ad58cae 100644 --- a/packages/rulesets/src/native/legacyRules/PostOperationIdContainsUrlVerb.ts +++ b/packages/rulesets/src/native/legacyRules/PostOperationIdContainsUrlVerb.ts @@ -21,7 +21,7 @@ rules.push({ const urlVerb: string = pathNodes[pathNodes.length - 1] // now get hold of the operation id const keys = Object.keys(node) - const postKey = keys.find(key => { + const postKey = keys.find((key) => { return key.toLowerCase() === "post" }) if (postKey) { @@ -30,19 +30,12 @@ rules.push({ // the check // check if we have an operation id without the verb at the end of the url // if not, this should be a violation - if ( - operationId && - operationId - .toLowerCase() - .split("_") - .pop() - .indexOf(urlVerb) === -1 - ) { + if (operationId && operationId.toLowerCase().split("_").pop().indexOf(urlVerb) === -1) { yield { message: `OperationId should contain the verb: '${urlVerb}' in:'${operationId}'. Consider updating the operationId`, - location: path.concat(postKey).concat("operationId") + location: path.concat(postKey).concat("operationId"), } } } - } + }, }) diff --git a/packages/rulesets/src/native/legacyRules/PreviewVersionOverOneYear.ts b/packages/rulesets/src/native/legacyRules/PreviewVersionOverOneYear.ts index dc97072e6..419280cbb 100644 --- a/packages/rulesets/src/native/legacyRules/PreviewVersionOverOneYear.ts +++ b/packages/rulesets/src/native/legacyRules/PreviewVersionOverOneYear.ts @@ -29,5 +29,5 @@ rules.push({ yield { message: msg.replace("{0}", node.version), location: path.concat("version") } } } - } + }, }) diff --git a/packages/rulesets/src/native/legacyRules/RequiredDefaultResponse.ts b/packages/rulesets/src/native/legacyRules/RequiredDefaultResponse.ts index b8ab5fcc7..388059eb2 100644 --- a/packages/rulesets/src/native/legacyRules/RequiredDefaultResponse.ts +++ b/packages/rulesets/src/native/legacyRules/RequiredDefaultResponse.ts @@ -17,8 +17,8 @@ rules.push({ if (!node.default) { yield { message: `The response is defined but without a default error response implementation.Consider adding it.'`, - location: path + location: path, } } - } + }, }) diff --git a/packages/rulesets/src/native/legacyRules/UniqueClientParameterName.ts b/packages/rulesets/src/native/legacyRules/UniqueClientParameterName.ts index d65fdc87e..a78a839f8 100644 --- a/packages/rulesets/src/native/legacyRules/UniqueClientParameterName.ts +++ b/packages/rulesets/src/native/legacyRules/UniqueClientParameterName.ts @@ -22,7 +22,7 @@ rules.push({ return undefined } } - const checkParameterNameUnique = (parameter:any) => { + const checkParameterNameUnique = (parameter: any) => { if (parameter) { const ref = (parameter as any).$ref if (ref === undefined) { @@ -59,7 +59,7 @@ rules.push({ )}.` yield { location: path.concat(it.path.slice(1)), - message: msg + conflictMsg + message: msg + conflictMsg, } } } @@ -74,10 +74,10 @@ rules.push({ )}.` yield { location: path.concat(it.path.slice(1)), - message: msg + conflictMsg + message: msg + conflictMsg, } } } } - } + }, }) diff --git a/packages/rulesets/src/native/legacyRules/UniqueModelName.ts b/packages/rulesets/src/native/legacyRules/UniqueModelName.ts index d5f68971c..0afb36097 100644 --- a/packages/rulesets/src/native/legacyRules/UniqueModelName.ts +++ b/packages/rulesets/src/native/legacyRules/UniqueModelName.ts @@ -15,10 +15,10 @@ rules.push({ for (const key of Object.keys(node)) { const model = models.get(key.toLowerCase()) if (model) { - yield { message: msg.replace("{0}", key).replace("{1}",model), location: path.concat(key) } + yield { message: msg.replace("{0}", key).replace("{1}", model), location: path.concat(key) } } else { models.set(key.toLowerCase(), key) } } - } + }, }) diff --git a/packages/rulesets/src/native/legacyRules/UniqueXmsExample.ts b/packages/rulesets/src/native/legacyRules/UniqueXmsExample.ts index 9857d79db..7ebd13906 100644 --- a/packages/rulesets/src/native/legacyRules/UniqueXmsExample.ts +++ b/packages/rulesets/src/native/legacyRules/UniqueXmsExample.ts @@ -24,5 +24,5 @@ rules.push({ } } } - } + }, }) diff --git a/packages/rulesets/src/native/legacyRules/ValidResponseCodeRequired.ts b/packages/rulesets/src/native/legacyRules/ValidResponseCodeRequired.ts index 5b72cf9ee..76df36b83 100644 --- a/packages/rulesets/src/native/legacyRules/ValidResponseCodeRequired.ts +++ b/packages/rulesets/src/native/legacyRules/ValidResponseCodeRequired.ts @@ -20,9 +20,9 @@ rules.push({ if (response.default && Object.keys(response).length === 1) { yield { message: `${msg}`, location: path } } else { - if (!Object.keys(response).some(v => v.startsWith("20"))) { + if (!Object.keys(response).some((v) => v.startsWith("20"))) { yield { message: `${msg}`, location: path } } } - } + }, }) diff --git a/packages/rulesets/src/native/rulesets/arm.ts b/packages/rulesets/src/native/rulesets/arm.ts index 6c7b23536..b6123ccd8 100644 --- a/packages/rulesets/src/native/rulesets/arm.ts +++ b/packages/rulesets/src/native/rulesets/arm.ts @@ -14,7 +14,6 @@ import { providerNamespace } from "../functions/provider-namespace" export const armRuleset: IRuleSet = { documentationUrl: "https://github.com/Azure/azure-openapi-validator/blob/develop/docs/rules.md", rules: { - /// /// ARM RPC rules for Delete patterns /// diff --git a/packages/rulesets/src/native/tests/default-tests.ts b/packages/rulesets/src/native/tests/default-tests.ts index a0c947f3a..82e6e6ec4 100644 --- a/packages/rulesets/src/native/tests/default-tests.ts +++ b/packages/rulesets/src/native/tests/default-tests.ts @@ -2,14 +2,14 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { LintResultMessage ,OpenApiTypes} from "@microsoft.azure/openapi-validator-core" +import { LintResultMessage, OpenApiTypes } from "@microsoft.azure/openapi-validator-core" import { ArraySchemaMustHaveItems } from "../legacyRules/ArraySchemaMustHaveItems" import { assertValidationRuleCount, collectTestMessagesFromValidator } from "./utilities/tests-helper" -describe("DefaultTests",()=> { - test( "array schema must have items test",async ()=> { +describe("DefaultTests", () => { + test("array schema must have items test", async () => { const fileName = "ArraySchemaWithoutItems.json" - const messages: LintResultMessage[] = await collectTestMessagesFromValidator(fileName, OpenApiTypes.default,ArraySchemaMustHaveItems) + const messages: LintResultMessage[] = await collectTestMessagesFromValidator(fileName, OpenApiTypes.default, ArraySchemaMustHaveItems) assertValidationRuleCount(messages, ArraySchemaMustHaveItems, 1) }) }) diff --git a/packages/rulesets/src/native/tests/resources/ArraySchemaWithoutItems.json b/packages/rulesets/src/native/tests/resources/ArraySchemaWithoutItems.json index f030c45b9..31facb5bd 100644 --- a/packages/rulesets/src/native/tests/resources/ArraySchemaWithoutItems.json +++ b/packages/rulesets/src/native/tests/resources/ArraySchemaWithoutItems.json @@ -1,74 +1,68 @@ { - "swagger": "2.0", - "info": { - "title": "Operations schemes has non-http/https type", - "description": "Some documentation.", - "version": "2014-04-01-preview" - }, - "host": "management.azure.com", - "schemes": [ - "https" - ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], - "basePath": "/", - "paths": { - "/foo": { - "post": { - "operationId": "Models_list", - "summary": "Foo path", - "description": "Foo operation", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Models" - } - } - }, - "x-ms-pageable": { - "nextLinkName": null - } + "swagger": "2.0", + "info": { + "title": "Operations schemes has non-http/https type", + "description": "Some documentation.", + "version": "2014-04-01-preview" + }, + "host": "management.azure.com", + "schemes": ["https"], + "produces": ["application/json"], + "consumes": ["application/json"], + "basePath": "/", + "paths": { + "/foo": { + "post": { + "operationId": "Models_list", + "summary": "Foo path", + "description": "Foo operation", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Models" } + } + }, + "x-ms-pageable": { + "nextLinkName": null } + } + } + }, + "parameters": { + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "description": "test subscription id" }, - "parameters": { - "SubscriptionIdParameter": { - "name": "subscriptionId", - "in": "path", - "required": true, - "type": "string", - "description": "test subscription id" - }, - "ApiVersion": { - "name": "api-version", - "in": "path", - "required": true, - "type": "string", - "description": "test api version" + "ApiVersion": { + "name": "api-version", + "in": "path", + "required": true, + "type": "string", + "description": "test api version" + } + }, + "definitions": { + "Models": { + "description": "the models to return", + "properties": { + "mymodels": { + "type": "array" } + } }, - "definitions": { - "Models": { - "description": "the models to return", - "properties": { - "mymodels": { - "type": "array" - } - } - }, - "Model": { - "description": "the model returned", - "properties": { - "prop0": { - "description": "some property", - "type": "string" - } - } + "Model": { + "description": "the model returned", + "properties": { + "prop0": { + "description": "some property", + "type": "string" } + } } -} \ No newline at end of file + } +} diff --git a/packages/rulesets/src/native/tests/resources/ContainsControlCharacters.json b/packages/rulesets/src/native/tests/resources/ContainsControlCharacters.json index 61b0de1d8..5ff866d73 100644 --- a/packages/rulesets/src/native/tests/resources/ContainsControlCharacters.json +++ b/packages/rulesets/src/native/tests/resources/ContainsControlCharacters.json @@ -1,62 +1,54 @@ { - "swagger": "2.0", - "info": { - "title": "default-valued properties in patch request", - "description": "Flag validation rule if there is a default-valued property in a patch request model", - "version": "2014-04-01-preview" - }, - "host": "management.azure.com", - "schemes": [ - "https" - ], - "basePath": "/", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], - "paths": { - "/foo": { - "patch": { - "tags": [ - "SampleTag" - ], - "operationId": "Foo_Update", - "description": "Test Description \t", - "parameters": [ - { - "name": "foo_patch", - "in": "body", - "schema": { - "$ref": "#/definitions/FooRequestParams" - }, - "description": "foo patch request \u0007 \u0006" - } - ], - "responses": { - "200": { - "description": "OK \u0001" - } - } - } + "swagger": "2.0", + "info": { + "title": "default-valued properties in patch request", + "description": "Flag validation rule if there is a default-valued property in a patch request model", + "version": "2014-04-01-preview" + }, + "host": "management.azure.com", + "schemes": ["https"], + "basePath": "/", + "produces": ["application/json"], + "consumes": ["application/json"], + "paths": { + "/foo": { + "patch": { + "tags": ["SampleTag"], + "operationId": "Foo_Update", + "description": "Test Description \t", + "parameters": [ + { + "name": "foo_patch", + "in": "body", + "schema": { + "$ref": "#/definitions/FooRequestParams" + }, + "description": "foo patch request \u0007 \u0006" + } + ], + "responses": { + "200": { + "description": "OK \u0001" + } + } + } + } + }, + "definitions": { + "FooRequestParams": { + "allOf": [ + { + "$ref": "#/definitions/FooProps" } + ] }, - "definitions": { - "FooRequestParams": { - "allOf": [ - { - "$ref": "#/definitions/FooProps" - } - ] - }, - "FooProps": { - "properties": { - "prop0": { - "type": "string", - "default": "my def val \n" - } - } + "FooProps": { + "properties": { + "prop0": { + "type": "string", + "default": "my def val \n" } + } } -} \ No newline at end of file + } +} diff --git a/packages/rulesets/src/native/tests/resources/DefaultResponseMissed.json b/packages/rulesets/src/native/tests/resources/DefaultResponseMissed.json index 9682c7b39..1fdbf35f7 100644 --- a/packages/rulesets/src/native/tests/resources/DefaultResponseMissed.json +++ b/packages/rulesets/src/native/tests/resources/DefaultResponseMissed.json @@ -6,16 +6,10 @@ "version": "2014-04-01-preview" }, "host": "management.azure.com", - "schemes": [ - "https" - ], + "schemes": ["https"], "basePath": "/", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], + "produces": ["application/json"], + "consumes": ["application/json"], "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}": { "post": { @@ -74,4 +68,4 @@ "description": "test api version" } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/DefaultResponseSchemaDismatch.json b/packages/rulesets/src/native/tests/resources/DefaultResponseSchemaDismatch.json index b88ba3fae..11af63dfc 100644 --- a/packages/rulesets/src/native/tests/resources/DefaultResponseSchemaDismatch.json +++ b/packages/rulesets/src/native/tests/resources/DefaultResponseSchemaDismatch.json @@ -1,55 +1,55 @@ { - "swagger": "2.0", - "info": { - "title": "SwaggerInventoryTests", - "description": "Use this swagger to test the inventory to detect response types with arrays as possible pageable operations", - "version": "2016-10-10" - }, - "host": "management.azure.com", - "paths": { - "/plants": { - "get": { - "description": "Get a list of plants.", - "operationId": "Plants_List", - "x-ms-pageable": { - "nextLinkName": "nextLink" - }, - "parameters": [], - "responses": { - "default": { - "description": "Failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } + "swagger": "2.0", + "info": { + "title": "SwaggerInventoryTests", + "description": "Use this swagger to test the inventory to detect response types with arrays as possible pageable operations", + "version": "2016-10-10" + }, + "host": "management.azure.com", + "paths": { + "/plants": { + "get": { + "description": "Get a list of plants.", + "operationId": "Plants_List", + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "parameters": [], + "responses": { + "default": { + "description": "Failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" } + } + } + } + } + }, + "definitions": { + "ErrorResponse": { + "properties": { + "error": { + "readOnly": true, + "$ref": "#/definitions/Error" } + }, + "description": "The key vault error exception." }, - "definitions": { - "ErrorResponse": { - "properties": { - "error": { - "readOnly": true, - "$ref": "#/definitions/Error" - } - }, - "description": "The key vault error exception." + "Error": { + "properties": { + "message": { + "type": "string", + "readOnly": true, + "description": "The error message." }, - "Error": { - "properties": { - "message": { - "type": "string", - "readOnly": true, - "description": "The error message." - }, - "innererror": { - "x-ms-client-name": "innerError", - "readOnly": true, - "$ref": "#/definitions/Error" - } - } + "innererror": { + "x-ms-client-name": "innerError", + "readOnly": true, + "$ref": "#/definitions/Error" } - }, - "parameters": {} -} \ No newline at end of file + } + } + }, + "parameters": {} +} diff --git a/packages/rulesets/src/native/tests/resources/DefaultResponseSchemaMatch.json b/packages/rulesets/src/native/tests/resources/DefaultResponseSchemaMatch.json index 8e3778e11..43ba9ae26 100644 --- a/packages/rulesets/src/native/tests/resources/DefaultResponseSchemaMatch.json +++ b/packages/rulesets/src/native/tests/resources/DefaultResponseSchemaMatch.json @@ -1,77 +1,77 @@ { - "swagger": "2.0", - "info": { - "title": "SwaggerInventoryTests", - "description": "Use this swagger to test the inventory to detect response types with arrays as possible pageable operations", - "version": "2016-10-10" - }, - "host": "management.azure.com", - "paths": { - "/plants": { - "get": { - "description": "Get a list of plants.", - "operationId": "Plants_List", - "x-ms-pageable": { - "nextLinkName": "nextLink" - }, - "parameters": [], - "responses": { - "default": { - "description": "Failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } + "swagger": "2.0", + "info": { + "title": "SwaggerInventoryTests", + "description": "Use this swagger to test the inventory to detect response types with arrays as possible pageable operations", + "version": "2016-10-10" + }, + "host": "management.azure.com", + "paths": { + "/plants": { + "get": { + "description": "Get a list of plants.", + "operationId": "Plants_List", + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "parameters": [], + "responses": { + "default": { + "description": "Failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" } + } } - }, - "definitions": { - "ErrorResponse": { - "allOf": [ + } + } + }, + "definitions": { + "ErrorResponse": { + "allOf": [ + { + "properties": { + "error": { + "allOf": [ { - "properties": { - "error": { - "allOf": [ - { - "readOnly": true - }, - { - "$ref": "#/definitions/Error" - }, - { - "$ref": "#/definitions/Error1" - } - ] - } - }, - "description": "The key vault error exception." - } - ] - }, - "Error": { - "properties": { - "code": { - "type": "string", - "readOnly": true, - "description": "The error code." - } - } - }, - "Error1": { - "properties": { - "message": { - "type": "string", - "readOnly": true, - "description": "The error message." + "readOnly": true + }, + { + "$ref": "#/definitions/Error" }, - "innererror": { - "x-ms-client-name": "innerError", - "readOnly": true, - "$ref": "#/definitions/Error1" + { + "$ref": "#/definitions/Error1" } + ] } + }, + "description": "The key vault error exception." } + ] }, - "parameters": {} -} \ No newline at end of file + "Error": { + "properties": { + "code": { + "type": "string", + "readOnly": true, + "description": "The error code." + } + } + }, + "Error1": { + "properties": { + "message": { + "type": "string", + "readOnly": true, + "description": "The error message." + }, + "innererror": { + "x-ms-client-name": "innerError", + "readOnly": true, + "$ref": "#/definitions/Error1" + } + } + } + }, + "parameters": {} +} diff --git a/packages/rulesets/src/native/tests/resources/DeleteResponseMissed.json b/packages/rulesets/src/native/tests/resources/DeleteResponseMissed.json index aeb61d820..151ce4c7b 100644 --- a/packages/rulesets/src/native/tests/resources/DeleteResponseMissed.json +++ b/packages/rulesets/src/native/tests/resources/DeleteResponseMissed.json @@ -6,16 +6,10 @@ "version": "2014-04-01-preview" }, "host": "management.azure.com", - "schemes": [ - "https" - ], + "schemes": ["https"], "basePath": "/", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], + "produces": ["application/json"], + "consumes": ["application/json"], "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}": { "delete": { @@ -26,7 +20,7 @@ "200": { "description": "Unexpected error" }, - "default": { + "default": { "description": "Unexpected error" } } @@ -77,4 +71,4 @@ "description": "test api version" } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/DescriptionSameAsPropertyName.json b/packages/rulesets/src/native/tests/resources/DescriptionSameAsPropertyName.json index d08e3ce80..b13a6f2a0 100644 --- a/packages/rulesets/src/native/tests/resources/DescriptionSameAsPropertyName.json +++ b/packages/rulesets/src/native/tests/resources/DescriptionSameAsPropertyName.json @@ -1,116 +1,106 @@ { - "swagger": "2.0", - "info": { - "title": "Microsoft Azure Redis Cache Management API", - "description": "Some cool documentation.", - "version": "2014-04-01-preview" - }, - "host": "management.azure.com", - "schemes": [ - "https" - ], - "basePath": "/", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], - "paths": { - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}": { - "delete": { - "tags": [ - "Redis" - ], - "operationId": "Redis_Delete", - "description": "Deletes a Redis cache.", - "x-ms-long-running-operation": true, - "parameters": [ - { - "name": "resourceGroupName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the resource group." - }, - { - "name": "nodeNameSameAsDescriptionName", - "in": "path", - "required": true, - "type": "string", - "description": "nodeNameSameAsDescriptionName.", - "x-ms-client-name": "name" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParamterer" - } - ], - "responses": { - "200": { - "description": "description." - }, - "204": { - "description": "" - } - } - } - } - }, - "definitions": { - "Resource": { - "description": "The Resource model definition.", - "properties": { - "id": { - "readOnly": true, - "type": "string", - "x-ms-client-name": "id", - "description": "Resource Id" - }, - "name": { - "readOnly": true, - "type": "string", - "description": "Resource name" - }, - "type": { - "readOnly": true, - "type": "string", - "description": "Resource type" - }, - "location": { - "type": "string", - "description": "Resource location" - }, - "tags": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Resource tags" - } - }, - "required": [ - "location" - ], - "x-ms-azure-resource": true - } - }, - "parameters": { - "SubscriptionIdParamterer": { - "name": "subscriptionId", + "swagger": "2.0", + "info": { + "title": "Microsoft Azure Redis Cache Management API", + "description": "Some cool documentation.", + "version": "2014-04-01-preview" + }, + "host": "management.azure.com", + "schemes": ["https"], + "basePath": "/", + "produces": ["application/json"], + "consumes": ["application/json"], + "paths": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}": { + "delete": { + "tags": ["Redis"], + "operationId": "Redis_Delete", + "description": "Deletes a Redis cache.", + "x-ms-long-running-operation": true, + "parameters": [ + { + "name": "resourceGroupName", "in": "path", - "description": "Subscription ID.", "required": true, - "type": "string" - }, - "ApiVersionParameter": { - "name": "apiVersion", + "type": "string", + "description": "The name of the resource group." + }, + { + "name": "nodeNameSameAsDescriptionName", "in": "path", - "description": "API ID.", "required": true, + "type": "string", + "description": "nodeNameSameAsDescriptionName.", + "x-ms-client-name": "name" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParamterer" + } + ], + "responses": { + "200": { + "description": "description." + }, + "204": { + "description": "" + } + } + } + } + }, + "definitions": { + "Resource": { + "description": "The Resource model definition.", + "properties": { + "id": { + "readOnly": true, + "type": "string", + "x-ms-client-name": "id", + "description": "Resource Id" + }, + "name": { + "readOnly": true, + "type": "string", + "description": "Resource name" + }, + "type": { + "readOnly": true, + "type": "string", + "description": "Resource type" + }, + "location": { + "type": "string", + "description": "Resource location" + }, + "tags": { + "type": "object", + "additionalProperties": { "type": "string" + }, + "description": "Resource tags" } + }, + "required": ["location"], + "x-ms-azure-resource": true + } + }, + "parameters": { + "SubscriptionIdParamterer": { + "name": "subscriptionId", + "in": "path", + "description": "Subscription ID.", + "required": true, + "type": "string" + }, + "ApiVersionParameter": { + "name": "apiVersion", + "in": "path", + "description": "API ID.", + "required": true, + "type": "string" } -} \ No newline at end of file + } +} diff --git a/packages/rulesets/src/native/tests/resources/EmptyResponseSchema.json b/packages/rulesets/src/native/tests/resources/EmptyResponseSchema.json index 5957b755d..bedfd720b 100644 --- a/packages/rulesets/src/native/tests/resources/EmptyResponseSchema.json +++ b/packages/rulesets/src/native/tests/resources/EmptyResponseSchema.json @@ -1,29 +1,29 @@ { - "swagger": "2.0", - "info": { - "title": "SwaggerInventoryTests", - "description": "Use this swagger to test the inventory to detect response types with arrays as possible pageable operations", - "version": "2016-10-10" - }, - "host": "management.azure.com", - "paths": { - "/plants": { - "get": { - "description": "Get a list of plants.", - "operationId": "Plants_List", - "x-ms-pageable": { - "nextLinkName": "nextLink" - }, - "parameters": [], - "responses": { - "default": { - "description": "Failed.", - "schema": {} - } - } - } + "swagger": "2.0", + "info": { + "title": "SwaggerInventoryTests", + "description": "Use this swagger to test the inventory to detect response types with arrays as possible pageable operations", + "version": "2016-10-10" + }, + "host": "management.azure.com", + "paths": { + "/plants": { + "get": { + "description": "Get a list of plants.", + "operationId": "Plants_List", + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "parameters": [], + "responses": { + "default": { + "description": "Failed.", + "schema": {} + } } - }, - "definitions": {}, - "parameters": {} -} \ No newline at end of file + } + } + }, + "definitions": {}, + "parameters": {} +} diff --git a/packages/rulesets/src/native/tests/resources/EnumMustHaveType.json b/packages/rulesets/src/native/tests/resources/EnumMustHaveType.json index 5927d69ad..aea2320e8 100644 --- a/packages/rulesets/src/native/tests/resources/EnumMustHaveType.json +++ b/packages/rulesets/src/native/tests/resources/EnumMustHaveType.json @@ -1,104 +1,91 @@ { - "swagger": "2.0", - "info": { - "title": "SwaggerInventoryTests", - "description": "Use this swagger to test the inventory to detect response types with arrays as possible pageable operations", - "version": "2016-10-10" - }, - "host": "management.azure.com", - "paths": { - "/plants": { - "get": { - "description": "Get a list of plants.", - "operationId": "Plants_List", - "x-ms-pageable": { - "nextLinkName": "nextLink" - }, - "parameters": [], - "responses": { - "200": { - "description": "OK.", - "schema": { - "$ref": "#/definitions/PlantsList" - } - } - } + "swagger": "2.0", + "info": { + "title": "SwaggerInventoryTests", + "description": "Use this swagger to test the inventory to detect response types with arrays as possible pageable operations", + "version": "2016-10-10" + }, + "host": "management.azure.com", + "paths": { + "/plants": { + "get": { + "description": "Get a list of plants.", + "operationId": "Plants_List", + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "parameters": [], + "responses": { + "200": { + "description": "OK.", + "schema": { + "$ref": "#/definitions/PlantsList" } + } } - }, - "definitions": { - "PlantsList": { - "type": "object", - "description": "Response to a Pageable operation. This one lists plants", - "readOnly": true, - "properties": { - "value": { - "type": "array", - "description": "List of plants", - "items": { - "$ref": "#/definitions/Plant" - }, - "readOnly": true - }, - "nextLink": { - "type": "string", - "description": "Link to next page of results", - "readOnly": true - } - } + } + } + }, + "definitions": { + "PlantsList": { + "type": "object", + "description": "Response to a Pageable operation. This one lists plants", + "readOnly": true, + "properties": { + "value": { + "type": "array", + "description": "List of plants", + "items": { + "$ref": "#/definitions/Plant" + }, + "readOnly": true }, - "Plant": { - "type": "object", - "description": "A plant", - "properties": { - "name": { - "type": "string", - "description": "The plant's name" - }, - "edible": { - "type": "boolean", - "description": "Is the plant edible?" - } - } + "nextLink": { + "type": "string", + "description": "Link to next page of results", + "readOnly": true + } + } + }, + "Plant": { + "type": "object", + "description": "A plant", + "properties": { + "name": { + "type": "string", + "description": "The plant's name" }, - "ConfigurationStoreProperties": { - "description": "The properties of a configuration store.", - "type": "object", - "properties": { - "provisioningState": { - "description": "The provisioning state of the configuration store.", - "enum": [ - "Creating", - "Updating", - "Deleting", - "Succeeded", - "Failed", - "Canceled" - ], - "type": "object", - "readOnly": true, - "x-ms-enum": { - "name": "ProvisioningState", - "modelAsString": true - } - }, - "status": { - "description": "The state code.", - "enum": [ - "Success", - "Failed" - ], - "readOnly": true, - "x-ms-enum": { - "name": "RespStatus", - "modelAsString": true - } - - } - } + "edible": { + "type": "boolean", + "description": "Is the plant edible?" } - + } }, - "parameters": {} - -} \ No newline at end of file + "ConfigurationStoreProperties": { + "description": "The properties of a configuration store.", + "type": "object", + "properties": { + "provisioningState": { + "description": "The provisioning state of the configuration store.", + "enum": ["Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled"], + "type": "object", + "readOnly": true, + "x-ms-enum": { + "name": "ProvisioningState", + "modelAsString": true + } + }, + "status": { + "description": "The state code.", + "enum": ["Success", "Failed"], + "readOnly": true, + "x-ms-enum": { + "name": "RespStatus", + "modelAsString": true + } + } + } + } + }, + "parameters": {} +} diff --git a/packages/rulesets/src/native/tests/resources/EnumMustNotHaveEmptyValue.json b/packages/rulesets/src/native/tests/resources/EnumMustNotHaveEmptyValue.json index e3aebeb32..a37e4d132 100644 --- a/packages/rulesets/src/native/tests/resources/EnumMustNotHaveEmptyValue.json +++ b/packages/rulesets/src/native/tests/resources/EnumMustNotHaveEmptyValue.json @@ -1,106 +1,92 @@ { - "swagger": "2.0", - "info": { - "title": "SwaggerInventoryTests", - "description": "Use this swagger to test the inventory to detect response types with arrays as possible pageable operations", - "version": "2016-10-10" - }, - "host": "management.azure.com", - "paths": { - "/plants": { - "get": { - "description": "Get a list of plants.", - "operationId": "Plants_List", - "x-ms-pageable": { - "nextLinkName": "nextLink" - }, - "parameters": [], - "responses": { - "200": { - "description": "OK.", - "schema": { - "$ref": "#/definitions/PlantsList" - } - } - } + "swagger": "2.0", + "info": { + "title": "SwaggerInventoryTests", + "description": "Use this swagger to test the inventory to detect response types with arrays as possible pageable operations", + "version": "2016-10-10" + }, + "host": "management.azure.com", + "paths": { + "/plants": { + "get": { + "description": "Get a list of plants.", + "operationId": "Plants_List", + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "parameters": [], + "responses": { + "200": { + "description": "OK.", + "schema": { + "$ref": "#/definitions/PlantsList" } + } } - }, - "definitions": { - "PlantsList": { - "type": "object", - "description": "Response to a Pageable operation. This one lists plants", - "readOnly": true, - "properties": { - "value": { - "type": "array", - "description": "List of plants", - "items": { - "$ref": "#/definitions/Plant" - }, - "readOnly": true - }, - "nextLink": { - "type": "string", - "description": "Link to next page of results", - "readOnly": true - } - } + } + } + }, + "definitions": { + "PlantsList": { + "type": "object", + "description": "Response to a Pageable operation. This one lists plants", + "readOnly": true, + "properties": { + "value": { + "type": "array", + "description": "List of plants", + "items": { + "$ref": "#/definitions/Plant" + }, + "readOnly": true }, - "Plant": { - "type": "object", - "description": "A plant", - "properties": { - "name": { - "type": "string", - "description": "The plant's name" - }, - "edible": { - "type": "boolean", - "description": "Is the plant edible?" - } - } + "nextLink": { + "type": "string", + "description": "Link to next page of results", + "readOnly": true + } + } + }, + "Plant": { + "type": "object", + "description": "A plant", + "properties": { + "name": { + "type": "string", + "description": "The plant's name" }, - "ConfigurationStoreProperties": { - "description": "The properties of a configuration store.", - "type": "object", - "properties": { - "provisioningState": { - "description": "The provisioning state of the configuration store.", - "enum": [ - "Creating", - "Updating", - "Deleting", - "Succeeded", - "Failed", - "Canceled" - ], - "type": "string", - "readOnly": true, - "x-ms-enum": { - "name": "ProvisioningState", - "modelAsString": true - } - }, - "status": { - "description": "The state code.", - "enum": [ - "Success", - "Failed", - " " - ], - "readOnly": true, - "type": "string", - "x-ms-enum": { - "name": "RespStatus", - "modelAsString": true - } - - } - } + "edible": { + "type": "boolean", + "description": "Is the plant edible?" } - + } }, - "parameters": {} - -} \ No newline at end of file + "ConfigurationStoreProperties": { + "description": "The properties of a configuration store.", + "type": "object", + "properties": { + "provisioningState": { + "description": "The provisioning state of the configuration store.", + "enum": ["Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled"], + "type": "string", + "readOnly": true, + "x-ms-enum": { + "name": "ProvisioningState", + "modelAsString": true + } + }, + "status": { + "description": "The state code.", + "enum": ["Success", "Failed", " "], + "readOnly": true, + "type": "string", + "x-ms-enum": { + "name": "RespStatus", + "modelAsString": true + } + } + } + } + }, + "parameters": {} +} diff --git a/packages/rulesets/src/native/tests/resources/EnumMustRespectType.json b/packages/rulesets/src/native/tests/resources/EnumMustRespectType.json index 2a8ea674f..6694ceea5 100644 --- a/packages/rulesets/src/native/tests/resources/EnumMustRespectType.json +++ b/packages/rulesets/src/native/tests/resources/EnumMustRespectType.json @@ -1,145 +1,115 @@ { - "swagger": "2.0", - "info": { - "title": "SwaggerInventoryTests", - "description": "Use this swagger to test the inventory to detect response types with arrays as possible pageable operations", - "version": "2016-10-10" - }, - "host": "management.azure.com", - "paths": { - "/plants": { - "get": { - "description": "Get a list of plants.", - "operationId": "Plants_List", - "x-ms-pageable": { - "nextLinkName": "nextLink" - }, - "parameters": [], - "responses": { - "200": { - "description": "OK.", - "schema": { - "$ref": "#/definitions/PlantsList" - } - } - } + "swagger": "2.0", + "info": { + "title": "SwaggerInventoryTests", + "description": "Use this swagger to test the inventory to detect response types with arrays as possible pageable operations", + "version": "2016-10-10" + }, + "host": "management.azure.com", + "paths": { + "/plants": { + "get": { + "description": "Get a list of plants.", + "operationId": "Plants_List", + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "parameters": [], + "responses": { + "200": { + "description": "OK.", + "schema": { + "$ref": "#/definitions/PlantsList" } + } } - }, - "definitions": { - "PlantsList": { - "type": "object", - "description": "Response to a Pageable operation. This one lists plants", - "readOnly": true, - "properties": { - "value": { - "type": "array", - "description": "List of plants", - "items": { - "$ref": "#/definitions/Plant" - }, - "readOnly": true - }, - "nextLink": { - "type": "string", - "description": "Link to next page of results", - "readOnly": true - } - } + } + } + }, + "definitions": { + "PlantsList": { + "type": "object", + "description": "Response to a Pageable operation. This one lists plants", + "readOnly": true, + "properties": { + "value": { + "type": "array", + "description": "List of plants", + "items": { + "$ref": "#/definitions/Plant" + }, + "readOnly": true }, - "Plant": { - "type": "object", - "description": "A plant", - "properties": { - "name": { - "type": "string", - "description": "The plant's name" - }, - "edible": { - "type": "boolean", - "enum": [ - true - ], - "description": "Is the plant edible?" - } - } + "nextLink": { + "type": "string", + "description": "Link to next page of results", + "readOnly": true + } + } + }, + "Plant": { + "type": "object", + "description": "A plant", + "properties": { + "name": { + "type": "string", + "description": "The plant's name" }, - "ConfigurationStoreProperties": { - "description": "The properties of a configuration store.", - "type": "object", - "properties": { - "provisioningState": { - "description": "The provisioning state of the configuration store.", - "enum": [ - "Creating", - "Updating", - "Deleting", - "Succeeded", - "Failed", - "Canceled", - null - ], - "type": "string", - "readOnly": true, - "x-ms-enum": { - "name": "ProvisioningState", - "modelAsString": true - } - }, - "status": { - "description": "The state code.", - "enum": [ - true, - 0 - ], - "type": "boolean", - "readOnly": true, - "x-ms-enum": { - "name": "RespStatus", - "modelAsString": true - } - - } - } + "edible": { + "type": "boolean", + "enum": [true], + "description": "Is the plant edible?" } - + } }, - "parameters": { - "Foo": { - "name": "foo", - "in": "path", - "required": true, - "type": "integer", - "description": "test foo", - "enum": [ - 1, - 2, - 3.14 - ] - }, - "Bar": { - "name": "bar", - "in": "path", - "required": true, - "type": "number", - "description": "test bar", - "enum": [ - 1.2, - "3.5", - 1 - ] - }, - "defaultCustomBlockResponseStatusCode": { - "description": "If the action type is block, this field defines the default customer overridable http response status code.", - "type": "integer", - "enum": [ - 200, - 403, - 405, - 406, - 429 - ] + "ConfigurationStoreProperties": { + "description": "The properties of a configuration store.", + "type": "object", + "properties": { + "provisioningState": { + "description": "The provisioning state of the configuration store.", + "enum": ["Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled", null], + "type": "string", + "readOnly": true, + "x-ms-enum": { + "name": "ProvisioningState", + "modelAsString": true + } + }, + "status": { + "description": "The state code.", + "enum": [true, 0], + "type": "boolean", + "readOnly": true, + "x-ms-enum": { + "name": "RespStatus", + "modelAsString": true + } + } } } - -} \ No newline at end of file + }, + "parameters": { + "Foo": { + "name": "foo", + "in": "path", + "required": true, + "type": "integer", + "description": "test foo", + "enum": [1, 2, 3.14] + }, + "Bar": { + "name": "bar", + "in": "path", + "required": true, + "type": "number", + "description": "test bar", + "enum": [1.2, "3.5", 1] + }, + "defaultCustomBlockResponseStatusCode": { + "description": "If the action type is block, this field defines the default customer overridable http response status code.", + "type": "integer", + "enum": [200, 403, 405, 406, 429] + } + } +} diff --git a/packages/rulesets/src/native/tests/resources/EnumUniqueValue.json b/packages/rulesets/src/native/tests/resources/EnumUniqueValue.json index a86704fce..fd4455ee7 100644 --- a/packages/rulesets/src/native/tests/resources/EnumUniqueValue.json +++ b/packages/rulesets/src/native/tests/resources/EnumUniqueValue.json @@ -1,106 +1,92 @@ { - "swagger": "2.0", - "info": { - "title": "SwaggerInventoryTests", - "description": "Use this swagger to test the inventory to detect response types with arrays as possible pageable operations", - "version": "2016-10-10" - }, - "host": "management.azure.com", - "paths": { - "/plants": { - "get": { - "description": "Get a list of plants.", - "operationId": "Plants_List", - "x-ms-pageable": { - "nextLinkName": "nextLink" - }, - "parameters": [], - "responses": { - "200": { - "description": "OK.", - "schema": { - "$ref": "#/definitions/PlantsList" - } - } - } + "swagger": "2.0", + "info": { + "title": "SwaggerInventoryTests", + "description": "Use this swagger to test the inventory to detect response types with arrays as possible pageable operations", + "version": "2016-10-10" + }, + "host": "management.azure.com", + "paths": { + "/plants": { + "get": { + "description": "Get a list of plants.", + "operationId": "Plants_List", + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "parameters": [], + "responses": { + "200": { + "description": "OK.", + "schema": { + "$ref": "#/definitions/PlantsList" } + } } - }, - "definitions": { - "PlantsList": { - "type": "object", - "description": "Response to a Pageable operation. This one lists plants", - "readOnly": true, - "properties": { - "value": { - "type": "array", - "description": "List of plants", - "items": { - "$ref": "#/definitions/Plant" - }, - "readOnly": true - }, - "nextLink": { - "type": "string", - "description": "Link to next page of results", - "readOnly": true - } - } + } + } + }, + "definitions": { + "PlantsList": { + "type": "object", + "description": "Response to a Pageable operation. This one lists plants", + "readOnly": true, + "properties": { + "value": { + "type": "array", + "description": "List of plants", + "items": { + "$ref": "#/definitions/Plant" + }, + "readOnly": true }, - "Plant": { - "type": "object", - "description": "A plant", - "properties": { - "name": { - "type": "string", - "description": "The plant's name" - }, - "edible": { - "type": "boolean", - "description": "Is the plant edible?" - } - } + "nextLink": { + "type": "string", + "description": "Link to next page of results", + "readOnly": true + } + } + }, + "Plant": { + "type": "object", + "description": "A plant", + "properties": { + "name": { + "type": "string", + "description": "The plant's name" }, - "ConfigurationStoreProperties": { - "description": "The properties of a configuration store.", - "type": "object", - "properties": { - "provisioningState": { - "description": "The provisioning state of the configuration store.", - "enum": [ - "Creating", - "Updating", - "Deleting", - "Succeeded", - "Failed", - "Canceled" - ], - "type": "string", - "readOnly": true, - "x-ms-enum": { - "name": "ProvisioningState", - "modelAsString": true - } - }, - "status": { - "description": "The state code.", - "enum": [ - "Success", - "Failed", - "FAILED" - ], - "readOnly": true, - "type": "string", - "x-ms-enum": { - "name": "RespStatus", - "modelAsString": true - } - - } - } + "edible": { + "type": "boolean", + "description": "Is the plant edible?" } - + } }, - "parameters": {} - -} \ No newline at end of file + "ConfigurationStoreProperties": { + "description": "The properties of a configuration store.", + "type": "object", + "properties": { + "provisioningState": { + "description": "The provisioning state of the configuration store.", + "enum": ["Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled"], + "type": "string", + "readOnly": true, + "x-ms-enum": { + "name": "ProvisioningState", + "modelAsString": true + } + }, + "status": { + "description": "The state code.", + "enum": ["Success", "Failed", "FAILED"], + "readOnly": true, + "type": "string", + "x-ms-enum": { + "name": "RespStatus", + "modelAsString": true + } + } + } + } + }, + "parameters": {} +} diff --git a/packages/rulesets/src/native/tests/resources/ErrorResponseMissing.json b/packages/rulesets/src/native/tests/resources/ErrorResponseMissing.json index 1d0de44b7..f72bc63d0 100644 --- a/packages/rulesets/src/native/tests/resources/ErrorResponseMissing.json +++ b/packages/rulesets/src/native/tests/resources/ErrorResponseMissing.json @@ -6,16 +6,10 @@ "version": "2014-04-01-preview" }, "host": "management.azure.com", - "schemes": [ - "https" - ], + "schemes": ["https"], "basePath": "/", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], + "produces": ["application/json"], + "consumes": ["application/json"], "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}": { "get": { @@ -34,20 +28,20 @@ "responses": { "400": { "description": "Created", - "schema":{ + "schema": { "$ref": "#/definitions/TestResource" } }, "500": { "description": "Created", - "schema":{ + "schema": { "$ref": "#/definitions/TestResource" } }, "default": { "description": "Unexpected error" } - } + } } } }, @@ -68,46 +62,44 @@ } }, "definitions": { - "Resource": { - "properties": { - "id": { - "type": "string", - "description": "Resource ID." - }, - "name": { - "readOnly": true, - "type": "string", - "description": "Resource name." - }, - "type": { - "readOnly": true, - "type": "string", - "description": "Resource type." - }, - "tag": { - "type":"object", - "description": "Resource tag." - } + "Resource": { + "properties": { + "id": { + "type": "string", + "description": "Resource ID." }, - "description": "Common resource representation.", - "x-ms-azure-resource": true + "name": { + "readOnly": true, + "type": "string", + "description": "Resource name." + }, + "type": { + "readOnly": true, + "type": "string", + "description": "Resource type." + }, + "tag": { + "type": "object", + "description": "Resource tag." + } }, - "TestResource": { - "description": "test", - "allOf": [ - {"$ref": "#/definitions/Resource"} - ], + "description": "Common resource representation.", + "x-ms-azure-resource": true + }, + "TestResource": { + "description": "test", + "allOf": [{ "$ref": "#/definitions/Resource" }], + "properties": { "properties": { - "properties":{ - "type":"object", - "description": "properties", - "properties": { - "provisioningState":{ - "type":"string" - } + "type": "object", + "description": "properties", + "properties": { + "provisioningState": { + "type": "string" } } } } + } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/InfoWithLicenseHeader.json b/packages/rulesets/src/native/tests/resources/InfoWithLicenseHeader.json index 8e06db751..429738387 100644 --- a/packages/rulesets/src/native/tests/resources/InfoWithLicenseHeader.json +++ b/packages/rulesets/src/native/tests/resources/InfoWithLicenseHeader.json @@ -1,12 +1,12 @@ { - "swagger": "2.0", - "info": { - "title": "SampleClient", - "description": "Simple OA without license", - "version": "0.0.0", - "x-ms-code-generation-settings": { - "header": "Invalid license" - } - }, - "host": "management.azure.com" -} \ No newline at end of file + "swagger": "2.0", + "info": { + "title": "SampleClient", + "description": "Simple OA without license", + "version": "0.0.0", + "x-ms-code-generation-settings": { + "header": "Invalid license" + } + }, + "host": "management.azure.com" +} diff --git a/packages/rulesets/src/native/tests/resources/InfoWithxmsCodeGenerationSetting.json b/packages/rulesets/src/native/tests/resources/InfoWithxmsCodeGenerationSetting.json index ec359e2cf..cabe47c54 100644 --- a/packages/rulesets/src/native/tests/resources/InfoWithxmsCodeGenerationSetting.json +++ b/packages/rulesets/src/native/tests/resources/InfoWithxmsCodeGenerationSetting.json @@ -1,55 +1,55 @@ { - "swagger": "2.0", - "info": { - "title": "ApiManagementClient", - "description": "Use these REST APIs for performing operations on tenant entity associated with your Azure API Management deployment. Using this entity you can manage properties and configuration that apply to the entire API Management service instance.", - "version": "2016-10-10", - "x-ms-code-generation-settings": { - "useDateTimeOffset": true - } - }, - "host": "management.azure.com", - "paths": { - "/simpleManualTrigger/get": { - "post": { - "description": "Trigger a run of the logic app.", - "operationId": "SimpleManual_Get", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "The request body.", - "required": false, - "schema": { - "$ref": "#/definitions/requestSimpleManualTrigger" - } - } - ], - "responses": { - "default": { - "description": "The Logic App Response.", - "schema": { - "type": "object" - } - } - } + "swagger": "2.0", + "info": { + "title": "ApiManagementClient", + "description": "Use these REST APIs for performing operations on tenant entity associated with your Azure API Management deployment. Using this entity you can manage properties and configuration that apply to the entire API Management service instance.", + "version": "2016-10-10", + "x-ms-code-generation-settings": { + "useDateTimeOffset": true + } + }, + "host": "management.azure.com", + "paths": { + "/simpleManualTrigger/get": { + "post": { + "description": "Trigger a run of the logic app.", + "operationId": "SimpleManual_Get", + "parameters": [ + { + "name": "body", + "in": "body", + "description": "The request body.", + "required": false, + "schema": { + "$ref": "#/definitions/requestSimpleManualTrigger" } - } - }, - "definitions": { - "requestSimpleManualTrigger": { - "type": "object", - "properties": { - "title": { - "type": "string", - "description": "Title." - }, - "sendEmail": { - "type": "boolean", - "description": "Whether to send email." - } + } + ], + "responses": { + "default": { + "description": "The Logic App Response.", + "schema": { + "type": "object" } + } + } + } + } + }, + "definitions": { + "requestSimpleManualTrigger": { + "type": "object", + "properties": { + "title": { + "type": "string", + "description": "Title." + }, + "sendEmail": { + "type": "boolean", + "description": "Whether to send email." } - }, - "parameters": {} -} \ No newline at end of file + } + } + }, + "parameters": {} +} diff --git a/packages/rulesets/src/native/tests/resources/IntegerWithoutFormat.json b/packages/rulesets/src/native/tests/resources/IntegerWithoutFormat.json index 0f0942731..713810e87 100644 --- a/packages/rulesets/src/native/tests/resources/IntegerWithoutFormat.json +++ b/packages/rulesets/src/native/tests/resources/IntegerWithoutFormat.json @@ -1,107 +1,97 @@ { - "swagger": "2.0", - "info": { - "title": "SwaggerInventoryTests", - "description": "Use this swagger to test the inventory to detect response types with arrays as possible pageable operations", - "version": "2016-10-10" - }, - "host": "management.azure.com", - "paths": { - "/plants": { - "put": { - "description": "Get a list of plants.", - "operationId": "Plants_List", - "x-ms-pageable": { - "nextLinkName": "nextLink" - }, - "parameters": [], - "responses": { - "200": { - "description": "OK.", - "schema": { - "$ref": "#/definitions/PlantsList" - } - } - } + "swagger": "2.0", + "info": { + "title": "SwaggerInventoryTests", + "description": "Use this swagger to test the inventory to detect response types with arrays as possible pageable operations", + "version": "2016-10-10" + }, + "host": "management.azure.com", + "paths": { + "/plants": { + "put": { + "description": "Get a list of plants.", + "operationId": "Plants_List", + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "parameters": [], + "responses": { + "200": { + "description": "OK.", + "schema": { + "$ref": "#/definitions/PlantsList" } + } } - }, - "definitions": { - "PlantsList": { - "type": "object", - "description": "Response to a Pageable operation. This one lists plants", - "readOnly": true, - "properties": { - "value": { - "type": "array", - "description": "List of plants", - "items": { - "$ref": "#/definitions/Plant" - }, - "readOnly": true - }, - "nextLink": { - "type": "string", - "description": "Link to next page of results", - "readOnly": true - }, - "minimum": { - "type": "integer", - "readOnly": true, - "description": "The minimum capacity." - } - } + } + } + }, + "definitions": { + "PlantsList": { + "type": "object", + "description": "Response to a Pageable operation. This one lists plants", + "readOnly": true, + "properties": { + "value": { + "type": "array", + "description": "List of plants", + "items": { + "$ref": "#/definitions/Plant" + }, + "readOnly": true }, - "Plant": { - "type": "object", - "description": "A plant", - "properties": { - "name": { - "type": "string", - "description": "The plant's name" - }, - "edible": { - "type": "boolean", - "description": "Is the plant edible?" - } - } + "nextLink": { + "type": "string", + "description": "Link to next page of results", + "readOnly": true }, - "ConfigurationStoreProperties": { - "description": "The properties of a configuration store.", - "type": "object", - "properties": { - "provisioningState": { - "description": "The provisioning state of the configuration store.", - "enum": [ - "Creating", - "Updating", - "Deleting", - "Succeeded", - "Failed", - "Canceled" - ], - "type": "string", - "readOnly": true, - "x-ms-enum": { - "name": "RespStatus", - "modelAsString": true - } - }, - "status": { - "description": "The state code.", - "enum": [ - "Success", - "FAILED" - ], - "readOnly": true, - "type": "string", - "x-ms-enum": { - "name": "RespStatus", - "modelAsString": true - } - } - } + "minimum": { + "type": "integer", + "readOnly": true, + "description": "The minimum capacity." } + } }, - "parameters": {} -} \ No newline at end of file + "Plant": { + "type": "object", + "description": "A plant", + "properties": { + "name": { + "type": "string", + "description": "The plant's name" + }, + "edible": { + "type": "boolean", + "description": "Is the plant edible?" + } + } + }, + "ConfigurationStoreProperties": { + "description": "The properties of a configuration store.", + "type": "object", + "properties": { + "provisioningState": { + "description": "The provisioning state of the configuration store.", + "enum": ["Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled"], + "type": "string", + "readOnly": true, + "x-ms-enum": { + "name": "RespStatus", + "modelAsString": true + } + }, + "status": { + "description": "The state code.", + "enum": ["Success", "FAILED"], + "readOnly": true, + "type": "string", + "x-ms-enum": { + "name": "RespStatus", + "modelAsString": true + } + } + } + } + }, + "parameters": {} +} diff --git a/packages/rulesets/src/native/tests/resources/NestedSchema.json b/packages/rulesets/src/native/tests/resources/NestedSchema.json index 3cb83b850..969de4bfa 100644 --- a/packages/rulesets/src/native/tests/resources/NestedSchema.json +++ b/packages/rulesets/src/native/tests/resources/NestedSchema.json @@ -1,51 +1,51 @@ { - "definitions": { - "ErrorResponse": { - "allOf": [ + "definitions": { + "ErrorResponse": { + "allOf": [ + { + "properties": { + "error": { + "allOf": [ { - "properties": { - "error": { - "allOf": [ - { - "readOnly": true - }, - { - "$ref": "#/definitions/Error" - } - ] - } - }, - "description": "The key vault error exception." - } - ] - }, - "Error": { - "properties": { - "code": { - "type": "string", - "readOnly": true, - "description": "The error code." + "readOnly": true }, - "message": { - "type": "string", - "readOnly": true, - "description": "The error message." + { + "$ref": "#/definitions/Error" } + ] } + }, + "description": "The key vault error exception." + } + ] + }, + "Error": { + "properties": { + "code": { + "type": "string", + "readOnly": true, + "description": "The error code." }, - "Error1": { - "properties": { - "message": { - "type": "string", - "readOnly": true, - "description": "The error message." - }, - "innererror": { - "x-ms-client-name": "innerError", - "readOnly": true, - "$ref": "#/definitions/Error1" - } - } + "message": { + "type": "string", + "readOnly": true, + "description": "The error message." + } + } + }, + "Error1": { + "properties": { + "message": { + "type": "string", + "readOnly": true, + "description": "The error message." + }, + "innererror": { + "x-ms-client-name": "innerError", + "readOnly": true, + "$ref": "#/definitions/Error1" } + } } -} \ No newline at end of file + } +} diff --git a/packages/rulesets/src/native/tests/resources/NestedSchema1.json b/packages/rulesets/src/native/tests/resources/NestedSchema1.json index 7e53bb48d..4a51de222 100644 --- a/packages/rulesets/src/native/tests/resources/NestedSchema1.json +++ b/packages/rulesets/src/native/tests/resources/NestedSchema1.json @@ -7,7 +7,7 @@ } ], "properties": { - "properties":{ + "properties": { "details": { "type": "string", "readOnly": true, diff --git a/packages/rulesets/src/native/tests/resources/NewApiVersionHaveOperationWithoutSystemData.json b/packages/rulesets/src/native/tests/resources/NewApiVersionHaveOperationWithoutSystemData.json index 0f18a645c..4e2f93e42 100644 --- a/packages/rulesets/src/native/tests/resources/NewApiVersionHaveOperationWithoutSystemData.json +++ b/packages/rulesets/src/native/tests/resources/NewApiVersionHaveOperationWithoutSystemData.json @@ -1,134 +1,134 @@ { - "swagger": "2.0", - "info": { - "title": "SwaggerInventoryTests", - "description": "Use this swagger to test the inventory to detect response types with arrays as possible pageable operations", - "version": "2020-05-01" - }, - "host": "management.azure.com", - "paths": { - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MyRP/plants": { - "get": { - "description": "Get a list of plants.", - "operationId": "Plants_List", - "parameters": [], - "responses": { - "200": { - "description": "OK.", - "schema": { - "$ref": "#/definitions/PlantsList" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } + "swagger": "2.0", + "info": { + "title": "SwaggerInventoryTests", + "description": "Use this swagger to test the inventory to detect response types with arrays as possible pageable operations", + "version": "2020-05-01" + }, + "host": "management.azure.com", + "paths": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MyRP/plants": { + "get": { + "description": "Get a list of plants.", + "operationId": "Plants_List", + "parameters": [], + "responses": { + "200": { + "description": "OK.", + "schema": { + "$ref": "#/definitions/PlantsList" } + } }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MyRP/plants/{name}": { - "get": { - "description": "Get a list of plants.", - "operationId": "Plants_Get", - "parameters": [], - "responses": { - "200": { - "description": "OK.", - "schema": { - "$ref": "#/definitions/Plant" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - }, - "put": { - "description": "Create plants.", - "operationId": "Plants_Create", - "parameters": [], - "responses": { - "200": { - "description": "OK.", - "schema": { - "$ref": "#/definitions/Plant" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } + "x-ms-pageable": { + "nextLinkName": "nextLink" } + } }, - "definitions": { - "PlantsList": { - "type": "object", - "description": "Response to a Pageable operation. This one lists plants", - "readOnly": true, - "properties": { - "value": { - "type": "array", - "description": "List of plants", - "items": { - "$ref": "#/definitions/Plant" - }, - "readOnly": true - } + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MyRP/plants/{name}": { + "get": { + "description": "Get a list of plants.", + "operationId": "Plants_Get", + "parameters": [], + "responses": { + "200": { + "description": "OK.", + "schema": { + "$ref": "#/definitions/Plant" } + } }, - "Plant": { - "type": "object", - "description": "A plant", - "properties": { - "name": { - "type": "string", - "description": "The plant's name" - }, - "edible": { - "type": "boolean", - "description": "Is the plant edible?" - } - }, - "x-ms-azure-resource":true - }, - "systemData": { - "description": "Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources", - "type": "object", - "properties": { - "createdBy": { - "description": "A string identifier for the identity that created the resource", - "type": "string", - "readOnly": true - }, - "createdByType": { - "description": "The type of identity that created the resource: user, application, managedIdentity, key", - "type": "string", - "readOnly": true - }, - "createdAt": { - "format": "date-time", - "description": "The timestamp of resource creation (UTC)", - "type": "string", - "readOnly": true - }, - "lastModifiedBy": { - "description": "A string identifier for the identity that last modified the resource", - "type": "string", - "readOnly": true - }, - "lastModifiedByType": { - "description": "The type of identity that last modified the resource: user, application, managedIdentity, key", - "type": "string", - "readOnly": true - }, - "lastModifiedAt": { - "format": "date-time", - "description": "The timestamp of resource last modification (UTC)", - "type": "string", - "readOnly": true - } + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + }, + "put": { + "description": "Create plants.", + "operationId": "Plants_Create", + "parameters": [], + "responses": { + "200": { + "description": "OK.", + "schema": { + "$ref": "#/definitions/Plant" } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + } + }, + "definitions": { + "PlantsList": { + "type": "object", + "description": "Response to a Pageable operation. This one lists plants", + "readOnly": true, + "properties": { + "value": { + "type": "array", + "description": "List of plants", + "items": { + "$ref": "#/definitions/Plant" + }, + "readOnly": true } + } }, - "parameters": {} -} \ No newline at end of file + "Plant": { + "type": "object", + "description": "A plant", + "properties": { + "name": { + "type": "string", + "description": "The plant's name" + }, + "edible": { + "type": "boolean", + "description": "Is the plant edible?" + } + }, + "x-ms-azure-resource": true + }, + "systemData": { + "description": "Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources", + "type": "object", + "properties": { + "createdBy": { + "description": "A string identifier for the identity that created the resource", + "type": "string", + "readOnly": true + }, + "createdByType": { + "description": "The type of identity that created the resource: user, application, managedIdentity, key", + "type": "string", + "readOnly": true + }, + "createdAt": { + "format": "date-time", + "description": "The timestamp of resource creation (UTC)", + "type": "string", + "readOnly": true + }, + "lastModifiedBy": { + "description": "A string identifier for the identity that last modified the resource", + "type": "string", + "readOnly": true + }, + "lastModifiedByType": { + "description": "The type of identity that last modified the resource: user, application, managedIdentity, key", + "type": "string", + "readOnly": true + }, + "lastModifiedAt": { + "format": "date-time", + "description": "The timestamp of resource last modification (UTC)", + "type": "string", + "readOnly": true + } + } + } + }, + "parameters": {} +} diff --git a/packages/rulesets/src/native/tests/resources/NotOnlyDefaultResponseSchema.json b/packages/rulesets/src/native/tests/resources/NotOnlyDefaultResponseSchema.json index dff69d27c..b4cc722a1 100644 --- a/packages/rulesets/src/native/tests/resources/NotOnlyDefaultResponseSchema.json +++ b/packages/rulesets/src/native/tests/resources/NotOnlyDefaultResponseSchema.json @@ -1,61 +1,61 @@ { - "swagger": "2.0", - "info": { - "title": "SwaggerInventoryTests", - "description": "Use this swagger to test the inventory to detect response types with arrays as possible pageable operations", - "version": "2016-10-10" - }, - "host": "management.azure.com", - "paths": { - "/plants": { - "get": { - "description": "Get a list of plants.", - "operationId": "Plants_List", - "x-ms-pageable": { - "nextLinkName": "nextLink" - }, - "parameters": [], - "responses": { - "default": { - "description": "Failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "200": { - "description": "succeed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } + "swagger": "2.0", + "info": { + "title": "SwaggerInventoryTests", + "description": "Use this swagger to test the inventory to detect response types with arrays as possible pageable operations", + "version": "2016-10-10" + }, + "host": "management.azure.com", + "paths": { + "/plants": { + "get": { + "description": "Get a list of plants.", + "operationId": "Plants_List", + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "parameters": [], + "responses": { + "default": { + "description": "Failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "200": { + "description": "succeed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" } + } } + } + } + }, + "definitions": { + "ErrorResponse": { + "properties": { + "error": { + "readOnly": true, + "$ref": "#/definitions/Error" + } + }, + "description": "The key vault error exception." }, - "definitions": { - "ErrorResponse": { - "properties": { - "error": { - "readOnly": true, - "$ref": "#/definitions/Error" - } - }, - "description": "The key vault error exception." + "Error": { + "properties": { + "message": { + "type": "string", + "readOnly": true, + "description": "The error message." }, - "Error": { - "properties": { - "message": { - "type": "string", - "readOnly": true, - "description": "The error message." - }, - "code": { - "type": "string", - "readOnly": true, - "description": "The error code." - } - } + "code": { + "type": "string", + "readOnly": true, + "description": "The error code." } - }, - "parameters": {} -} \ No newline at end of file + } + } + }, + "parameters": {} +} diff --git a/packages/rulesets/src/native/tests/resources/OnlyDefaultResponseSchema.json b/packages/rulesets/src/native/tests/resources/OnlyDefaultResponseSchema.json index 6ff27e16a..186de8ff0 100644 --- a/packages/rulesets/src/native/tests/resources/OnlyDefaultResponseSchema.json +++ b/packages/rulesets/src/native/tests/resources/OnlyDefaultResponseSchema.json @@ -1,55 +1,55 @@ { - "swagger": "2.0", - "info": { - "title": "SwaggerInventoryTests", - "description": "Use this swagger to test the inventory to detect response types with arrays as possible pageable operations", - "version": "2016-10-10" - }, - "host": "management.azure.com", - "paths": { - "/plants": { - "get": { - "description": "Get a list of plants.", - "operationId": "Plants_List", - "x-ms-pageable": { - "nextLinkName": "nextLink" - }, - "parameters": [], - "responses": { - "default": { - "description": "Failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } + "swagger": "2.0", + "info": { + "title": "SwaggerInventoryTests", + "description": "Use this swagger to test the inventory to detect response types with arrays as possible pageable operations", + "version": "2016-10-10" + }, + "host": "management.azure.com", + "paths": { + "/plants": { + "get": { + "description": "Get a list of plants.", + "operationId": "Plants_List", + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "parameters": [], + "responses": { + "default": { + "description": "Failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" } + } + } + } + } + }, + "definitions": { + "ErrorResponse": { + "properties": { + "error": { + "readOnly": true, + "$ref": "#/definitions/Error" } + }, + "description": "The key vault error exception." }, - "definitions": { - "ErrorResponse": { - "properties": { - "error": { - "readOnly": true, - "$ref": "#/definitions/Error" - } - }, - "description": "The key vault error exception." + "Error": { + "properties": { + "message": { + "type": "string", + "readOnly": true, + "description": "The error message." }, - "Error": { - "properties": { - "message": { - "type": "string", - "readOnly": true, - "description": "The error message." - }, - "code": { - "type": "string", - "readOnly": true, - "description": "The error code." - } - } + "code": { + "type": "string", + "readOnly": true, + "description": "The error code." } - }, - "parameters": {} -} \ No newline at end of file + } + } + }, + "parameters": {} +} diff --git a/packages/rulesets/src/native/tests/resources/OperationIdMissed.json b/packages/rulesets/src/native/tests/resources/OperationIdMissed.json index 924110cf7..b7e4ce30e 100644 --- a/packages/rulesets/src/native/tests/resources/OperationIdMissed.json +++ b/packages/rulesets/src/native/tests/resources/OperationIdMissed.json @@ -6,16 +6,10 @@ "version": "2014-04-01-preview" }, "host": "management.azure.com", - "schemes": [ - "https" - ], + "schemes": ["https"], "basePath": "/", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], + "produces": ["application/json"], + "consumes": ["application/json"], "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}": { "post": { @@ -74,4 +68,4 @@ "description": "test api version" } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/PageableOperation.json b/packages/rulesets/src/native/tests/resources/PageableOperation.json index 2b135cb2b..e2a02fd3f 100644 --- a/packages/rulesets/src/native/tests/resources/PageableOperation.json +++ b/packages/rulesets/src/native/tests/resources/PageableOperation.json @@ -1,63 +1,63 @@ { - "swagger": "2.0", - "info": { - "title": "SwaggerInventoryTests", - "description": "Use this swagger to test the inventory to detect response types with arrays as possible pageable operations", - "version": "2016-10-10" - }, - "host": "management.azure.com", - "paths": { - "/plants": { - "get": { - "description": "Get a list of plants.", - "operationId": "Plants_List", - "parameters": [], - "responses": { - "200": { - "description": "OK.", - "schema": { - "$ref": "#/definitions/PlantsList" - } - } - } + "swagger": "2.0", + "info": { + "title": "SwaggerInventoryTests", + "description": "Use this swagger to test the inventory to detect response types with arrays as possible pageable operations", + "version": "2016-10-10" + }, + "host": "management.azure.com", + "paths": { + "/plants": { + "get": { + "description": "Get a list of plants.", + "operationId": "Plants_List", + "parameters": [], + "responses": { + "200": { + "description": "OK.", + "schema": { + "$ref": "#/definitions/PlantsList" } + } } - }, - "definitions": { - "PlantsList": { - "type": "object", - "description": "Response to a Pageable operation. This one lists plants", - "readOnly": true, - "properties": { - "value": { - "type": "array", - "description": "List of plants", - "items": { - "$ref": "#/definitions/Plant" - }, - "readOnly": true - }, - "nextLink": { - "type": "string", - "description": "Link to next page of results", - "readOnly": true - } - } + } + } + }, + "definitions": { + "PlantsList": { + "type": "object", + "description": "Response to a Pageable operation. This one lists plants", + "readOnly": true, + "properties": { + "value": { + "type": "array", + "description": "List of plants", + "items": { + "$ref": "#/definitions/Plant" + }, + "readOnly": true }, - "Plant": { - "type": "object", - "description": "A plant", - "properties": { - "name": { - "type": "string", - "description": "The plant's name" - }, - "edible": { - "type": "boolean", - "description": "Is the plant edible?" - } - } + "nextLink": { + "type": "string", + "description": "Link to next page of results", + "readOnly": true } + } }, - "parameters": {} -} \ No newline at end of file + "Plant": { + "type": "object", + "description": "A plant", + "properties": { + "name": { + "type": "string", + "description": "The plant's name" + }, + "edible": { + "type": "boolean", + "description": "Is the plant edible?" + } + } + } + }, + "parameters": {} +} diff --git a/packages/rulesets/src/native/tests/resources/PageableOperationWithCorrespondingProp.json b/packages/rulesets/src/native/tests/resources/PageableOperationWithCorrespondingProp.json index 7e27aa90b..64cb9dc84 100644 --- a/packages/rulesets/src/native/tests/resources/PageableOperationWithCorrespondingProp.json +++ b/packages/rulesets/src/native/tests/resources/PageableOperationWithCorrespondingProp.json @@ -1,65 +1,65 @@ { - "swagger": "2.0", - "info": { - "title": "SwaggerInventoryTests", - "description": "Use this swagger to test the inventory to detect response types with arrays as possible pageable operations", - "version": "2016-10-10" - }, - "host": "management.azure.com", - "paths": { - "/plants": { - "get": { - "description": "Get a list of plants.", - "operationId": "Plants_List", - "parameters": [], - "responses": { - "200": { - "description": "OK.", - "schema": { - "$ref": "#/definitions/PlantsList" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } + "swagger": "2.0", + "info": { + "title": "SwaggerInventoryTests", + "description": "Use this swagger to test the inventory to detect response types with arrays as possible pageable operations", + "version": "2016-10-10" + }, + "host": "management.azure.com", + "paths": { + "/plants": { + "get": { + "description": "Get a list of plants.", + "operationId": "Plants_List", + "parameters": [], + "responses": { + "200": { + "description": "OK.", + "schema": { + "$ref": "#/definitions/PlantsList" } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" } - }, - "definitions": { - "PlantsList": { - "type": "object", - "description": "Response to a Pageable operation. This one lists plants", - "readOnly": true, - "properties": { - "value": { - "type": "array", - "description": "List of plants", - "items": { - "$ref": "#/definitions/Plant" - }, - "readOnly": true - }, - "nextLink":{ - "type":"string", - "description": "next link" - } - } + } + } + }, + "definitions": { + "PlantsList": { + "type": "object", + "description": "Response to a Pageable operation. This one lists plants", + "readOnly": true, + "properties": { + "value": { + "type": "array", + "description": "List of plants", + "items": { + "$ref": "#/definitions/Plant" + }, + "readOnly": true }, - "Plant": { - "type": "object", - "description": "A plant", - "properties": { - "name": { - "type": "string", - "description": "The plant's name" - }, - "edible": { - "type": "boolean", - "description": "Is the plant edible?" - } - } + "nextLink": { + "type": "string", + "description": "next link" } + } }, - "parameters": {} -} \ No newline at end of file + "Plant": { + "type": "object", + "description": "A plant", + "properties": { + "name": { + "type": "string", + "description": "The plant's name" + }, + "edible": { + "type": "boolean", + "description": "Is the plant edible?" + } + } + } + }, + "parameters": {} +} diff --git a/packages/rulesets/src/native/tests/resources/PageableOperationWithNullNextLink.json b/packages/rulesets/src/native/tests/resources/PageableOperationWithNullNextLink.json index eaebaa0da..d26628aee 100644 --- a/packages/rulesets/src/native/tests/resources/PageableOperationWithNullNextLink.json +++ b/packages/rulesets/src/native/tests/resources/PageableOperationWithNullNextLink.json @@ -1,61 +1,61 @@ { - "swagger": "2.0", - "info": { - "title": "SwaggerInventoryTests", - "description": "Use this swagger to test the inventory to detect response types with arrays as possible pageable operations", - "version": "2016-10-10" - }, - "host": "management.azure.com", - "paths": { - "/plants": { - "get": { - "description": "Get a list of plants.", - "operationId": "Plants_List", - "parameters": [], - "responses": { - "200": { - "description": "OK.", - "schema": { - "$ref": "#/definitions/PlantsList" - } - } - }, - "x-ms-pageable": { - "nextLinkName": null - } + "swagger": "2.0", + "info": { + "title": "SwaggerInventoryTests", + "description": "Use this swagger to test the inventory to detect response types with arrays as possible pageable operations", + "version": "2016-10-10" + }, + "host": "management.azure.com", + "paths": { + "/plants": { + "get": { + "description": "Get a list of plants.", + "operationId": "Plants_List", + "parameters": [], + "responses": { + "200": { + "description": "OK.", + "schema": { + "$ref": "#/definitions/PlantsList" } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + } + }, + "definitions": { + "PlantsList": { + "type": "object", + "description": "Response to a Pageable operation. This one lists plants", + "readOnly": true, + "properties": { + "value": { + "type": "array", + "description": "List of plants", + "items": { + "$ref": "#/definitions/Plant" + }, + "readOnly": true } + } }, - "definitions": { - "PlantsList": { - "type": "object", - "description": "Response to a Pageable operation. This one lists plants", - "readOnly": true, - "properties": { - "value": { - "type": "array", - "description": "List of plants", - "items": { - "$ref": "#/definitions/Plant" - }, - "readOnly": true - } - } + "Plant": { + "type": "object", + "description": "A plant", + "properties": { + "name": { + "type": "string", + "description": "The plant's name" }, - "Plant": { - "type": "object", - "description": "A plant", - "properties": { - "name": { - "type": "string", - "description": "The plant's name" - }, - "edible": { - "type": "boolean", - "description": "Is the plant edible?" - } - } + "edible": { + "type": "boolean", + "description": "Is the plant edible?" } - }, - "parameters": {} -} \ No newline at end of file + } + } + }, + "parameters": {} +} diff --git a/packages/rulesets/src/native/tests/resources/PageableOperationWithoutCorrespondingProp.json b/packages/rulesets/src/native/tests/resources/PageableOperationWithoutCorrespondingProp.json index 30f5b01ce..38660bbb3 100644 --- a/packages/rulesets/src/native/tests/resources/PageableOperationWithoutCorrespondingProp.json +++ b/packages/rulesets/src/native/tests/resources/PageableOperationWithoutCorrespondingProp.json @@ -1,61 +1,61 @@ { - "swagger": "2.0", - "info": { - "title": "SwaggerInventoryTests", - "description": "Use this swagger to test the inventory to detect response types with arrays as possible pageable operations", - "version": "2016-10-10" - }, - "host": "management.azure.com", - "paths": { - "/plants": { - "get": { - "description": "Get a list of plants.", - "operationId": "Plants_List", - "parameters": [], - "responses": { - "200": { - "description": "OK.", - "schema": { - "$ref": "#/definitions/PlantsList" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } + "swagger": "2.0", + "info": { + "title": "SwaggerInventoryTests", + "description": "Use this swagger to test the inventory to detect response types with arrays as possible pageable operations", + "version": "2016-10-10" + }, + "host": "management.azure.com", + "paths": { + "/plants": { + "get": { + "description": "Get a list of plants.", + "operationId": "Plants_List", + "parameters": [], + "responses": { + "200": { + "description": "OK.", + "schema": { + "$ref": "#/definitions/PlantsList" } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + } + }, + "definitions": { + "PlantsList": { + "type": "object", + "description": "Response to a Pageable operation. This one lists plants", + "readOnly": true, + "properties": { + "value": { + "type": "array", + "description": "List of plants", + "items": { + "$ref": "#/definitions/Plant" + }, + "readOnly": true } + } }, - "definitions": { - "PlantsList": { - "type": "object", - "description": "Response to a Pageable operation. This one lists plants", - "readOnly": true, - "properties": { - "value": { - "type": "array", - "description": "List of plants", - "items": { - "$ref": "#/definitions/Plant" - }, - "readOnly": true - } - } + "Plant": { + "type": "object", + "description": "A plant", + "properties": { + "name": { + "type": "string", + "description": "The plant's name" }, - "Plant": { - "type": "object", - "description": "A plant", - "properties": { - "name": { - "type": "string", - "description": "The plant's name" - }, - "edible": { - "type": "boolean", - "description": "Is the plant edible?" - } - } + "edible": { + "type": "boolean", + "description": "Is the plant edible?" } - }, - "parameters": {} -} \ No newline at end of file + } + } + }, + "parameters": {} +} diff --git a/packages/rulesets/src/native/tests/resources/PathResourceProviderNamePascalCase.json b/packages/rulesets/src/native/tests/resources/PathResourceProviderNamePascalCase.json index f4b70c3ca..ed3ffe7a8 100644 --- a/packages/rulesets/src/native/tests/resources/PathResourceProviderNamePascalCase.json +++ b/packages/rulesets/src/native/tests/resources/PathResourceProviderNamePascalCase.json @@ -1,121 +1,111 @@ { - "swagger": "2.0", - "info": { - "title": "Microsoft Azure Redis Cache Management API", - "description": "Some cool documentation.", - "version": "2014-04-01-preview" - }, - "host": "management.azure.com", - "schemes": [ - "https" - ], - "basePath": "/", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], - "paths": { - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.cache/redis/{name}": { - "delete": { - "tags": [ - "Redis" - ], - "operationId": "Redis_Delete", - "description": "Deletes a Redis cache.", - "x-ms-long-running-operation": true, - "parameters": [{ - "name": "resourceGroupName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the resource group." - }, - { - "name": "nodeNameSameAsDescriptionName", - "in": "path", - "required": true, - "type": "string", - "description": "nodeNameSameAsDescriptionName.", - "x-ms-client-name": "name" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParamterer" - } - ], - "responses": { - "200": { - "description": "description." - }, - "204": { - "description": "" - } - } - } - }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}": { - "get": { - "operationId": "HDInsight_Get" - } - } - - }, - "definitions": { - "Resource": { - "description": "The Resource model definition.", - "properties": { - "id": { - "readOnly": true, - "type": "string", - "x-ms-client-name": "id", - "description": "Resource Id" - }, - "name": { - "readOnly": true, - "type": "string", - "description": "Resource name" - }, - "type": { - "readOnly": true, - "type": "string", - "description": "Resource type" - }, - "location": { - "type": "string", - "description": "Resource location" - }, - "tags": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Resource tags" - } - }, - "required": [ - "location" - ], - "x-ms-azure-resource": true - } - }, - "parameters": { - "SubscriptionIdParamterer": { - "name": "subscriptionId", + "swagger": "2.0", + "info": { + "title": "Microsoft Azure Redis Cache Management API", + "description": "Some cool documentation.", + "version": "2014-04-01-preview" + }, + "host": "management.azure.com", + "schemes": ["https"], + "basePath": "/", + "produces": ["application/json"], + "consumes": ["application/json"], + "paths": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.cache/redis/{name}": { + "delete": { + "tags": ["Redis"], + "operationId": "Redis_Delete", + "description": "Deletes a Redis cache.", + "x-ms-long-running-operation": true, + "parameters": [ + { + "name": "resourceGroupName", "in": "path", - "description": "Subscription ID.", "required": true, - "type": "string" - }, - "ApiVersionParameter": { - "name": "apiVersion", + "type": "string", + "description": "The name of the resource group." + }, + { + "name": "nodeNameSameAsDescriptionName", "in": "path", - "description": "API ID.", "required": true, + "type": "string", + "description": "nodeNameSameAsDescriptionName.", + "x-ms-client-name": "name" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParamterer" + } + ], + "responses": { + "200": { + "description": "description." + }, + "204": { + "description": "" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}": { + "get": { + "operationId": "HDInsight_Get" + } + } + }, + "definitions": { + "Resource": { + "description": "The Resource model definition.", + "properties": { + "id": { + "readOnly": true, + "type": "string", + "x-ms-client-name": "id", + "description": "Resource Id" + }, + "name": { + "readOnly": true, + "type": "string", + "description": "Resource name" + }, + "type": { + "readOnly": true, + "type": "string", + "description": "Resource type" + }, + "location": { + "type": "string", + "description": "Resource location" + }, + "tags": { + "type": "object", + "additionalProperties": { "type": "string" + }, + "description": "Resource tags" } + }, + "required": ["location"], + "x-ms-azure-resource": true + } + }, + "parameters": { + "SubscriptionIdParamterer": { + "name": "subscriptionId", + "in": "path", + "description": "Subscription ID.", + "required": true, + "type": "string" + }, + "ApiVersionParameter": { + "name": "apiVersion", + "in": "path", + "description": "API ID.", + "required": true, + "type": "string" } -} \ No newline at end of file + } +} diff --git a/packages/rulesets/src/native/tests/resources/PathResourceTypeNameCamelCase.json b/packages/rulesets/src/native/tests/resources/PathResourceTypeNameCamelCase.json index 7583ac083..9b5641f93 100644 --- a/packages/rulesets/src/native/tests/resources/PathResourceTypeNameCamelCase.json +++ b/packages/rulesets/src/native/tests/resources/PathResourceTypeNameCamelCase.json @@ -1,115 +1,106 @@ { - "swagger": "2.0", - "info": { - "title": "Microsoft Azure Redis Cache Management API", - "description": "Some cool documentation.", - "version": "2014-04-01-preview" - }, - "host": "management.azure.com", - "schemes": [ - "https" - ], - "basePath": "/", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], - "paths": { - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Component/redis/{name}": { - "delete": { - "tags": [ - "Redis" - ], - "operationId": "Redis_Delete", - "description": "Deletes a Redis cache.", - "x-ms-long-running-operation": true, - "parameters": [{ - "name": "resourceGroupName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the resource group." - }, - { - "name": "nodeNameSameAsDescriptionName", - "in": "path", - "required": true, - "type": "string", - "description": "nodeNameSameAsDescriptionName.", - "x-ms-client-name": "name" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParamterer" - } - ], - "responses": { - "200": { - "description": "description." - }, - "204": { - "description": "" - } - } - } - } - }, - "definitions": { - "Resource": { - "description": "The Resource model definition.", - "properties": { - "id": { - "readOnly": true, - "type": "string", - "x-ms-client-name": "id", - "description": "Resource Id" - }, - "name": { - "readOnly": true, - "type": "string", - "description": "Resource name" - }, - "type": { - "readOnly": true, - "type": "string", - "description": "Resource type" - }, - "location": { - "type": "string", - "description": "Resource location" - }, - "tags": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Resource tags" - } - }, - "required": [ - "location" - ], - "x-ms-azure-resource": true - } - }, - "parameters": { - "SubscriptionIdParamterer": { - "name": "subscriptionId", + "swagger": "2.0", + "info": { + "title": "Microsoft Azure Redis Cache Management API", + "description": "Some cool documentation.", + "version": "2014-04-01-preview" + }, + "host": "management.azure.com", + "schemes": ["https"], + "basePath": "/", + "produces": ["application/json"], + "consumes": ["application/json"], + "paths": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Component/redis/{name}": { + "delete": { + "tags": ["Redis"], + "operationId": "Redis_Delete", + "description": "Deletes a Redis cache.", + "x-ms-long-running-operation": true, + "parameters": [ + { + "name": "resourceGroupName", "in": "path", - "description": "Subscription ID.", "required": true, - "type": "string" - }, - "ApiVersionParameter": { - "name": "apiVersion", + "type": "string", + "description": "The name of the resource group." + }, + { + "name": "nodeNameSameAsDescriptionName", "in": "path", - "description": "API ID.", "required": true, + "type": "string", + "description": "nodeNameSameAsDescriptionName.", + "x-ms-client-name": "name" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParamterer" + } + ], + "responses": { + "200": { + "description": "description." + }, + "204": { + "description": "" + } + } + } + } + }, + "definitions": { + "Resource": { + "description": "The Resource model definition.", + "properties": { + "id": { + "readOnly": true, + "type": "string", + "x-ms-client-name": "id", + "description": "Resource Id" + }, + "name": { + "readOnly": true, + "type": "string", + "description": "Resource name" + }, + "type": { + "readOnly": true, + "type": "string", + "description": "Resource type" + }, + "location": { + "type": "string", + "description": "Resource location" + }, + "tags": { + "type": "object", + "additionalProperties": { "type": "string" + }, + "description": "Resource tags" } + }, + "required": ["location"], + "x-ms-azure-resource": true + } + }, + "parameters": { + "SubscriptionIdParamterer": { + "name": "subscriptionId", + "in": "path", + "description": "Subscription ID.", + "required": true, + "type": "string" + }, + "ApiVersionParameter": { + "name": "apiVersion", + "in": "path", + "description": "API ID.", + "required": true, + "type": "string" } -} \ No newline at end of file + } +} diff --git a/packages/rulesets/src/native/tests/resources/PostOperationIdWithoutUrlVerb.json b/packages/rulesets/src/native/tests/resources/PostOperationIdWithoutUrlVerb.json index 8edffcefb..771c29592 100644 --- a/packages/rulesets/src/native/tests/resources/PostOperationIdWithoutUrlVerb.json +++ b/packages/rulesets/src/native/tests/resources/PostOperationIdWithoutUrlVerb.json @@ -1,52 +1,52 @@ { - "swagger": "2.0", - "info": { - "title": "ApiManagementClient", - "description": "Use these REST APIs for performing operations on tenant entity associated with your Azure API Management deployment. Using this entity you can manage properties and configuration that apply to the entire API Management service instance.", - "version": "2016-10-10" - }, - "host": "management.azure.com", - "paths": { - "/simpleManualTrigger/paths/invoke": { - "post": { - "description": "Trigger a run of the logic app.", - "operationId": "simpleManualTrigger_call", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "The request body.", - "required": false, - "schema": { - "$ref": "#/definitions/requestSimpleManualTrigger" - } - } - ], - "responses": { - "default": { - "description": "The Logic App Response.", - "schema": { - "type": "object" - } - } - } + "swagger": "2.0", + "info": { + "title": "ApiManagementClient", + "description": "Use these REST APIs for performing operations on tenant entity associated with your Azure API Management deployment. Using this entity you can manage properties and configuration that apply to the entire API Management service instance.", + "version": "2016-10-10" + }, + "host": "management.azure.com", + "paths": { + "/simpleManualTrigger/paths/invoke": { + "post": { + "description": "Trigger a run of the logic app.", + "operationId": "simpleManualTrigger_call", + "parameters": [ + { + "name": "body", + "in": "body", + "description": "The request body.", + "required": false, + "schema": { + "$ref": "#/definitions/requestSimpleManualTrigger" } - } - }, - "definitions": { - "requestSimpleManualTrigger": { - "type": "object", - "properties": { - "title": { - "type": "string", - "description": "Title." - }, - "sendEmail": { - "type": "boolean", - "description": "Whether to send email." - } + } + ], + "responses": { + "default": { + "description": "The Logic App Response.", + "schema": { + "type": "object" } + } + } + } + } + }, + "definitions": { + "requestSimpleManualTrigger": { + "type": "object", + "properties": { + "title": { + "type": "string", + "description": "Title." + }, + "sendEmail": { + "type": "boolean", + "description": "Whether to send email." } - }, - "parameters": {} -} \ No newline at end of file + } + } + }, + "parameters": {} +} diff --git a/packages/rulesets/src/native/tests/resources/PreviewVersionOverOneYear.json b/packages/rulesets/src/native/tests/resources/PreviewVersionOverOneYear.json index c43851848..3b9f4a73a 100644 --- a/packages/rulesets/src/native/tests/resources/PreviewVersionOverOneYear.json +++ b/packages/rulesets/src/native/tests/resources/PreviewVersionOverOneYear.json @@ -6,16 +6,10 @@ "version": "2014-04-01-preview" }, "host": "management.azure.com", - "schemes": [ - "https" - ], + "schemes": ["https"], "basePath": "/", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], + "produces": ["application/json"], + "consumes": ["application/json"], "paths": { "/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders": { "post": { @@ -45,4 +39,4 @@ "description": "test api version" } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/PrivateLinkAPIsMissing.json b/packages/rulesets/src/native/tests/resources/PrivateLinkAPIsMissing.json index 80be31312..53018a2f1 100644 --- a/packages/rulesets/src/native/tests/resources/PrivateLinkAPIsMissing.json +++ b/packages/rulesets/src/native/tests/resources/PrivateLinkAPIsMissing.json @@ -1,542 +1,504 @@ { - "swagger": "2.0", - "info": { - "title": "Microsoft Azure Redis Cache Management API", - "description": "Some cool documentation.", - "version": "2014-04-01-preview" - }, - "host": "management.azure.com", - "schemes": [ - "https" - ], - "basePath": "/", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], - "paths": { - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections": { - "get": { - "tags": [ - "PrivateEndpointConnections" - ], - "operationId": "PrivateEndpointConnections_List", - "description": "List all the private endpoint connections associated with the storage account.", - "parameters": [ - { - "$ref": "#/parameters/ResourceGroupName" - }, - { - "$ref": "#/parameters/StorageAccountName" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" - } - ], - "responses": { - "200": { - "description": "OK -- Successfully retrieved private endpoint connections.", - "schema": { - "$ref": "#/definitions/PrivateEndpointConnectionListResult" - } - } - }, - "x-ms-pageable": { - "nextLinkName": null + "swagger": "2.0", + "info": { + "title": "Microsoft Azure Redis Cache Management API", + "description": "Some cool documentation.", + "version": "2014-04-01-preview" + }, + "host": "management.azure.com", + "schemes": ["https"], + "basePath": "/", + "produces": ["application/json"], + "consumes": ["application/json"], + "paths": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections": { + "get": { + "tags": ["PrivateEndpointConnections"], + "operationId": "PrivateEndpointConnections_List", + "description": "List all the private endpoint connections associated with the storage account.", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupName" + }, + { + "$ref": "#/parameters/StorageAccountName" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "OK -- Successfully retrieved private endpoint connections.", + "schema": { + "$ref": "#/definitions/PrivateEndpointConnectionListResult" } + } + }, + "x-ms-pageable": { + "nextLinkName": null } + } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}": { - "get": { - "tags": [ - "PrivateEndpointConnections" - ], - "operationId": "PrivateEndpointConnections_Get", - "description": "Gets the specified private endpoint connection associated with the storage account.", - "parameters": [ - { - "$ref": "#/parameters/ResourceGroupName" - }, - { - "$ref": "#/parameters/StorageAccountName" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/PrivateEndpointConnectionName" - } - ], - "responses": { - "200": { - "description": "OK -- Get the private endpoint connection properties successfully.", - "schema": { - "$ref": "#/definitions/PrivateEndpointConnection" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } + "get": { + "tags": ["PrivateEndpointConnections"], + "operationId": "PrivateEndpointConnections_Get", + "description": "Gets the specified private endpoint connection associated with the storage account.", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupName" + }, + { + "$ref": "#/parameters/StorageAccountName" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/PrivateEndpointConnectionName" + } + ], + "responses": { + "200": { + "description": "OK -- Get the private endpoint connection properties successfully.", + "schema": { + "$ref": "#/definitions/PrivateEndpointConnection" } - }, - "put": { - "tags": [ - "PrivateEndpointConnections" - ], - "operationId": "PrivateEndpointConnections_Put", - "description": "Update the state of specified private endpoint connection associated with the storage account.", - "parameters": [ - { - "$ref": "#/parameters/ResourceGroupName" - }, - { - "$ref": "#/parameters/StorageAccountName" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/PrivateEndpointConnectionName" - }, - { - "name": "properties", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PrivateEndpointConnection" - }, - "description": "The private endpoint connection properties." - } - ], - "responses": { - "200": { - "description": "OK -- Update the private endpoint connection properties successfully.", - "schema": { - "$ref": "#/definitions/PrivateEndpointConnection" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - }, - "delete": { - "tags": [ - "PrivateEndpointConnections" - ], - "operationId": "PrivateEndpointConnections_Delete", - "description": "Deletes the specified private endpoint connection associated with the storage account.", - "parameters": [ - { - "$ref": "#/parameters/ResourceGroupName" - }, - { - "$ref": "#/parameters/StorageAccountName" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/PrivateEndpointConnectionName" - } - ], - "responses": { - "200": { - "description": "OK -- Delete the private endpoint connection successfully." - }, - "204": { - "description": "No Content -- The private endpoint connection does not exist." - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" } + } } - } - }, - "definitions": { - "PrivateEndpoint": { - "properties": { - "id": { - "readOnly": true, - "type": "string", - "description": "The ARM identifier for Private Endpoint" - } - }, - "description": "The Private Endpoint resource." - }, - "PrivateEndpointConnection": { - "properties": { - "properties": { - "$ref": "#/definitions/PrivateEndpointConnectionProperties", - "x-ms-client-flatten": true, - "description": "Resource properties." - } - }, - "allOf": [ - { - "$ref": "#/definitions/Resource" - } - ], - "description": "The Private Endpoint Connection resource." - }, - "PrivateEndpointConnectionProperties": { - "properties": { - "privateEndpoint": { - "$ref": "#/definitions/PrivateEndpoint", - "description": "The resource of private end point." - }, - "privateLinkServiceConnectionState": { - "$ref": "#/definitions/PrivateLinkServiceConnectionState", - "description": "A collection of information about the state of the connection between service consumer and provider." - }, - "provisioningState": { - "$ref": "#/definitions/PrivateEndpointConnectionProvisioningState", - "description": "The provisioning state of the private endpoint connection resource." - } - }, - "required": [ - "privateLinkServiceConnectionState" - ], - "description": "Properties of the PrivateEndpointConnectProperties." - }, - "PrivateLinkServiceConnectionState": { - "properties": { - "status": { - "$ref": "#/definitions/PrivateEndpointServiceConnectionStatus", - "description": "Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service." - }, - "description": { - "type": "string", - "description": "The reason for approval/rejection of the connection." - }, - "actionRequired": { - "type": "string", - "description": "A message indicating if changes on the service provider require any updates on the consumer." - } + }, + "put": { + "tags": ["PrivateEndpointConnections"], + "operationId": "PrivateEndpointConnections_Put", + "description": "Update the state of specified private endpoint connection associated with the storage account.", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupName" + }, + { + "$ref": "#/parameters/StorageAccountName" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/PrivateEndpointConnectionName" + }, + { + "name": "properties", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PrivateEndpointConnection" }, - "description": "A collection of information about the state of the connection between service consumer and provider." - }, - "PrivateEndpointServiceConnectionStatus": { - "type": "string", - "description": "The private endpoint connection status.", - "enum": [ - "Pending", - "Approved", - "Rejected" - ], - "x-ms-enum": { - "name": "PrivateEndpointServiceConnectionStatus", - "modelAsString": true + "description": "The private endpoint connection properties." + } + ], + "responses": { + "200": { + "description": "OK -- Update the private endpoint connection properties successfully.", + "schema": { + "$ref": "#/definitions/PrivateEndpointConnection" } - }, - "PrivateEndpointConnectionProvisioningState": { - "type": "string", - "readOnly": true, - "description": "The current provisioning state.", - "enum": [ - "Succeeded", - "Creating", - "Deleting", - "Failed" - ], - "x-ms-enum": { - "name": "PrivateEndpointConnectionProvisioningState", - "modelAsString": true + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" } + } + } + }, + "delete": { + "tags": ["PrivateEndpointConnections"], + "operationId": "PrivateEndpointConnections_Delete", + "description": "Deletes the specified private endpoint connection associated with the storage account.", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupName" + }, + { + "$ref": "#/parameters/StorageAccountName" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/PrivateEndpointConnectionName" + } + ], + "responses": { + "200": { + "description": "OK -- Delete the private endpoint connection successfully." + }, + "204": { + "description": "No Content -- The private endpoint connection does not exist." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + } + }, + "definitions": { + "PrivateEndpoint": { + "properties": { + "id": { + "readOnly": true, + "type": "string", + "description": "The ARM identifier for Private Endpoint" + } + }, + "description": "The Private Endpoint resource." + }, + "PrivateEndpointConnection": { + "properties": { + "properties": { + "$ref": "#/definitions/PrivateEndpointConnectionProperties", + "x-ms-client-flatten": true, + "description": "Resource properties." + } + }, + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "description": "The Private Endpoint Connection resource." + }, + "PrivateEndpointConnectionProperties": { + "properties": { + "privateEndpoint": { + "$ref": "#/definitions/PrivateEndpoint", + "description": "The resource of private end point." }, - "PrivateLinkResource": { - "properties": { - "properties": { - "$ref": "#/definitions/PrivateLinkResourceProperties", - "description": "Resource properties.", - "x-ms-client-flatten": true - } - }, - "allOf": [ - { - "$ref": "#/definitions/Resource" - } - ], - "description": "A private link resource" - }, - "PrivateLinkResourceProperties": { - "properties": { - "groupId": { - "description": "The private link resource group id.", - "type": "string", - "readOnly": true - }, - "requiredMembers": { - "description": "The private link resource required member names.", - "type": "array", - "items": { - "type": "string" - }, - "readOnly": true - }, - "requiredZoneNames": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The private link resource Private link DNS zone name." - } - }, - "description": "Properties of a private link resource." - }, - "PrivateEndpointConnectionListResult": { - "properties": { - "value": { - "type": "array", - "description": "Array of private endpoint connections", - "items": { - "$ref": "#/definitions/PrivateEndpointConnection" - } - } - }, - "description": "List of private endpoint connection associated with the specified storage account" - }, - "PrivateLinkResourceListResult": { - "properties": { - "value": { - "type": "array", - "description": "Array of private link resources", - "items": { - "$ref": "#/definitions/PrivateLinkResource" - } - } - }, - "description": "A list of private link resources" - }, - "ProxyResource": { - "title": "Proxy Resource", - "description": "The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location", - "allOf": [ - { - "$ref": "#/definitions/Resource" - } - ] - }, - "TrackedResource": { - "title": "Tracked Resource", - "description": "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'", - "properties": { - "tags": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-ms-mutability": [ - "read", - "create", - "update" - ], - "description": "Resource tags." - }, - "location": { - "type": "string", - "x-ms-mutability": [ - "read", - "create" - ], - "description": "The geo-location where the resource lives" - } - }, - "required": [ - "location" - ], - "allOf": [ - { - "$ref": "#/definitions/Resource" - } - ] - }, - "AzureEntityResource": { - "x-ms-client-name": "AzureEntityResource", - "title": "Entity Resource", - "description": "The resource model definition for an Azure Resource Manager resource with an etag.", - "properties": { - "etag": { - "type": "string", - "readOnly": true, - "description": "Resource Etag." - } - }, - "allOf": [ - { - "$ref": "#/definitions/Resource" - } - ] + "privateLinkServiceConnectionState": { + "$ref": "#/definitions/PrivateLinkServiceConnectionState", + "description": "A collection of information about the state of the connection between service consumer and provider." }, - "Resource": { - "title": "Resource", - "description": "Common fields that are returned in the response for all Azure Resource Manager resources", - "properties": { - "id": { - "readOnly": true, - "type": "string", - "description": "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - }, - "name": { - "readOnly": true, - "type": "string", - "description": "The name of the resource" - }, - "type": { - "readOnly": true, - "type": "string", - "description": "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\"" - } - }, - "x-ms-azure-resource": true + "provisioningState": { + "$ref": "#/definitions/PrivateEndpointConnectionProvisioningState", + "description": "The provisioning state of the private endpoint connection resource." + } + }, + "required": ["privateLinkServiceConnectionState"], + "description": "Properties of the PrivateEndpointConnectProperties." + }, + "PrivateLinkServiceConnectionState": { + "properties": { + "status": { + "$ref": "#/definitions/PrivateEndpointServiceConnectionStatus", + "description": "Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service." }, - "ErrorResponseBody": { - "properties": { - "code": { - "type": "string", - "description": "An identifier for the error. Codes are invariant and are intended to be consumed programmatically." - }, - "message": { - "type": "string", - "description": "A message describing the error, intended to be suitable for display in a user interface." - } - }, - "description": "Error response body contract." + "description": { + "type": "string", + "description": "The reason for approval/rejection of the connection." }, - "ErrorResponse": { - "properties": { - "error": { - "$ref": "#/definitions/ErrorResponseBody", - "description": "Azure Storage Resource Provider error response body." - } - }, - "description": "An error response from the storage resource provider." + "actionRequired": { + "type": "string", + "description": "A message indicating if changes on the service provider require any updates on the consumer." } + }, + "description": "A collection of information about the state of the connection between service consumer and provider." }, - "parameters": { - "SubscriptionIdParamterer": { - "name": "subscriptionId", - "in": "path", - "description": "Subscription ID.", - "required": true, - "type": "string" + "PrivateEndpointServiceConnectionStatus": { + "type": "string", + "description": "The private endpoint connection status.", + "enum": ["Pending", "Approved", "Rejected"], + "x-ms-enum": { + "name": "PrivateEndpointServiceConnectionStatus", + "modelAsString": true + } + }, + "PrivateEndpointConnectionProvisioningState": { + "type": "string", + "readOnly": true, + "description": "The current provisioning state.", + "enum": ["Succeeded", "Creating", "Deleting", "Failed"], + "x-ms-enum": { + "name": "PrivateEndpointConnectionProvisioningState", + "modelAsString": true + } + }, + "PrivateLinkResource": { + "properties": { + "properties": { + "$ref": "#/definitions/PrivateLinkResourceProperties", + "description": "Resource properties.", + "x-ms-client-flatten": true + } + }, + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "description": "A private link resource" + }, + "PrivateLinkResourceProperties": { + "properties": { + "groupId": { + "description": "The private link resource group id.", + "type": "string", + "readOnly": true }, - "ApiVersionParameter": { - "name": "apiVersion", - "in": "path", - "description": "API ID.", - "required": true, + "requiredMembers": { + "description": "The private link resource required member names.", + "type": "array", + "items": { "type": "string" + }, + "readOnly": true }, - "ResourceGroupName": { - "name": "resourceGroupName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the resource group within the user's subscription. The name is case insensitive.", - "pattern": "^[-\\w\\._\\(\\)]+$", - "minLength": 1, - "maxLength": 90, - "x-ms-parameter-location": "method" - }, - "StorageAccountName": { - "name": "accountName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", - "maxLength": 24, - "minLength": 3, - "x-ms-parameter-location": "method" - }, - "ManagementPolicyName": { - "name": "managementPolicyName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the Storage Account Management Policy. It should always be 'default'", - "enum": [ - "default" - ], - "x-ms-enum": { - "name": "ManagementPolicyName", - "modelAsString": true - }, - "x-ms-parameter-location": "method" - }, - "EncryptionScopeName": { - "name": "encryptionScopeName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.", - "maxLength": 63, - "minLength": 3, - "x-ms-parameter-location": "method" + "requiredZoneNames": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The private link resource Private link DNS zone name." + } + }, + "description": "Properties of a private link resource." + }, + "PrivateEndpointConnectionListResult": { + "properties": { + "value": { + "type": "array", + "description": "Array of private endpoint connections", + "items": { + "$ref": "#/definitions/PrivateEndpointConnection" + } + } + }, + "description": "List of private endpoint connection associated with the specified storage account" + }, + "PrivateLinkResourceListResult": { + "properties": { + "value": { + "type": "array", + "description": "Array of private link resources", + "items": { + "$ref": "#/definitions/PrivateLinkResource" + } + } + }, + "description": "A list of private link resources" + }, + "ProxyResource": { + "title": "Proxy Resource", + "description": "The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ] + }, + "TrackedResource": { + "title": "Tracked Resource", + "description": "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'", + "properties": { + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-ms-mutability": ["read", "create", "update"], + "description": "Resource tags." }, - "ObjectReplicationPolicyId": { - "name": "objectReplicationPolicyId", - "in": "path", - "required": true, - "type": "string", - "description": "The ID of object replication policy or 'default' if the policy ID is unknown.", - "minLength": 1, - "x-ms-parameter-location": "method" + "location": { + "type": "string", + "x-ms-mutability": ["read", "create"], + "description": "The geo-location where the resource lives" + } + }, + "required": ["location"], + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ] + }, + "AzureEntityResource": { + "x-ms-client-name": "AzureEntityResource", + "title": "Entity Resource", + "description": "The resource model definition for an Azure Resource Manager resource with an etag.", + "properties": { + "etag": { + "type": "string", + "readOnly": true, + "description": "Resource Etag." + } + }, + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ] + }, + "Resource": { + "title": "Resource", + "description": "Common fields that are returned in the response for all Azure Resource Manager resources", + "properties": { + "id": { + "readOnly": true, + "type": "string", + "description": "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" }, - "BlobInventoryPolicyName": { - "name": "blobInventoryPolicyName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the storage account blob inventory policy. It should always be 'default'", - "enum": [ - "default" - ], - "x-ms-enum": { - "name": "BlobInventoryPolicyName", - "modelAsString": true - }, - "x-ms-parameter-location": "method" + "name": { + "readOnly": true, + "type": "string", + "description": "The name of the resource" }, - "PrivateEndpointConnectionName": { - "name": "privateEndpointConnectionName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the private endpoint connection associated with the Azure resource", - "x-ms-parameter-location": "method" + "type": { + "readOnly": true, + "type": "string", + "description": "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\"" + } + }, + "x-ms-azure-resource": true + }, + "ErrorResponseBody": { + "properties": { + "code": { + "type": "string", + "description": "An identifier for the error. Codes are invariant and are intended to be consumed programmatically." }, - "SubscriptionIdParameter": { - "name": "subscriptionId", - "in": "path", - "required": true, - "type": "string", - "description": "The ID of the target subscription.", - "minLength": 1 + "message": { + "type": "string", + "description": "A message describing the error, intended to be suitable for display in a user interface." } + }, + "description": "Error response body contract." + }, + "ErrorResponse": { + "properties": { + "error": { + "$ref": "#/definitions/ErrorResponseBody", + "description": "Azure Storage Resource Provider error response body." + } + }, + "description": "An error response from the storage resource provider." + } + }, + "parameters": { + "SubscriptionIdParamterer": { + "name": "subscriptionId", + "in": "path", + "description": "Subscription ID.", + "required": true, + "type": "string" + }, + "ApiVersionParameter": { + "name": "apiVersion", + "in": "path", + "description": "API ID.", + "required": true, + "type": "string" + }, + "ResourceGroupName": { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group within the user's subscription. The name is case insensitive.", + "pattern": "^[-\\w\\._\\(\\)]+$", + "minLength": 1, + "maxLength": 90, + "x-ms-parameter-location": "method" + }, + "StorageAccountName": { + "name": "accountName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + "maxLength": 24, + "minLength": 3, + "x-ms-parameter-location": "method" + }, + "ManagementPolicyName": { + "name": "managementPolicyName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the Storage Account Management Policy. It should always be 'default'", + "enum": ["default"], + "x-ms-enum": { + "name": "ManagementPolicyName", + "modelAsString": true + }, + "x-ms-parameter-location": "method" + }, + "EncryptionScopeName": { + "name": "encryptionScopeName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.", + "maxLength": 63, + "minLength": 3, + "x-ms-parameter-location": "method" + }, + "ObjectReplicationPolicyId": { + "name": "objectReplicationPolicyId", + "in": "path", + "required": true, + "type": "string", + "description": "The ID of object replication policy or 'default' if the policy ID is unknown.", + "minLength": 1, + "x-ms-parameter-location": "method" + }, + "BlobInventoryPolicyName": { + "name": "blobInventoryPolicyName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the storage account blob inventory policy. It should always be 'default'", + "enum": ["default"], + "x-ms-enum": { + "name": "BlobInventoryPolicyName", + "modelAsString": true + }, + "x-ms-parameter-location": "method" + }, + "PrivateEndpointConnectionName": { + "name": "privateEndpointConnectionName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the private endpoint connection associated with the Azure resource", + "x-ms-parameter-location": "method" + }, + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "description": "The ID of the target subscription.", + "minLength": 1 } -} \ No newline at end of file + } +} diff --git a/packages/rulesets/src/native/tests/resources/PrivateLinkResourceUnMatch.json b/packages/rulesets/src/native/tests/resources/PrivateLinkResourceUnMatch.json index 93528aa83..ff92c6b07 100644 --- a/packages/rulesets/src/native/tests/resources/PrivateLinkResourceUnMatch.json +++ b/packages/rulesets/src/native/tests/resources/PrivateLinkResourceUnMatch.json @@ -1,565 +1,525 @@ { - "swagger": "2.0", - "info": { - "title": "Microsoft Azure Redis Cache Management API", - "description": "Some cool documentation.", - "version": "2014-04-01-preview" - }, - "host": "management.azure.com", - "schemes": [ - "https" - ], - "basePath": "/", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], - "paths": { - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections": { - "get": { - "tags": [ - "PrivateEndpointConnections" - ], - "operationId": "PrivateEndpointConnections_List", - "description": "List all the private endpoint connections associated with the storage account.", - "parameters": [ - { - "$ref": "#/parameters/ResourceGroupName" - }, - { - "$ref": "#/parameters/StorageAccountName" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" - } - ], - "responses": { - "200": { - "description": "OK -- Successfully retrieved private endpoint connections.", - "schema": { - "$ref": "#/definitions/PrivateEndpointConnectionListResult" - } - } - }, - "x-ms-pageable": { - "nextLinkName": null + "swagger": "2.0", + "info": { + "title": "Microsoft Azure Redis Cache Management API", + "description": "Some cool documentation.", + "version": "2014-04-01-preview" + }, + "host": "management.azure.com", + "schemes": ["https"], + "basePath": "/", + "produces": ["application/json"], + "consumes": ["application/json"], + "paths": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections": { + "get": { + "tags": ["PrivateEndpointConnections"], + "operationId": "PrivateEndpointConnections_List", + "description": "List all the private endpoint connections associated with the storage account.", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupName" + }, + { + "$ref": "#/parameters/StorageAccountName" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "OK -- Successfully retrieved private endpoint connections.", + "schema": { + "$ref": "#/definitions/PrivateEndpointConnectionListResult" } + } + }, + "x-ms-pageable": { + "nextLinkName": null } + } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}": { - "get": { - "tags": [ - "PrivateEndpointConnections" - ], - "operationId": "PrivateEndpointConnections_Get", - "description": "Gets the specified private endpoint connection associated with the storage account.", - "parameters": [ - { - "$ref": "#/parameters/ResourceGroupName" - }, - { - "$ref": "#/parameters/StorageAccountName" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/PrivateEndpointConnectionName" - } - ], - "responses": { - "200": { - "description": "OK -- Get the private endpoint connection properties successfully.", - "schema": { - "$ref": "#/definitions/PrivateEndpointConnection" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } + "get": { + "tags": ["PrivateEndpointConnections"], + "operationId": "PrivateEndpointConnections_Get", + "description": "Gets the specified private endpoint connection associated with the storage account.", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupName" + }, + { + "$ref": "#/parameters/StorageAccountName" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/PrivateEndpointConnectionName" + } + ], + "responses": { + "200": { + "description": "OK -- Get the private endpoint connection properties successfully.", + "schema": { + "$ref": "#/definitions/PrivateEndpointConnection" } - }, - "put": { - "tags": [ - "PrivateEndpointConnections" - ], - "operationId": "PrivateEndpointConnections_Put", - "description": "Update the state of specified private endpoint connection associated with the storage account.", - "parameters": [ - { - "$ref": "#/parameters/ResourceGroupName" - }, - { - "$ref": "#/parameters/StorageAccountName" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/PrivateEndpointConnectionName" - }, - { - "name": "properties", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PrivateEndpointConnection" - }, - "description": "The private endpoint connection properties." - } - ], - "responses": { - "200": { - "description": "OK -- Update the private endpoint connection properties successfully.", - "schema": { - "$ref": "#/definitions/PrivateEndpointConnection" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" } - }, - "delete": { - "tags": [ - "PrivateEndpointConnections" - ], - "operationId": "PrivateEndpointConnections_Delete", - "description": "Deletes the specified private endpoint connection associated with the storage account.", - "parameters": [ - { - "$ref": "#/parameters/ResourceGroupName" - }, - { - "$ref": "#/parameters/StorageAccountName" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/PrivateEndpointConnectionName" - } - ], - "responses": { - "200": { - "description": "OK -- Delete the private endpoint connection successfully." - }, - "204": { - "description": "No Content -- The private endpoint connection does not exist." - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } + } + } + }, + "put": { + "tags": ["PrivateEndpointConnections"], + "operationId": "PrivateEndpointConnections_Put", + "description": "Update the state of specified private endpoint connection associated with the storage account.", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupName" + }, + { + "$ref": "#/parameters/StorageAccountName" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/PrivateEndpointConnectionName" + }, + { + "name": "properties", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PrivateEndpointConnection" + }, + "description": "The private endpoint connection properties." + } + ], + "responses": { + "200": { + "description": "OK -- Update the private endpoint connection properties successfully.", + "schema": { + "$ref": "#/definitions/PrivateEndpointConnection" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" } + } } + }, + "delete": { + "tags": ["PrivateEndpointConnections"], + "operationId": "PrivateEndpointConnections_Delete", + "description": "Deletes the specified private endpoint connection associated with the storage account.", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupName" + }, + { + "$ref": "#/parameters/StorageAccountName" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/PrivateEndpointConnectionName" + } + ], + "responses": { + "200": { + "description": "OK -- Delete the private endpoint connection successfully." + }, + "204": { + "description": "No Content -- The private endpoint connection does not exist." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateLinkResources": { - "get": { - "tags": [ - "PrivateLinkResources" - ], - "operationId": "PrivateLinkResources_ListByStorageAccount", - "description": "Gets the private link resources that need to be created for a storage account.", - "parameters": [ - { - "$ref": "#/parameters/ResourceGroupName" - }, - { - "$ref": "#/parameters/StorageAccountName" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" - } - ], - "responses": { - "200": { - "description": "Successfully retrieved private link resources.", - "schema": { - "$ref": "#/definitions/PrivateLinkResourceListResult" - } - } + "get": { + "tags": ["PrivateLinkResources"], + "operationId": "PrivateLinkResources_ListByStorageAccount", + "description": "Gets the private link resources that need to be created for a storage account.", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupName" + }, + { + "$ref": "#/parameters/StorageAccountName" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "Successfully retrieved private link resources.", + "schema": { + "$ref": "#/definitions/PrivateLinkResourceListResult" } + } } + } } + }, + "definitions": { + "PrivateEndpoint": { + "properties": { + "id": { + "readOnly": true, + "type": "string", + "description": "The ARM identifier for Private Endpoint" + } + }, + "description": "The Private Endpoint resource." }, - "definitions": { - "PrivateEndpoint": { - "properties": { - "id": { - "readOnly": true, - "type": "string", - "description": "The ARM identifier for Private Endpoint" - } - }, - "description": "The Private Endpoint resource." - }, - "PrivateEndpointConnection": { - "properties": { - "properties": { - "$ref": "#/definitions/PrivateEndpointConnectionProperties", - "x-ms-client-flatten": true, - "description": "Resource properties." - } - }, - "allOf": [ - { - "$ref": "#/definitions/Resource" - } - ], - "description": "The Private Endpoint Connection resource." - }, - "PrivateEndpointConnectionProperties": { - "properties": { - "privateLinkServiceConnectionState": { - "$ref": "#/definitions/PrivateLinkServiceConnectionState", - "description": "A collection of information about the state of the connection between service consumer and provider." - } - }, - "required": [ - "privateLinkServiceConnectionState" - ], - "description": "Properties of the PrivateEndpointConnectProperties." - }, - "PrivateLinkServiceConnectionState": { - "properties": { - "status": { - "$ref": "#/definitions/PrivateEndpointServiceConnectionStatus", - "description": "Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service." - }, - "description": { - "type": "string", - "description": "The reason for approval/rejection of the connection." - }, - "actionRequired": { - "type": "string", - "description": "A message indicating if changes on the service provider require any updates on the consumer." - } - }, - "description": "A collection of information about the state of the connection between service consumer and provider." - }, - "PrivateEndpointServiceConnectionStatus": { - "type": "string", - "description": "The private endpoint connection status.", - "enum": [ - "Pending", - "Approved", - "Rejected" - ], - "x-ms-enum": { - "name": "PrivateEndpointServiceConnectionStatus", - "modelAsString": true - } - }, - "PrivateEndpointConnectionProvisioningState": { - "type": "string", - "readOnly": true, - "description": "The current provisioning state.", - "enum": [ - "Succeeded", - "Creating", - "Deleting", - "Failed" - ], - "x-ms-enum": { - "name": "PrivateEndpointConnectionProvisioningState", - "modelAsString": true - } - }, - "PrivateLinkResource": { - "properties": { - "properties": { - "$ref": "#/definitions/PrivateLinkResourceProperties", - "description": "Resource properties.", - "x-ms-client-flatten": true - } - }, - "allOf": [ - { - "$ref": "#/definitions/Resource" - } - ], - "description": "A private link resource" - }, - "PrivateLinkResourceProperties": { - "properties": { - "groupId": { - "description": "The private link resource group id.", - "type": "string", - "readOnly": true - }, - "requiredMembers": { - "description": "The private link resource required member names.", - "type": "array", - "items": { - "type": "string" - }, - "readOnly": true - }, - "requiredZoneNames": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The private link resource Private link DNS zone name." - } - }, - "description": "Properties of a private link resource." - }, - "PrivateEndpointConnectionListResult": { - "properties": { - "value": { - "type": "array", - "description": "Array of private endpoint connections", - "items": { - "$ref": "#/definitions/PrivateEndpointConnection" - } - } - }, - "description": "List of private endpoint connection associated with the specified storage account" - }, - "PrivateLinkResourceListResult": { - "properties": { - "value": { - "type": "array", - "description": "Array of private link resources", - "items": { - "$ref": "#/definitions/PrivateLinkResource" - } - } - }, - "description": "A list of private link resources" - }, - "ProxyResource": { - "title": "Proxy Resource", - "description": "The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location", - "allOf": [ - { - "$ref": "#/definitions/Resource" - } - ] - }, - "TrackedResource": { - "title": "Tracked Resource", - "description": "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'", - "properties": { - "tags": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-ms-mutability": [ - "read", - "create", - "update" - ], - "description": "Resource tags." - }, - "location": { - "type": "string", - "x-ms-mutability": [ - "read", - "create" - ], - "description": "The geo-location where the resource lives" - } - }, - "required": [ - "location" - ], - "allOf": [ - { - "$ref": "#/definitions/Resource" - } - ] - }, - "AzureEntityResource": { - "x-ms-client-name": "AzureEntityResource", - "title": "Entity Resource", - "description": "The resource model definition for an Azure Resource Manager resource with an etag.", - "properties": { - "etag": { - "type": "string", - "readOnly": true, - "description": "Resource Etag." - } - }, - "allOf": [ - { - "$ref": "#/definitions/Resource" - } - ] - }, - "Resource": { - "title": "Resource", - "description": "Common fields that are returned in the response for all Azure Resource Manager resources", - "properties": { - "id": { - "readOnly": true, - "type": "string", - "description": "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - }, - "name": { - "readOnly": true, - "type": "string", - "description": "The name of the resource" - }, - "type": { - "readOnly": true, - "type": "string", - "description": "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\"" - } - }, - "x-ms-azure-resource": true + "PrivateEndpointConnection": { + "properties": { + "properties": { + "$ref": "#/definitions/PrivateEndpointConnectionProperties", + "x-ms-client-flatten": true, + "description": "Resource properties." + } + }, + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "description": "The Private Endpoint Connection resource." + }, + "PrivateEndpointConnectionProperties": { + "properties": { + "privateLinkServiceConnectionState": { + "$ref": "#/definitions/PrivateLinkServiceConnectionState", + "description": "A collection of information about the state of the connection between service consumer and provider." + } + }, + "required": ["privateLinkServiceConnectionState"], + "description": "Properties of the PrivateEndpointConnectProperties." + }, + "PrivateLinkServiceConnectionState": { + "properties": { + "status": { + "$ref": "#/definitions/PrivateEndpointServiceConnectionStatus", + "description": "Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service." }, - "ErrorResponseBody": { - "properties": { - "code": { - "type": "string", - "description": "An identifier for the error. Codes are invariant and are intended to be consumed programmatically." - }, - "message": { - "type": "string", - "description": "A message describing the error, intended to be suitable for display in a user interface." - } - }, - "description": "Error response body contract." + "description": { + "type": "string", + "description": "The reason for approval/rejection of the connection." }, - "ErrorResponse": { - "properties": { - "error": { - "$ref": "#/definitions/ErrorResponseBody", - "description": "Azure Storage Resource Provider error response body." - } - }, - "description": "An error response from the storage resource provider." + "actionRequired": { + "type": "string", + "description": "A message indicating if changes on the service provider require any updates on the consumer." } + }, + "description": "A collection of information about the state of the connection between service consumer and provider." }, - "parameters": { - "SubscriptionIdParamterer": { - "name": "subscriptionId", - "in": "path", - "description": "Subscription ID.", - "required": true, - "type": "string" + "PrivateEndpointServiceConnectionStatus": { + "type": "string", + "description": "The private endpoint connection status.", + "enum": ["Pending", "Approved", "Rejected"], + "x-ms-enum": { + "name": "PrivateEndpointServiceConnectionStatus", + "modelAsString": true + } + }, + "PrivateEndpointConnectionProvisioningState": { + "type": "string", + "readOnly": true, + "description": "The current provisioning state.", + "enum": ["Succeeded", "Creating", "Deleting", "Failed"], + "x-ms-enum": { + "name": "PrivateEndpointConnectionProvisioningState", + "modelAsString": true + } + }, + "PrivateLinkResource": { + "properties": { + "properties": { + "$ref": "#/definitions/PrivateLinkResourceProperties", + "description": "Resource properties.", + "x-ms-client-flatten": true + } + }, + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "description": "A private link resource" + }, + "PrivateLinkResourceProperties": { + "properties": { + "groupId": { + "description": "The private link resource group id.", + "type": "string", + "readOnly": true }, - "ApiVersionParameter": { - "name": "apiVersion", - "in": "path", - "description": "API ID.", - "required": true, + "requiredMembers": { + "description": "The private link resource required member names.", + "type": "array", + "items": { "type": "string" + }, + "readOnly": true }, - "ResourceGroupName": { - "name": "resourceGroupName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the resource group within the user's subscription. The name is case insensitive.", - "pattern": "^[-\\w\\._\\(\\)]+$", - "minLength": 1, - "maxLength": 90, - "x-ms-parameter-location": "method" - }, - "StorageAccountName": { - "name": "accountName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", - "maxLength": 24, - "minLength": 3, - "x-ms-parameter-location": "method" - }, - "ManagementPolicyName": { - "name": "managementPolicyName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the Storage Account Management Policy. It should always be 'default'", - "enum": [ - "default" - ], - "x-ms-enum": { - "name": "ManagementPolicyName", - "modelAsString": true - }, - "x-ms-parameter-location": "method" - }, - "EncryptionScopeName": { - "name": "encryptionScopeName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.", - "maxLength": 63, - "minLength": 3, - "x-ms-parameter-location": "method" + "requiredZoneNames": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The private link resource Private link DNS zone name." + } + }, + "description": "Properties of a private link resource." + }, + "PrivateEndpointConnectionListResult": { + "properties": { + "value": { + "type": "array", + "description": "Array of private endpoint connections", + "items": { + "$ref": "#/definitions/PrivateEndpointConnection" + } + } + }, + "description": "List of private endpoint connection associated with the specified storage account" + }, + "PrivateLinkResourceListResult": { + "properties": { + "value": { + "type": "array", + "description": "Array of private link resources", + "items": { + "$ref": "#/definitions/PrivateLinkResource" + } + } + }, + "description": "A list of private link resources" + }, + "ProxyResource": { + "title": "Proxy Resource", + "description": "The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ] + }, + "TrackedResource": { + "title": "Tracked Resource", + "description": "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'", + "properties": { + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-ms-mutability": ["read", "create", "update"], + "description": "Resource tags." }, - "ObjectReplicationPolicyId": { - "name": "objectReplicationPolicyId", - "in": "path", - "required": true, - "type": "string", - "description": "The ID of object replication policy or 'default' if the policy ID is unknown.", - "minLength": 1, - "x-ms-parameter-location": "method" + "location": { + "type": "string", + "x-ms-mutability": ["read", "create"], + "description": "The geo-location where the resource lives" + } + }, + "required": ["location"], + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ] + }, + "AzureEntityResource": { + "x-ms-client-name": "AzureEntityResource", + "title": "Entity Resource", + "description": "The resource model definition for an Azure Resource Manager resource with an etag.", + "properties": { + "etag": { + "type": "string", + "readOnly": true, + "description": "Resource Etag." + } + }, + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ] + }, + "Resource": { + "title": "Resource", + "description": "Common fields that are returned in the response for all Azure Resource Manager resources", + "properties": { + "id": { + "readOnly": true, + "type": "string", + "description": "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" }, - "BlobInventoryPolicyName": { - "name": "blobInventoryPolicyName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the storage account blob inventory policy. It should always be 'default'", - "enum": [ - "default" - ], - "x-ms-enum": { - "name": "BlobInventoryPolicyName", - "modelAsString": true - }, - "x-ms-parameter-location": "method" + "name": { + "readOnly": true, + "type": "string", + "description": "The name of the resource" }, - "PrivateEndpointConnectionName": { - "name": "privateEndpointConnectionName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the private endpoint connection associated with the Azure resource", - "x-ms-parameter-location": "method" + "type": { + "readOnly": true, + "type": "string", + "description": "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\"" + } + }, + "x-ms-azure-resource": true + }, + "ErrorResponseBody": { + "properties": { + "code": { + "type": "string", + "description": "An identifier for the error. Codes are invariant and are intended to be consumed programmatically." }, - "SubscriptionIdParameter": { - "name": "subscriptionId", - "in": "path", - "required": true, - "type": "string", - "description": "The ID of the target subscription.", - "minLength": 1 + "message": { + "type": "string", + "description": "A message describing the error, intended to be suitable for display in a user interface." } + }, + "description": "Error response body contract." + }, + "ErrorResponse": { + "properties": { + "error": { + "$ref": "#/definitions/ErrorResponseBody", + "description": "Azure Storage Resource Provider error response body." + } + }, + "description": "An error response from the storage resource provider." + } + }, + "parameters": { + "SubscriptionIdParamterer": { + "name": "subscriptionId", + "in": "path", + "description": "Subscription ID.", + "required": true, + "type": "string" + }, + "ApiVersionParameter": { + "name": "apiVersion", + "in": "path", + "description": "API ID.", + "required": true, + "type": "string" + }, + "ResourceGroupName": { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group within the user's subscription. The name is case insensitive.", + "pattern": "^[-\\w\\._\\(\\)]+$", + "minLength": 1, + "maxLength": 90, + "x-ms-parameter-location": "method" + }, + "StorageAccountName": { + "name": "accountName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + "maxLength": 24, + "minLength": 3, + "x-ms-parameter-location": "method" + }, + "ManagementPolicyName": { + "name": "managementPolicyName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the Storage Account Management Policy. It should always be 'default'", + "enum": ["default"], + "x-ms-enum": { + "name": "ManagementPolicyName", + "modelAsString": true + }, + "x-ms-parameter-location": "method" + }, + "EncryptionScopeName": { + "name": "encryptionScopeName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.", + "maxLength": 63, + "minLength": 3, + "x-ms-parameter-location": "method" + }, + "ObjectReplicationPolicyId": { + "name": "objectReplicationPolicyId", + "in": "path", + "required": true, + "type": "string", + "description": "The ID of object replication policy or 'default' if the policy ID is unknown.", + "minLength": 1, + "x-ms-parameter-location": "method" + }, + "BlobInventoryPolicyName": { + "name": "blobInventoryPolicyName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the storage account blob inventory policy. It should always be 'default'", + "enum": ["default"], + "x-ms-enum": { + "name": "BlobInventoryPolicyName", + "modelAsString": true + }, + "x-ms-parameter-location": "method" + }, + "PrivateEndpointConnectionName": { + "name": "privateEndpointConnectionName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the private endpoint connection associated with the Azure resource", + "x-ms-parameter-location": "method" + }, + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "description": "The ID of the target subscription.", + "minLength": 1 } -} \ No newline at end of file + } +} diff --git a/packages/rulesets/src/native/tests/resources/ResourceWithTag.json b/packages/rulesets/src/native/tests/resources/ResourceWithTag.json index fa9d6314e..c3d7458c5 100644 --- a/packages/rulesets/src/native/tests/resources/ResourceWithTag.json +++ b/packages/rulesets/src/native/tests/resources/ResourceWithTag.json @@ -6,16 +6,10 @@ "version": "2014-04-01-preview" }, "host": "management.azure.com", - "schemes": [ - "https" - ], + "schemes": ["https"], "basePath": "/", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], + "produces": ["application/json"], + "consumes": ["application/json"], "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}": { "get": { @@ -34,14 +28,14 @@ "responses": { "200": { "description": "Created", - "schema":{ + "schema": { "$ref": "#/definitions/TestResource" } }, "default": { "description": "Unexpected error" } - } + } } } }, @@ -62,46 +56,44 @@ } }, "definitions": { - "Resource": { - "properties": { - "id": { - "type": "string", - "description": "Resource ID." - }, - "name": { - "readOnly": true, - "type": "string", - "description": "Resource name." - }, - "type": { - "readOnly": true, - "type": "string", - "description": "Resource type." - }, - "tags": { - "type":"object", - "description": "Resource tag." - } + "Resource": { + "properties": { + "id": { + "type": "string", + "description": "Resource ID." }, - "description": "Common resource representation.", - "x-ms-azure-resource": true + "name": { + "readOnly": true, + "type": "string", + "description": "Resource name." + }, + "type": { + "readOnly": true, + "type": "string", + "description": "Resource type." + }, + "tags": { + "type": "object", + "description": "Resource tag." + } }, - "TestResource": { - "description": "test", - "allOf": [ - {"$ref": "#/definitions/Resource"} - ], + "description": "Common resource representation.", + "x-ms-azure-resource": true + }, + "TestResource": { + "description": "test", + "allOf": [{ "$ref": "#/definitions/Resource" }], + "properties": { "properties": { - "properties":{ - "type":"object", - "description": "properties", - "properties": { - "provisioningState":{ - "type":"string" - } + "type": "object", + "description": "properties", + "properties": { + "provisioningState": { + "type": "string" } } } } + } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/RpaasDeleteAsyncOperationResponseCodeValidation.json b/packages/rulesets/src/native/tests/resources/RpaasDeleteAsyncOperationResponseCodeValidation.json index 0faa50f93..75acdd40f 100644 --- a/packages/rulesets/src/native/tests/resources/RpaasDeleteAsyncOperationResponseCodeValidation.json +++ b/packages/rulesets/src/native/tests/resources/RpaasDeleteAsyncOperationResponseCodeValidation.json @@ -6,16 +6,10 @@ "version": "2014-04-01-preview" }, "host": "management.azure.com", - "schemes": [ - "https" - ], + "schemes": ["https"], "basePath": "/", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], + "produces": ["application/json"], + "consumes": ["application/json"], "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}": { "delete": { @@ -56,4 +50,4 @@ "description": "test api version" } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/RpaasDeleteAsyncOperationResponseFinalStateViaLocation.json b/packages/rulesets/src/native/tests/resources/RpaasDeleteAsyncOperationResponseFinalStateViaLocation.json index 75b9a6e7b..12f56dbea 100644 --- a/packages/rulesets/src/native/tests/resources/RpaasDeleteAsyncOperationResponseFinalStateViaLocation.json +++ b/packages/rulesets/src/native/tests/resources/RpaasDeleteAsyncOperationResponseFinalStateViaLocation.json @@ -6,16 +6,10 @@ "version": "2014-04-01-preview" }, "host": "management.azure.com", - "schemes": [ - "https" - ], + "schemes": ["https"], "basePath": "/", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], + "produces": ["application/json"], + "consumes": ["application/json"], "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}": { "delete": { @@ -39,7 +33,7 @@ "default": { "description": "Unexpected error" } - } + } } } }, @@ -59,4 +53,4 @@ "description": "test api version" } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/RpaasDeleteAsyncOperationResponseMsCustomExtensionsMissing.json b/packages/rulesets/src/native/tests/resources/RpaasDeleteAsyncOperationResponseMsCustomExtensionsMissing.json index d73c986da..f1439f1aa 100644 --- a/packages/rulesets/src/native/tests/resources/RpaasDeleteAsyncOperationResponseMsCustomExtensionsMissing.json +++ b/packages/rulesets/src/native/tests/resources/RpaasDeleteAsyncOperationResponseMsCustomExtensionsMissing.json @@ -6,16 +6,10 @@ "version": "2014-04-01-preview" }, "host": "management.azure.com", - "schemes": [ - "https" - ], + "schemes": ["https"], "basePath": "/", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], + "produces": ["application/json"], + "consumes": ["application/json"], "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}": { "delete": { @@ -35,7 +29,7 @@ "default": { "description": "Unexpected error" } - } + } } } }, @@ -55,4 +49,4 @@ "description": "test api version" } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/RpaasPostAsyncOperationResponseCodeValidation.json b/packages/rulesets/src/native/tests/resources/RpaasPostAsyncOperationResponseCodeValidation.json index 5b9d87fc3..f0ff8abb4 100644 --- a/packages/rulesets/src/native/tests/resources/RpaasPostAsyncOperationResponseCodeValidation.json +++ b/packages/rulesets/src/native/tests/resources/RpaasPostAsyncOperationResponseCodeValidation.json @@ -6,16 +6,10 @@ "version": "2014-04-01-preview" }, "host": "management.azure.com", - "schemes": [ - "https" - ], + "schemes": ["https"], "basePath": "/", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], + "produces": ["application/json"], + "consumes": ["application/json"], "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/listKeys": { "post": { @@ -50,4 +44,4 @@ "description": "test api version" } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/RpaasPostAsyncOperationResponseFinalStateViaLocation.json b/packages/rulesets/src/native/tests/resources/RpaasPostAsyncOperationResponseFinalStateViaLocation.json index fc0f34ebe..94610e8dc 100644 --- a/packages/rulesets/src/native/tests/resources/RpaasPostAsyncOperationResponseFinalStateViaLocation.json +++ b/packages/rulesets/src/native/tests/resources/RpaasPostAsyncOperationResponseFinalStateViaLocation.json @@ -6,16 +6,10 @@ "version": "2014-04-01-preview" }, "host": "management.azure.com", - "schemes": [ - "https" - ], + "schemes": ["https"], "basePath": "/", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], + "produces": ["application/json"], + "consumes": ["application/json"], "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/listKeys": { "post": { @@ -33,7 +27,7 @@ "default": { "description": "Unexpected error" } - } + } } } }, @@ -53,4 +47,4 @@ "description": "test api version" } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/RpaasPostAsyncOperationResponseMsCustomExtensionsMissing.json b/packages/rulesets/src/native/tests/resources/RpaasPostAsyncOperationResponseMsCustomExtensionsMissing.json index 0ba186993..1df096715 100644 --- a/packages/rulesets/src/native/tests/resources/RpaasPostAsyncOperationResponseMsCustomExtensionsMissing.json +++ b/packages/rulesets/src/native/tests/resources/RpaasPostAsyncOperationResponseMsCustomExtensionsMissing.json @@ -6,16 +6,10 @@ "version": "2014-04-01-preview" }, "host": "management.azure.com", - "schemes": [ - "https" - ], + "schemes": ["https"], "basePath": "/", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], + "produces": ["application/json"], + "consumes": ["application/json"], "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/listKeys": { "post": { @@ -29,7 +23,7 @@ "default": { "description": "Unexpected error" } - } + } } } }, @@ -49,4 +43,4 @@ "description": "test api version" } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/RpaasPutAsyncOperationResponseCodeValidation.json b/packages/rulesets/src/native/tests/resources/RpaasPutAsyncOperationResponseCodeValidation.json index d2268bad9..a373bbe26 100644 --- a/packages/rulesets/src/native/tests/resources/RpaasPutAsyncOperationResponseCodeValidation.json +++ b/packages/rulesets/src/native/tests/resources/RpaasPutAsyncOperationResponseCodeValidation.json @@ -6,16 +6,10 @@ "version": "2014-04-01-preview" }, "host": "management.azure.com", - "schemes": [ - "https" - ], + "schemes": ["https"], "basePath": "/", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], + "produces": ["application/json"], + "consumes": ["application/json"], "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}": { "put": { @@ -50,4 +44,4 @@ "description": "test api version" } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/RpaasPutAsyncOperationResponseFinalStateViaAzureAsync.json b/packages/rulesets/src/native/tests/resources/RpaasPutAsyncOperationResponseFinalStateViaAzureAsync.json index 0206de6dc..05773f375 100644 --- a/packages/rulesets/src/native/tests/resources/RpaasPutAsyncOperationResponseFinalStateViaAzureAsync.json +++ b/packages/rulesets/src/native/tests/resources/RpaasPutAsyncOperationResponseFinalStateViaAzureAsync.json @@ -6,16 +6,10 @@ "version": "2014-04-01-preview" }, "host": "management.azure.com", - "schemes": [ - "https" - ], + "schemes": ["https"], "basePath": "/", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], + "produces": ["application/json"], + "consumes": ["application/json"], "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}": { "put": { @@ -33,7 +27,7 @@ "default": { "description": "Unexpected error" } - } + } } } }, @@ -53,4 +47,4 @@ "description": "test api version" } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/RpaasPutAsyncOperationResponseMsCustomExtensionsMissing.json b/packages/rulesets/src/native/tests/resources/RpaasPutAsyncOperationResponseMsCustomExtensionsMissing.json index 7947b8353..2c6350ff6 100644 --- a/packages/rulesets/src/native/tests/resources/RpaasPutAsyncOperationResponseMsCustomExtensionsMissing.json +++ b/packages/rulesets/src/native/tests/resources/RpaasPutAsyncOperationResponseMsCustomExtensionsMissing.json @@ -6,16 +6,10 @@ "version": "2014-04-01-preview" }, "host": "management.azure.com", - "schemes": [ - "https" - ], + "schemes": ["https"], "basePath": "/", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], + "produces": ["application/json"], + "consumes": ["application/json"], "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}": { "put": { @@ -29,7 +23,7 @@ "default": { "description": "Unexpected error" } - } + } } } }, @@ -49,4 +43,4 @@ "description": "test api version" } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/RpaasResourceWithEmptyPropertiesBag.json b/packages/rulesets/src/native/tests/resources/RpaasResourceWithEmptyPropertiesBag.json index d1143f44b..363f4a648 100644 --- a/packages/rulesets/src/native/tests/resources/RpaasResourceWithEmptyPropertiesBag.json +++ b/packages/rulesets/src/native/tests/resources/RpaasResourceWithEmptyPropertiesBag.json @@ -6,16 +6,10 @@ "version": "2014-04-01-preview" }, "host": "management.azure.com", - "schemes": [ - "https" - ], + "schemes": ["https"], "basePath": "/", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], + "produces": ["application/json"], + "consumes": ["application/json"], "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}": { "get": { @@ -33,14 +27,14 @@ "responses": { "200": { "description": "Created", - "schema":{ + "schema": { "$ref": "#/definitions/TestResource" } }, "default": { "description": "Unexpected error" } - } + } } } }, @@ -61,37 +55,35 @@ } }, "definitions": { - "Resource": { - "properties": { - "id": { - "type": "string", - "description": "Resource ID." - }, - "name": { - "readOnly": true, - "type": "string", - "description": "Resource name." - }, - "type": { - "readOnly": true, - "type": "string", - "description": "Resource type." - } + "Resource": { + "properties": { + "id": { + "type": "string", + "description": "Resource ID." + }, + "name": { + "readOnly": true, + "type": "string", + "description": "Resource name." }, - "description": "Common resource representation.", - "x-ms-azure-resource": true + "type": { + "readOnly": true, + "type": "string", + "description": "Resource type." + } }, - "TestResource": { - "description": "test", - "allOf": [ - {"$ref": "#/definitions/Resource"} - ], + "description": "Common resource representation.", + "x-ms-azure-resource": true + }, + "TestResource": { + "description": "test", + "allOf": [{ "$ref": "#/definitions/Resource" }], + "properties": { "properties": { - "properties":{ - "type":"object", - "description": "properties" - } + "type": "object", + "description": "properties" } } + } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/RpaasResourceWithProvisioningState.json b/packages/rulesets/src/native/tests/resources/RpaasResourceWithProvisioningState.json index 17959afb5..6e2762e02 100644 --- a/packages/rulesets/src/native/tests/resources/RpaasResourceWithProvisioningState.json +++ b/packages/rulesets/src/native/tests/resources/RpaasResourceWithProvisioningState.json @@ -6,16 +6,10 @@ "version": "2014-04-01-preview" }, "host": "management.azure.com", - "schemes": [ - "https" - ], + "schemes": ["https"], "basePath": "/", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], + "produces": ["application/json"], + "consumes": ["application/json"], "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}": { "get": { @@ -33,14 +27,14 @@ "responses": { "200": { "description": "Created", - "schema":{ + "schema": { "$ref": "#/definitions/TestResource" } }, "default": { "description": "Unexpected error" } - } + } } } }, @@ -61,42 +55,40 @@ } }, "definitions": { - "Resource": { - "properties": { - "id": { - "type": "string", - "description": "Resource ID." - }, - "name": { - "readOnly": true, - "type": "string", - "description": "Resource name." - }, - "type": { - "readOnly": true, - "type": "string", - "description": "Resource type." - } + "Resource": { + "properties": { + "id": { + "type": "string", + "description": "Resource ID." }, - "description": "Common resource representation.", - "x-ms-azure-resource": true + "name": { + "readOnly": true, + "type": "string", + "description": "Resource name." + }, + "type": { + "readOnly": true, + "type": "string", + "description": "Resource type." + } }, - "TestResource": { - "description": "test", - "allOf": [ - {"$ref": "#/definitions/Resource"} - ], + "description": "Common resource representation.", + "x-ms-azure-resource": true + }, + "TestResource": { + "description": "test", + "allOf": [{ "$ref": "#/definitions/Resource" }], + "properties": { "properties": { - "properties":{ - "type":"object", - "description": "properties", - "properties": { - "provisioningState":{ - "type":"string" - } + "type": "object", + "description": "properties", + "properties": { + "provisioningState": { + "type": "string" } } } } + } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/RpaasValidDeleteAsyncOperationResponse.json b/packages/rulesets/src/native/tests/resources/RpaasValidDeleteAsyncOperationResponse.json index 40a6977af..f71656914 100644 --- a/packages/rulesets/src/native/tests/resources/RpaasValidDeleteAsyncOperationResponse.json +++ b/packages/rulesets/src/native/tests/resources/RpaasValidDeleteAsyncOperationResponse.json @@ -6,16 +6,10 @@ "version": "2014-04-01-preview" }, "host": "management.azure.com", - "schemes": [ - "https" - ], + "schemes": ["https"], "basePath": "/", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], + "produces": ["application/json"], + "consumes": ["application/json"], "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}": { "delete": { @@ -39,7 +33,7 @@ "default": { "description": "Unexpected error" } - } + } } } }, @@ -59,4 +53,4 @@ "description": "test api version" } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/RpaasValidPostAsyncOperationResponse.json b/packages/rulesets/src/native/tests/resources/RpaasValidPostAsyncOperationResponse.json index 3a088f9b4..a5e53a159 100644 --- a/packages/rulesets/src/native/tests/resources/RpaasValidPostAsyncOperationResponse.json +++ b/packages/rulesets/src/native/tests/resources/RpaasValidPostAsyncOperationResponse.json @@ -6,16 +6,10 @@ "version": "2014-04-01-preview" }, "host": "management.azure.com", - "schemes": [ - "https" - ], + "schemes": ["https"], "basePath": "/", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], + "produces": ["application/json"], + "consumes": ["application/json"], "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/listKeys": { "post": { @@ -36,7 +30,7 @@ "default": { "description": "Unexpected error" } - } + } } } }, @@ -56,4 +50,4 @@ "description": "test api version" } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/RpaasValidPutAsyncOperationResponse.json b/packages/rulesets/src/native/tests/resources/RpaasValidPutAsyncOperationResponse.json index ae95fb849..777c3934b 100644 --- a/packages/rulesets/src/native/tests/resources/RpaasValidPutAsyncOperationResponse.json +++ b/packages/rulesets/src/native/tests/resources/RpaasValidPutAsyncOperationResponse.json @@ -6,16 +6,10 @@ "version": "2014-04-01-preview" }, "host": "management.azure.com", - "schemes": [ - "https" - ], + "schemes": ["https"], "basePath": "/", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], + "produces": ["application/json"], + "consumes": ["application/json"], "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}": { "put": { @@ -33,7 +27,7 @@ "default": { "description": "Unexpected error" } - } + } } } }, @@ -53,4 +47,4 @@ "description": "test api version" } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/UniqueClientParameters.json b/packages/rulesets/src/native/tests/resources/UniqueClientParameters.json index bd3602ea9..5ef9b5678 100644 --- a/packages/rulesets/src/native/tests/resources/UniqueClientParameters.json +++ b/packages/rulesets/src/native/tests/resources/UniqueClientParameters.json @@ -20,18 +20,12 @@ } ] }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], + "consumes": ["application/json"], + "produces": ["application/json"], "paths": { "/securitydomain/download": { "post": { - "tags": [ - "HSMSecurityDomain" - ], + "tags": ["HSMSecurityDomain"], "operationId": "HSMSecurityDomain_Download", "description": "Retrieves Security domain from HSM enclave", "parameters": [ @@ -57,8 +51,7 @@ }, "default": { "description": "Key Vault error response describing why the operation failed.", - "schema": { - } + "schema": {} } }, "x-ms-examples": { @@ -70,9 +63,7 @@ }, "/securitydomain/transferkey": { "get": { - "tags": [ - "HSMSecurityDomain" - ], + "tags": ["HSMSecurityDomain"], "parameters": [ { "$ref": "#/parameters/ApiVersionParameter" @@ -95,8 +86,7 @@ }, "default": { "description": "Key Vault error response describing why the operation failed.", - "schema": { - } + "schema": {} } }, "x-ms-examples": { @@ -108,9 +98,7 @@ }, "/securitydomain/upload": { "post": { - "tags": [ - "HSMSecurityDomain" - ], + "tags": ["HSMSecurityDomain"], "operationId": "HSMSecurityDomain_Upload", "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { @@ -125,7 +113,8 @@ "required": true, "schema": { "$ref": "#/definitions/SecurityDomainObject" - }} + } + } ], "responses": { "202": { @@ -146,21 +135,17 @@ }, "default": { "description": "Key Vault error response describing why the operation failed.", - "schema": { - } + "schema": {} } }, "x-ms-examples": { - "Example2": { - } + "Example2": {} } } }, "/securitydomain/upload/pending": { "get": { - "tags": [ - "HSMSecurityDomain" - ], + "tags": ["HSMSecurityDomain"], "operationId": "HSMSecurityDomain_UploadPending", "description": "Get Security domain upload operation status", "responses": { @@ -172,13 +157,11 @@ }, "default": { "description": "Key Vault error response describing why the operation failed.", - "schema": { - } + "schema": {} } }, "x-ms-examples": { - "Find security domain upload operation status": { - } + "Find security domain upload operation status": {} } } } @@ -197,9 +180,7 @@ "description": "Three certificates needed from customer" } }, - "required": [ - "certificates" - ] + "required": ["certificates"] }, "SecurityDomainCertificateItem": { "properties": { @@ -208,9 +189,7 @@ "description": "Customer generated certificate containing public key in JWK format" } }, - "required": [ - "value" - ] + "required": ["value"] }, "TransferKey": { "properties": { @@ -218,9 +197,7 @@ "$ref": "#/definitions/SecurityDomainJsonWebKey" } }, - "required": [ - "transfer_key" - ] + "required": ["transfer_key"] }, "SecurityDomainObject": { "properties": { @@ -233,11 +210,7 @@ "properties": { "status": { "description": "operation status", - "enum": [ - "Success", - "InProgress", - "Failed" - ], + "enum": ["Success", "InProgress", "Failed"], "x-ms-enum": { "modelAsString": false, "name": "OperationStatus" @@ -258,10 +231,7 @@ "kty": { "type": "string", "description": "JsonWebKey Key Type (kty), as defined in https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. For security domain this value must be RSA", - "enum": [ - "RSA", - "RSA-HSM" - ], + "enum": ["RSA", "RSA-HSM"], "x-ms-enum": { "name": "JsonWebKeyType", "modelAsString": true @@ -306,15 +276,7 @@ "type": "string" } }, - "required": [ - "kty", - "key_ops", - "kid", - "x5c", - "x5t#S256", - "n", - "e" - ] + "required": ["kty", "key_ops", "kid", "x5c", "x5t#S256", "n", "e"] } }, "parameters": { @@ -325,12 +287,12 @@ "type": "string", "description": "Client API version." }, - "subscriptionIdParameter":{ + "subscriptionIdParameter": { "name": "subscriptionId", "in": "path", "required": true }, - "subscriptionIdParameter1":{ + "subscriptionIdParameter1": { "name": "subscriptionId", "in": "path", "required": true diff --git a/packages/rulesets/src/native/tests/resources/XmsEnumWithDuplicateName.json b/packages/rulesets/src/native/tests/resources/XmsEnumWithDuplicateName.json index f2f0da161..101d65b42 100644 --- a/packages/rulesets/src/native/tests/resources/XmsEnumWithDuplicateName.json +++ b/packages/rulesets/src/native/tests/resources/XmsEnumWithDuplicateName.json @@ -1,102 +1,92 @@ { - "swagger": "2.0", - "info": { - "title": "SwaggerInventoryTests", - "description": "Use this swagger to test the inventory to detect response types with arrays as possible pageable operations", - "version": "2016-10-10" - }, - "host": "management.azure.com", - "paths": { - "/plants": { - "put": { - "description": "Get a list of plants.", - "operationId": "Plants_List", - "x-ms-pageable": { - "nextLinkName": "nextLink" - }, - "parameters": [], - "responses": { - "200": { - "description": "OK.", - "schema": { - "$ref": "#/definitions/PlantsList" - } - } - } + "swagger": "2.0", + "info": { + "title": "SwaggerInventoryTests", + "description": "Use this swagger to test the inventory to detect response types with arrays as possible pageable operations", + "version": "2016-10-10" + }, + "host": "management.azure.com", + "paths": { + "/plants": { + "put": { + "description": "Get a list of plants.", + "operationId": "Plants_List", + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "parameters": [], + "responses": { + "200": { + "description": "OK.", + "schema": { + "$ref": "#/definitions/PlantsList" } + } } - }, - "definitions": { - "PlantsList": { - "type": "object", - "description": "Response to a Pageable operation. This one lists plants", - "readOnly": true, - "properties": { - "value": { - "type": "array", - "description": "List of plants", - "items": { - "$ref": "#/definitions/Plant" - }, - "readOnly": true - }, - "nextLink": { - "type": "string", - "description": "Link to next page of results", - "readOnly": true - } - } + } + } + }, + "definitions": { + "PlantsList": { + "type": "object", + "description": "Response to a Pageable operation. This one lists plants", + "readOnly": true, + "properties": { + "value": { + "type": "array", + "description": "List of plants", + "items": { + "$ref": "#/definitions/Plant" + }, + "readOnly": true }, - "Plant": { - "type": "object", - "description": "A plant", - "properties": { - "name": { - "type": "string", - "description": "The plant's name" - }, - "edible": { - "type": "boolean", - "description": "Is the plant edible?" - } - } + "nextLink": { + "type": "string", + "description": "Link to next page of results", + "readOnly": true + } + } + }, + "Plant": { + "type": "object", + "description": "A plant", + "properties": { + "name": { + "type": "string", + "description": "The plant's name" }, - "ConfigurationStoreProperties": { - "description": "The properties of a configuration store.", - "type": "object", - "properties": { - "provisioningState": { - "description": "The provisioning state of the configuration store.", - "enum": [ - "Creating", - "Updating", - "Deleting", - "Succeeded", - "Failed", - "Canceled" - ], - "type": "string", - "readOnly": true, - "x-ms-enum": { - "name": "RespStatus", - "modelAsString": true - } - }, - "status": { - "description": "The state code.", - "enum": [ - "Success", - "FAILED" - ], - "readOnly": true, - "type": "string", - "x-ms-enum": { - "name": "RespStatus", - "modelAsString": true - } - } - } + "edible": { + "type": "boolean", + "description": "Is the plant edible?" } + } }, - "parameters": {} -} \ No newline at end of file + "ConfigurationStoreProperties": { + "description": "The properties of a configuration store.", + "type": "object", + "properties": { + "provisioningState": { + "description": "The provisioning state of the configuration store.", + "enum": ["Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled"], + "type": "string", + "readOnly": true, + "x-ms-enum": { + "name": "RespStatus", + "modelAsString": true + } + }, + "status": { + "description": "The state code.", + "enum": ["Success", "FAILED"], + "readOnly": true, + "type": "string", + "x-ms-enum": { + "name": "RespStatus", + "modelAsString": true + } + } + } + } + }, + "parameters": {} +} diff --git a/packages/rulesets/src/native/tests/resources/arm-resource-properties-bag-multiple-level-violations.json b/packages/rulesets/src/native/tests/resources/arm-resource-properties-bag-multiple-level-violations.json index 14900220d..82ac4c545 100644 --- a/packages/rulesets/src/native/tests/resources/arm-resource-properties-bag-multiple-level-violations.json +++ b/packages/rulesets/src/native/tests/resources/arm-resource-properties-bag-multiple-level-violations.json @@ -6,22 +6,14 @@ "version": "2014-04-01-preview" }, "host": "management.azure.com", - "schemes": [ - "https" - ], + "schemes": ["https"], "basePath": "/", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], + "produces": ["application/json"], + "consumes": ["application/json"], "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/Res": { "get": { - "tags": [ - "Redis" - ], + "tags": ["Redis"], "operationId": "Redis_get", "description": "gets a Redis cache.", "parameters": [ @@ -45,9 +37,7 @@ }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}": { "put": { - "tags": [ - "Redis" - ], + "tags": ["Redis"], "operationId": "Redis_CreateOrUpdate", "description": "gets a Redis cache.", "parameters": [ @@ -110,7 +100,7 @@ "type": "string", "description": "Resource type" }, - "location":{ + "location": { "type": "string", "description": "Resource type" } @@ -192,4 +182,4 @@ "type": "string" } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/arm-resource-properties-bag-multiple-violations.json b/packages/rulesets/src/native/tests/resources/arm-resource-properties-bag-multiple-violations.json index 811f786df..1c37931e7 100644 --- a/packages/rulesets/src/native/tests/resources/arm-resource-properties-bag-multiple-violations.json +++ b/packages/rulesets/src/native/tests/resources/arm-resource-properties-bag-multiple-violations.json @@ -6,18 +6,14 @@ "version": "2014-04-01-preview" }, "host": "management.azure.com", - "schemes": [ - "https" - ], + "schemes": ["https"], "basePath": "/", - "produces": [ "application/json" ], - "consumes": [ "application/json" ], + "produces": ["application/json"], + "consumes": ["application/json"], "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/Res": { "get": { - "tags": [ - "Redis" - ], + "tags": ["Redis"], "operationId": "Redis_get", "description": "gets a Redis cache.", "parameters": [ @@ -41,9 +37,7 @@ }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}": { "patch": { - "tags": [ - "Redis" - ], + "tags": ["Redis"], "operationId": "Redis_update", "description": "gets a Redis cache.", "parameters": [ @@ -106,7 +100,7 @@ "type": "string", "description": "Resource type" }, - "location":{ + "location": { "type": "string", "description": "Resource type" } @@ -132,7 +126,7 @@ }, "type": { "type": "string", - "description": "some dummy type" + "description": "some dummy type" } } } @@ -167,4 +161,4 @@ "type": "string" } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/arm-resource-properties-bag-with-multiple-level-reference.json b/packages/rulesets/src/native/tests/resources/arm-resource-properties-bag-with-multiple-level-reference.json index b8321cd13..e491e0a90 100644 --- a/packages/rulesets/src/native/tests/resources/arm-resource-properties-bag-with-multiple-level-reference.json +++ b/packages/rulesets/src/native/tests/resources/arm-resource-properties-bag-with-multiple-level-reference.json @@ -6,18 +6,14 @@ "version": "2014-04-01-preview" }, "host": "management.azure.com", - "schemes": [ - "https" - ], + "schemes": ["https"], "basePath": "/", - "produces": [ "application/json" ], - "consumes": [ "application/json" ], + "produces": ["application/json"], + "consumes": ["application/json"], "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/Res": { "get": { - "tags": [ - "Redis" - ], + "tags": ["Redis"], "operationId": "Redis_get", "description": "gets a Redis cache.", "parameters": [ @@ -41,9 +37,7 @@ }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}": { "patch": { - "tags": [ - "Redis" - ], + "tags": ["Redis"], "operationId": "Redis_update", "description": "gets a Redis cache.", "parameters": [ @@ -106,7 +100,7 @@ "type": "string", "description": "Resource type" }, - "location":{ + "location": { "type": "string", "description": "Resource type" } @@ -187,4 +181,4 @@ "type": "string" } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/arm-resource-properties-bag-with-reference.json b/packages/rulesets/src/native/tests/resources/arm-resource-properties-bag-with-reference.json index 56d4979de..622c4554e 100644 --- a/packages/rulesets/src/native/tests/resources/arm-resource-properties-bag-with-reference.json +++ b/packages/rulesets/src/native/tests/resources/arm-resource-properties-bag-with-reference.json @@ -6,18 +6,14 @@ "version": "2014-04-01-preview" }, "host": "management.azure.com", - "schemes": [ - "https" - ], + "schemes": ["https"], "basePath": "/", - "produces": [ "application/json" ], - "consumes": [ "application/json" ], + "produces": ["application/json"], + "consumes": ["application/json"], "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/Res": { "get": { - "tags": [ - "Redis" - ], + "tags": ["Redis"], "operationId": "Redis_get", "description": "gets a Redis cache.", "parameters": [ @@ -41,9 +37,7 @@ }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}": { "patch": { - "tags": [ - "Redis" - ], + "tags": ["Redis"], "operationId": "Redis_update", "description": "gets a Redis cache.", "parameters": [ @@ -106,7 +100,7 @@ "type": "string", "description": "Resource type" }, - "location":{ + "location": { "type": "string", "description": "Resource type" } @@ -123,7 +117,7 @@ "properties": { "properties": { "location": { - "type": "string" + "type": "string" }, "id": { "type": "string" @@ -177,4 +171,4 @@ "type": "string" } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/arm-resource-properties-bag.json b/packages/rulesets/src/native/tests/resources/arm-resource-properties-bag.json index 43b3ffb92..025fcda21 100644 --- a/packages/rulesets/src/native/tests/resources/arm-resource-properties-bag.json +++ b/packages/rulesets/src/native/tests/resources/arm-resource-properties-bag.json @@ -6,18 +6,14 @@ "version": "2014-04-01-preview" }, "host": "management.azure.com", - "schemes": [ - "https" - ], + "schemes": ["https"], "basePath": "/", - "produces": [ "application/json" ], - "consumes": [ "application/json" ], + "produces": ["application/json"], + "consumes": ["application/json"], "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/Res": { "get": { - "tags": [ - "Redis" - ], + "tags": ["Redis"], "operationId": "Redis_get", "description": "gets a Redis cache.", "parameters": [ @@ -41,9 +37,7 @@ }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}": { "patch": { - "tags": [ - "Redis" - ], + "tags": ["Redis"], "operationId": "Redis_update", "description": "gets a Redis cache.", "parameters": [ @@ -106,7 +100,7 @@ "type": "string", "description": "Resource type" }, - "location":{ + "location": { "type": "string", "description": "Resource type" } @@ -163,4 +157,4 @@ "type": "string" } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/armResource/apimdeployment.json b/packages/rulesets/src/native/tests/resources/armResource/apimdeployment.json index 4ef37a661..088aa6b76 100644 --- a/packages/rulesets/src/native/tests/resources/armResource/apimdeployment.json +++ b/packages/rulesets/src/native/tests/resources/armResource/apimdeployment.json @@ -6,20 +6,12 @@ "version": "2019-12-01" }, "host": "management.azure.com", - "schemes": [ - "https" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], + "schemes": ["https"], + "consumes": ["application/json"], + "produces": ["application/json"], "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], "securityDefinitions": { @@ -36,9 +28,7 @@ "paths": { "/providers/Microsoft.ApiManagement/operations": { "get": { - "tags": [ - "ApiManagementOperations" - ], + "tags": ["ApiManagementOperations"], "description": "Lists all of the available REST API operations of the Microsoft.ApiManagement provider.", "operationId": "ApiManagementOperations_List", "x-ms-examples": null, @@ -62,9 +52,7 @@ }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/skus": { "get": { - "tags": [ - "ApiManagementServiceSkus" - ], + "tags": ["ApiManagementServiceSkus"], "summary": "Gets available SKUs for API Management service", "description": "Gets all available SKU for a given API Management service", "operationId": "ApiManagementServiceSkus_ListAvailableServiceSkus", @@ -104,9 +92,7 @@ }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/restore": { "post": { - "tags": [ - "ApiManagementService" - ], + "tags": ["ApiManagementService"], "operationId": "ApiManagementService_Restore", "description": "Restores a backup of an API Management service created using the ApiManagementService_Backup operation on the current service. This is a long running operation and could take several minutes to complete.", "x-ms-examples": null, @@ -158,9 +144,7 @@ }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backup": { "post": { - "tags": [ - "ApiManagementService" - ], + "tags": ["ApiManagementService"], "operationId": "ApiManagementService_Backup", "description": "Creates a backup of the API Management service to the given Azure Storage Account. This is long running operation and could take several minutes to complete.", "x-ms-examples": null, @@ -212,9 +196,7 @@ }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}": { "put": { - "tags": [ - "ApiManagementService" - ], + "tags": ["ApiManagementService"], "operationId": "ApiManagementService_CreateOrUpdate", "description": "Creates or updates an API Management service. This is long running operation and could take several minutes to complete.", "x-ms-examples": null, @@ -267,9 +249,7 @@ "x-ms-long-running-operation": true }, "patch": { - "tags": [ - "ApiManagementService" - ], + "tags": ["ApiManagementService"], "operationId": "ApiManagementService_Update", "description": "Updates an existing API Management service.", "x-ms-examples": null, @@ -316,9 +296,7 @@ "x-ms-long-running-operation": true }, "get": { - "tags": [ - "ApiManagementService" - ], + "tags": ["ApiManagementService"], "operationId": "ApiManagementService_Get", "description": "Gets an API Management service resource description.", "x-ms-examples": null, @@ -352,9 +330,7 @@ } }, "delete": { - "tags": [ - "ApiManagementService" - ], + "tags": ["ApiManagementService"], "operationId": "ApiManagementService_Delete", "description": "Deletes an existing API Management service.", "x-ms-examples": null, @@ -397,9 +373,7 @@ }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service": { "get": { - "tags": [ - "ApiManagementService" - ], + "tags": ["ApiManagementService"], "operationId": "ApiManagementService_ListByResourceGroup", "description": "List all API Management services within a resource group.", "x-ms-examples": null, @@ -435,9 +409,7 @@ }, "/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/service": { "get": { - "tags": [ - "ApiManagementService" - ], + "tags": ["ApiManagementService"], "operationId": "ApiManagementService_List", "description": "Lists all API Management services within an Azure subscription.", "x-ms-examples": null, @@ -464,9 +436,7 @@ }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/getssotoken": { "post": { - "tags": [ - "ApiManagementService" - ], + "tags": ["ApiManagementService"], "operationId": "ApiManagementService_GetSsoToken", "description": "Gets the Single-Sign-On token for the API Management Service which is valid for 5 Minutes.", "x-ms-examples": null, @@ -503,9 +473,7 @@ }, "/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/checkNameAvailability": { "post": { - "tags": [ - "ApiManagementService" - ], + "tags": ["ApiManagementService"], "operationId": "ApiManagementService_CheckNameAvailability", "description": "Checks availability and correctness of a name for an API Management service.", "x-ms-examples": null, @@ -544,9 +512,7 @@ }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/applynetworkconfigurationupdates": { "post": { - "tags": [ - "ApiManagementService" - ], + "tags": ["ApiManagementService"], "operationId": "ApiManagementService_ApplyNetworkConfigurationUpdates", "description": "Updates the Microsoft.ApiManagement resource running in the Virtual network to pick the updated network settings.", "x-ms-examples": null, @@ -612,9 +578,7 @@ "description": "The uri to fetch the next page of API Management service Skus." } }, - "required": [ - "value" - ], + "required": ["value"], "description": "The API Management service SKUs operation response." }, "ResourceSkuResult": { @@ -661,11 +625,7 @@ "type": "string", "readOnly": true, "description": "The scale type applicable to the sku.", - "enum": [ - "automatic", - "manual", - "none" - ], + "enum": ["automatic", "manual", "none"], "x-ms-enum": { "name": "ResourceSkuCapacityScaleType", "modelAsString": true, @@ -696,13 +656,7 @@ "externalDocs": { "url": "https://azure.microsoft.com/en-us/pricing/details/api-management/" }, - "enum": [ - "Developer", - "Standard", - "Premium", - "Basic", - "Consumption" - ], + "enum": ["Developer", "Standard", "Premium", "Basic", "Consumption"], "x-ms-enum": { "name": "SkuType", "modelAsString": true, @@ -749,11 +703,7 @@ "description": "Subject of the certificate." } }, - "required": [ - "expiry", - "thumbprint", - "subject" - ], + "required": ["expiry", "thumbprint", "subject"], "description": "SSL certificate information." }, "CertificateConfiguration": { @@ -769,19 +719,14 @@ "storeName": { "description": "The System.Security.Cryptography.x509certificates.StoreName certificate store location. Only Root and CertificateAuthority are valid locations.", "type": "string", - "enum": [ - "CertificateAuthority", - "Root" - ] + "enum": ["CertificateAuthority", "Root"] }, "certificate": { "$ref": "#/definitions/CertificateInformation", "description": "Certificate information." } }, - "required": [ - "storeName" - ], + "required": ["storeName"], "description": "Certificate configuration which consist of non-trusted intermediates and root certificates." }, "HostnameConfiguration": { @@ -789,13 +734,7 @@ "type": { "type": "string", "description": "Hostname type.", - "enum": [ - "Proxy", - "Portal", - "Management", - "Scm", - "DeveloperPortal" - ], + "enum": ["Proxy", "Portal", "Management", "Scm", "DeveloperPortal"], "x-ms-enum": { "name": "HostnameType", "modelAsString": true @@ -832,10 +771,7 @@ "description": "Certificate information." } }, - "required": [ - "type", - "hostName" - ], + "required": ["type", "hostName"], "description": "Custom hostname configuration." }, "VirtualNetworkConfiguration": { @@ -899,10 +835,7 @@ "default": false } }, - "required": [ - "location", - "sku" - ], + "required": ["location", "sku"], "description": "Description of an additional API Management resource location." }, "ApiManagementServiceBackupRestoreParameters": { @@ -924,12 +857,7 @@ "description": "The name of the backup file to create." } }, - "required": [ - "storageAccount", - "accessKey", - "containerName", - "backupName" - ], + "required": ["storageAccount", "accessKey", "containerName", "backupName"], "description": "Parameters supplied to the Backup/Restore of an API Management service operation." }, "ApiManagementServiceProperties": { @@ -950,10 +878,7 @@ "$ref": "#/definitions/ApiManagementServiceBaseProperties" } ], - "required": [ - "publisherEmail", - "publisherName" - ], + "required": ["publisherEmail", "publisherName"], "description": "Properties of an API Management service resource description." }, "ApiManagementServiceUpdateProperties": { @@ -1091,11 +1016,7 @@ "type": "string", "description": "The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only.", "default": "None", - "enum": [ - "None", - "External", - "Internal" - ], + "enum": ["None", "External", "Internal"], "x-ms-enum": { "name": "VirtualNetworkType", "modelAsString": true, @@ -1140,13 +1061,7 @@ "externalDocs": { "url": "https://azure.microsoft.com/en-us/pricing/details/api-management/" }, - "enum": [ - "Developer", - "Standard", - "Premium", - "Basic", - "Consumption" - ], + "enum": ["Developer", "Standard", "Premium", "Basic", "Consumption"], "x-ms-enum": { "name": "SkuType", "modelAsString": true, @@ -1180,10 +1095,7 @@ "description": "Capacity of the SKU (number of deployed units of the SKU). For Consumption SKU capacity must be specified as 0." } }, - "required": [ - "name", - "capacity" - ], + "required": ["name", "capacity"], "description": "API Management service resource SKU properties." }, "ApiManagementServiceResource": { @@ -1204,10 +1116,7 @@ "location": { "type": "string", "description": "Resource location.", - "x-ms-mutability": [ - "read", - "create" - ] + "x-ms-mutability": ["read", "create"] }, "etag": { "type": "string", @@ -1220,11 +1129,7 @@ "$ref": "#/definitions/ApimResource" } ], - "required": [ - "location", - "sku", - "properties" - ], + "required": ["location", "sku", "properties"], "description": "A single API Management service resource in List or Get response." }, "ApimResource": { @@ -1297,9 +1202,7 @@ "description": "Link to the next set of results. Not empty if Value contains incomplete list of API Management services." } }, - "required": [ - "value" - ], + "required": ["value"], "description": "The response of the List API Management services operation." }, "ApiManagementServiceGetSsoTokenResult": { @@ -1318,9 +1221,7 @@ "description": "The name to check for availability." } }, - "required": [ - "name" - ], + "required": ["name"], "description": "Parameters supplied to the CheckNameAvailability operation." }, "ApiManagementServiceNameAvailabilityResult": { @@ -1338,11 +1239,7 @@ "reason": { "type": "string", "description": "Invalid indicates the name provided does not match the resource provider’s naming requirements (incorrect length, unsupported characters, etc.) AlreadyExists indicates that the name is already in use and is therefore unavailable.", - "enum": [ - "Valid", - "Invalid", - "AlreadyExists" - ], + "enum": ["Valid", "Invalid", "AlreadyExists"], "x-ms-enum": { "name": "NameAvailabilityReason", "modelAsString": false @@ -1366,12 +1263,7 @@ "type": { "type": "string", "description": "The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service.", - "enum": [ - "SystemAssigned", - "UserAssigned", - "SystemAssigned, UserAssigned", - "None" - ], + "enum": ["SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned", "None"], "x-ms-enum": { "name": "ApimIdentityType", "modelAsString": true @@ -1397,9 +1289,7 @@ } } }, - "required": [ - "type" - ] + "required": ["type"] }, "UserIdentityProperties": { "type": "object", @@ -1472,4 +1362,4 @@ } }, "parameters": {} -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/armResource/appconfiguration.json b/packages/rulesets/src/native/tests/resources/armResource/appconfiguration.json index 6e88d2b4e..d563a1a0b 100644 --- a/packages/rulesets/src/native/tests/resources/armResource/appconfiguration.json +++ b/packages/rulesets/src/native/tests/resources/armResource/appconfiguration.json @@ -5,21 +5,13 @@ "title": "AppConfigurationManagementClient" }, "host": "management.azure.com", - "schemes": [ - "https" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], + "schemes": ["https"], + "consumes": ["application/json"], + "produces": ["application/json"], "paths": { "/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/configurationStores": { "get": { - "tags": [ - "ConfigurationStores" - ], + "tags": ["ConfigurationStores"], "description": "Lists the configuration stores for a given subscription.", "operationId": "ConfigurationStores_List", "parameters": [ @@ -58,9 +50,7 @@ }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores": { "get": { - "tags": [ - "ConfigurationStores" - ], + "tags": ["ConfigurationStores"], "description": "Lists the configuration stores for a given resource group.", "operationId": "ConfigurationStores_ListByResourceGroup", "parameters": [ @@ -102,9 +92,7 @@ }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}": { "get": { - "tags": [ - "ConfigurationStores" - ], + "tags": ["ConfigurationStores"], "description": "Gets the properties of the specified configuration store.", "operationId": "ConfigurationStores_Get", "parameters": [ @@ -137,9 +125,7 @@ } }, "put": { - "tags": [ - "ConfigurationStores" - ], + "tags": ["ConfigurationStores"], "description": "Creates a configuration store with the specified parameters.", "operationId": "ConfigurationStores_Create", "parameters": [ @@ -188,9 +174,7 @@ "x-ms-long-running-operation": true }, "delete": { - "tags": [ - "ConfigurationStores" - ], + "tags": ["ConfigurationStores"], "description": "Deletes a configuration store.", "operationId": "ConfigurationStores_Delete", "parameters": [ @@ -227,9 +211,7 @@ "x-ms-long-running-operation": true }, "patch": { - "tags": [ - "ConfigurationStores" - ], + "tags": ["ConfigurationStores"], "description": "Updates a configuration store with the specified parameters.", "operationId": "ConfigurationStores_Update", "parameters": [ @@ -280,9 +262,7 @@ }, "/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/checkNameAvailability": { "post": { - "tags": [ - "Operations" - ], + "tags": ["Operations"], "description": "Checks whether the configuration store name is available for use.", "operationId": "Operations_CheckNameAvailability", "parameters": [ @@ -320,9 +300,7 @@ }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/ListKeys": { "post": { - "tags": [ - "ConfigurationStores" - ], + "tags": ["ConfigurationStores"], "description": "Lists the access key for the specified configuration store.", "operationId": "ConfigurationStores_ListKeys", "parameters": [ @@ -367,9 +345,7 @@ }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/RegenerateKey": { "post": { - "tags": [ - "ConfigurationStores" - ], + "tags": ["ConfigurationStores"], "description": "Regenerates an access key for the specified configuration store.", "operationId": "ConfigurationStores_RegenerateKey", "parameters": [ @@ -413,9 +389,7 @@ }, "/providers/Microsoft.AppConfiguration/operations": { "get": { - "tags": [ - "Operations" - ], + "tags": ["Operations"], "description": "Lists the operations available from this provider.", "operationId": "Operations_List", "parameters": [ @@ -452,9 +426,7 @@ }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/listKeyValue": { "post": { - "tags": [ - "ConfigurationStores" - ], + "tags": ["ConfigurationStores"], "description": "Lists a configuration store key-value.", "operationId": "ConfigurationStores_ListKeyValue", "parameters": [ @@ -499,9 +471,7 @@ }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections": { "get": { - "tags": [ - "PrivateEndpointConnections" - ], + "tags": ["PrivateEndpointConnections"], "operationId": "PrivateEndpointConnections_ListByConfigurationStore", "description": "Lists all private endpoint connections for a configuration store.", "parameters": [ @@ -540,9 +510,7 @@ }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}": { "get": { - "tags": [ - "PrivateEndpointConnections" - ], + "tags": ["PrivateEndpointConnections"], "operationId": "PrivateEndpointConnections_Get", "description": "Gets the specified private endpoint connection associated with the configuration store.", "parameters": [ @@ -583,9 +551,7 @@ "x-ms-examples": null }, "put": { - "tags": [ - "PrivateEndpointConnections" - ], + "tags": ["PrivateEndpointConnections"], "operationId": "PrivateEndpointConnections_CreateOrUpdate", "description": "Update the state of the specified private endpoint connection associated with the configuration store.", "parameters": [ @@ -642,9 +608,7 @@ "x-ms-long-running-operation": true }, "delete": { - "tags": [ - "PrivateEndpointConnections" - ], + "tags": ["PrivateEndpointConnections"], "description": "Deletes a private endpoint connection.", "operationId": "PrivateEndpointConnections_Delete", "parameters": [ @@ -691,9 +655,7 @@ }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateLinkResources": { "get": { - "tags": [ - "PrivateLinkResources" - ], + "tags": ["PrivateLinkResources"], "operationId": "PrivateLinkResources_ListByConfigurationStore", "description": "Gets the private link resources that need to be created for a configuration store.", "parameters": [ @@ -732,9 +694,7 @@ }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateLinkResources/{groupName}": { "get": { - "tags": [ - "PrivateLinkResources" - ], + "tags": ["PrivateLinkResources"], "operationId": "PrivateLinkResources_Get", "description": "Gets a private link resource that need to be created for a configuration store.", "parameters": [ @@ -796,10 +756,7 @@ }, "ConfigurationStore": { "description": "The configuration store along with all resource properties. The Configuration Store will have all information to begin utilizing it.", - "required": [ - "location", - "sku" - ], + "required": ["location", "sku"], "type": "object", "allOf": [ { @@ -828,14 +785,7 @@ "properties": { "provisioningState": { "description": "The provisioning state of the configuration store.", - "enum": [ - "Creating", - "Updating", - "Deleting", - "Succeeded", - "Failed", - "Canceled" - ], + "enum": ["Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled"], "type": "string", "readOnly": true, "x-ms-enum": { @@ -868,10 +818,7 @@ }, "publicNetworkAccess": { "description": "Control permission for data plane traffic coming from public networks while private endpoint is enabled.", - "enum": [ - "Enabled", - "Disabled" - ], + "enum": ["Enabled", "Disabled"], "type": "string", "x-ms-enum": { "name": "PublicNetworkAccess", @@ -968,10 +915,7 @@ }, "CheckNameAvailabilityParameters": { "description": "Parameters used for checking whether a resource name is available.", - "required": [ - "name", - "type" - ], + "required": ["name", "type"], "type": "object", "properties": { "name": { @@ -980,9 +924,7 @@ }, "type": { "description": "The resource type to check for name availability.", - "enum": [ - "Microsoft.AppConfiguration/configurationStores" - ], + "enum": ["Microsoft.AppConfiguration/configurationStores"], "type": "string", "x-ms-enum": { "name": "ConfigurationResourceType", @@ -1078,9 +1020,7 @@ }, "ListKeyValueParameters": { "description": "The parameters used to list a configuration store key-value", - "required": [ - "key" - ], + "required": ["key"], "type": "object", "properties": { "key": { @@ -1203,12 +1143,7 @@ "properties": { "type": { "description": "The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identities.", - "enum": [ - "None", - "SystemAssigned", - "UserAssigned", - "SystemAssigned, UserAssigned" - ], + "enum": ["None", "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned"], "type": "string", "x-ms-enum": { "name": "IdentityType", @@ -1252,9 +1187,7 @@ }, "Sku": { "type": "object", - "required": [ - "name" - ], + "required": ["name"], "properties": { "name": { "description": "The SKU name of the configuration store.", @@ -1278,9 +1211,7 @@ }, "Resource": { "description": "An Azure resource.", - "required": [ - "location" - ], + "required": ["location"], "properties": { "id": { "description": "The resource ID.", @@ -1300,10 +1231,7 @@ "location": { "description": "The location of the resource. This cannot be changed after the resource is created.", "type": "string", - "x-ms-mutability": [ - "read", - "create" - ] + "x-ms-mutability": ["read", "create"] }, "tags": { "description": "The tags of the resource.", @@ -1364,14 +1292,7 @@ "description": "Properties of a private endpoint connection.", "properties": { "provisioningState": { - "enum": [ - "Creating", - "Updating", - "Deleting", - "Succeeded", - "Failed", - "Canceled" - ], + "enum": ["Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled"], "type": "string", "readOnly": true, "description": "The provisioning status of the private endpoint connection.", @@ -1389,9 +1310,7 @@ "description": "A collection of information about the state of the connection between service consumer and provider." } }, - "required": [ - "privateLinkServiceConnectionState" - ] + "required": ["privateLinkServiceConnectionState"] }, "PrivateEndpoint": { "type": "object", @@ -1408,12 +1327,7 @@ "type": "object", "properties": { "status": { - "enum": [ - "Pending", - "Approved", - "Rejected", - "Disconnected" - ], + "enum": ["Pending", "Approved", "Rejected", "Disconnected"], "type": "string", "description": "The private link service connection status.", "x-ms-enum": { @@ -1426,10 +1340,7 @@ "description": "The private link service connection description." }, "actionsRequired": { - "enum": [ - "None", - "Recreate" - ], + "enum": ["None", "Recreate"], "type": "string", "readOnly": true, "description": "Any action that is required beyond basic workflow (approve/ reject/ disconnect)", @@ -1559,9 +1470,7 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ] -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/armResource/cdn.json b/packages/rulesets/src/native/tests/resources/armResource/cdn.json index 74a075229..b0600ffca 100644 --- a/packages/rulesets/src/native/tests/resources/armResource/cdn.json +++ b/packages/rulesets/src/native/tests/resources/armResource/cdn.json @@ -2646,14 +2646,7 @@ "resourceState": { "description": "Resource status of the endpoint.", "readOnly": true, - "enum": [ - "Creating", - "Deleting", - "Running", - "Starting", - "Stopped", - "Stopping" - ], + "enum": ["Creating", "Deleting", "Running", "Starting", "Stopped", "Stopping"], "type": "string", "x-ms-enum": { "name": "EndpointResourceState", @@ -3083,9 +3076,7 @@ "properties": { "@odata.type": { "type": "string", - "enum": [ - "#Microsoft.Azure.Cdn.Models.DeliveryRuleRemoteAddressConditionParameters" - ] + "enum": ["#Microsoft.Azure.Cdn.Models.DeliveryRuleRemoteAddressConditionParameters"] }, "operator": { "description": "Describes operator to be matched", @@ -3122,9 +3113,7 @@ "properties": { "@odata.type": { "type": "string", - "enum": [ - "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestMethodConditionParameters" - ] + "enum": ["#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestMethodConditionParameters"] }, "operator": { "description": "Describes operator to be matched", @@ -3155,9 +3144,7 @@ "properties": { "@odata.type": { "type": "string", - "enum": [ - "#Microsoft.Azure.Cdn.Models.DeliveryRuleQueryStringConditionParameters" - ] + "enum": ["#Microsoft.Azure.Cdn.Models.DeliveryRuleQueryStringConditionParameters"] }, "operator": { "description": "Describes operator to be matched", @@ -3204,9 +3191,7 @@ "properties": { "@odata.type": { "type": "string", - "enum": [ - "#Microsoft.Azure.Cdn.Models.DeliveryRulePostArgsConditionParameters" - ] + "enum": ["#Microsoft.Azure.Cdn.Models.DeliveryRulePostArgsConditionParameters"] }, "selector": { "description": "Name of PostArg to be matched", @@ -3257,9 +3242,7 @@ "properties": { "@odata.type": { "type": "string", - "enum": [ - "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestUriConditionParameters" - ] + "enum": ["#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestUriConditionParameters"] }, "operator": { "description": "Describes operator to be matched", @@ -3306,9 +3289,7 @@ "properties": { "@odata.type": { "type": "string", - "enum": [ - "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestHeaderConditionParameters" - ] + "enum": ["#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestHeaderConditionParameters"] }, "selector": { "description": "Name of Header to be matched", @@ -3359,9 +3340,7 @@ "properties": { "@odata.type": { "type": "string", - "enum": [ - "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestBodyConditionParameters" - ] + "enum": ["#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestBodyConditionParameters"] }, "operator": { "description": "Describes operator to be matched", @@ -3408,9 +3387,7 @@ "properties": { "@odata.type": { "type": "string", - "enum": [ - "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestSchemeConditionParameters" - ] + "enum": ["#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestSchemeConditionParameters"] }, "operator": { "description": "Describes operator to be matched", @@ -3437,9 +3414,7 @@ "properties": { "@odata.type": { "type": "string", - "enum": [ - "#Microsoft.Azure.Cdn.Models.DeliveryRuleUrlPathMatchConditionParameters" - ] + "enum": ["#Microsoft.Azure.Cdn.Models.DeliveryRuleUrlPathMatchConditionParameters"] }, "operator": { "description": "Describes operator to be matched", @@ -3487,9 +3462,7 @@ "properties": { "@odata.type": { "type": "string", - "enum": [ - "#Microsoft.Azure.Cdn.Models.DeliveryRuleUrlFileExtensionMatchConditionParameters" - ] + "enum": ["#Microsoft.Azure.Cdn.Models.DeliveryRuleUrlFileExtensionMatchConditionParameters"] }, "operator": { "description": "Describes operator to be matched", @@ -3536,9 +3509,7 @@ "properties": { "@odata.type": { "type": "string", - "enum": [ - "#Microsoft.Azure.Cdn.Models.DeliveryRuleUrlFilenameConditionParameters" - ] + "enum": ["#Microsoft.Azure.Cdn.Models.DeliveryRuleUrlFilenameConditionParameters"] }, "operator": { "description": "Describes operator to be matched", @@ -3585,9 +3556,7 @@ "properties": { "@odata.type": { "type": "string", - "enum": [ - "#Microsoft.Azure.Cdn.Models.DeliveryRuleHttpVersionConditionParameters" - ] + "enum": ["#Microsoft.Azure.Cdn.Models.DeliveryRuleHttpVersionConditionParameters"] }, "operator": { "description": "Describes operator to be matched", @@ -3617,9 +3586,7 @@ "properties": { "@odata.type": { "type": "string", - "enum": [ - "#Microsoft.Azure.Cdn.Models.DeliveryRuleCookiesConditionParameters" - ] + "enum": ["#Microsoft.Azure.Cdn.Models.DeliveryRuleCookiesConditionParameters"] }, "selector": { "description": "Name of Cookies to be matched", @@ -3670,9 +3637,7 @@ "properties": { "@odata.type": { "type": "string", - "enum": [ - "#Microsoft.Azure.Cdn.Models.DeliveryRuleIsDeviceConditionParameters" - ] + "enum": ["#Microsoft.Azure.Cdn.Models.DeliveryRuleIsDeviceConditionParameters"] }, "operator": { "description": "Describes operator to be matched", @@ -3750,9 +3715,7 @@ "properties": { "@odata.type": { "type": "string", - "enum": [ - "#Microsoft.Azure.Cdn.Models.DeliveryRuleUrlRedirectActionParameters" - ] + "enum": ["#Microsoft.Azure.Cdn.Models.DeliveryRuleUrlRedirectActionParameters"] }, "redirectType": { "description": "The redirect type the rule will use when redirecting traffic.", @@ -3796,9 +3759,7 @@ "properties": { "@odata.type": { "type": "string", - "enum": [ - "#Microsoft.Azure.Cdn.Models.DeliveryRuleUrlSigningActionParameters" - ] + "enum": ["#Microsoft.Azure.Cdn.Models.DeliveryRuleUrlSigningActionParameters"] }, "keyId": { "description": "Id reference of the key to be used to verify the hash and should be defined in UrlSigningKeys", @@ -3870,9 +3831,7 @@ "properties": { "@odata.type": { "type": "string", - "enum": [ - "#Microsoft.Azure.Cdn.Models.DeliveryRuleUrlRewriteActionParameters" - ] + "enum": ["#Microsoft.Azure.Cdn.Models.DeliveryRuleUrlRewriteActionParameters"] }, "sourcePattern": { "description": "define a request URI pattern that identifies the type of requests that may be rewritten. If value is blank, all strings are matched.", @@ -3926,9 +3885,7 @@ "properties": { "@odata.type": { "type": "string", - "enum": [ - "#Microsoft.Azure.Cdn.Models.DeliveryRuleHeaderActionParameters" - ] + "enum": ["#Microsoft.Azure.Cdn.Models.DeliveryRuleHeaderActionParameters"] }, "headerAction": { "description": "Action to perform", @@ -3971,9 +3928,7 @@ "properties": { "@odata.type": { "type": "string", - "enum": [ - "#Microsoft.Azure.Cdn.Models.DeliveryRuleCacheExpirationActionParameters" - ] + "enum": ["#Microsoft.Azure.Cdn.Models.DeliveryRuleCacheExpirationActionParameters"] }, "cacheBehavior": { "description": "Caching behavior for the requests", @@ -4022,9 +3977,7 @@ "properties": { "@odata.type": { "type": "string", - "enum": [ - "#Microsoft.Azure.Cdn.Models.DeliveryRuleCacheKeyQueryStringBehaviorActionParameters" - ] + "enum": ["#Microsoft.Azure.Cdn.Models.DeliveryRuleCacheKeyQueryStringBehaviorActionParameters"] }, "queryStringBehavior": { "description": "Caching behavior for the requests", @@ -4246,14 +4199,7 @@ }, "KeyVaultSigningKeyParameters": { "description": "Describes the parameters for using a user's KeyVault for URL Signing Key.", - "required": [ - "@odata.type", - "subscriptionId", - "resourceGroupName", - "vaultName", - "secretName", - "secretVersion" - ], + "required": ["@odata.type", "subscriptionId", "resourceGroupName", "vaultName", "secretName", "secretVersion"], "properties": { "@odata.type": { "type": "string", @@ -4338,13 +4284,7 @@ "description": "The approval status for the connection to the Private Link", "type": "string", "readOnly": true, - "enum": [ - "Pending", - "Approved", - "Rejected", - "Disconnected", - "Timeout" - ], + "enum": ["Pending", "Approved", "Rejected", "Disconnected", "Timeout"], "x-ms-enum": { "name": "PrivateEndpointStatus", "modelAsString": true @@ -4819,9 +4759,7 @@ "properties": { "@odata.type": { "type": "string", - "enum": [ - "#Microsoft.Azure.Cdn.Models.KeyVaultCertificateSourceParameters" - ] + "enum": ["#Microsoft.Azure.Cdn.Models.KeyVaultCertificateSourceParameters"] }, "subscriptionId": { "description": "Subscription Id of the user's Key Vault containing the SSL certificate", @@ -5217,12 +5155,7 @@ }, "QueryStringCachingBehavior": { "description": "Defines how CDN caches requests that include query strings. You can ignore any query strings when caching, bypass caching to prevent requests that contain query strings from being cached, or cache every request with a unique URL.", - "enum": [ - "IgnoreQueryString", - "BypassCaching", - "UseQueryString", - "NotSet" - ], + "enum": ["IgnoreQueryString", "BypassCaching", "UseQueryString", "NotSet"], "type": "string", "x-ms-enum": { "name": "QueryStringCachingBehavior", @@ -5378,14 +5311,7 @@ "resourceState": { "title": "Resource status of the policy.", "readOnly": true, - "enum": [ - "Creating", - "Enabling", - "Enabled", - "Disabling", - "Disabled", - "Deleting" - ], + "enum": ["Creating", "Enabling", "Enabled", "Disabling", "Disabled", "Deleting"], "type": "string", "x-ms-enum": { "name": "PolicyResourceState", @@ -5603,14 +5529,7 @@ "TransformType": { "description": "Describes what transforms were applied before matching.", "type": "string", - "enum": [ - "Lowercase", - "Uppercase", - "Trim", - "UrlDecode", - "UrlEncode", - "RemoveNulls" - ], + "enum": ["Lowercase", "Uppercase", "Trim", "UrlDecode", "UrlEncode", "RemoveNulls"], "x-ms-enum": { "name": "TransformType", "modelAsString": true diff --git a/packages/rulesets/src/native/tests/resources/armResource/compute.json b/packages/rulesets/src/native/tests/resources/armResource/compute.json index b04ac3796..2e0845b57 100644 --- a/packages/rulesets/src/native/tests/resources/armResource/compute.json +++ b/packages/rulesets/src/native/tests/resources/armResource/compute.json @@ -5,14 +5,10 @@ "description": "Compute Client" }, "host": "management.azure.com", - "schemes": [ - "https" - ], + "schemes": ["https"], "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], "securityDefinitions": { @@ -29,9 +25,7 @@ "paths": { "/providers/Microsoft.Compute/operations": { "get": { - "tags": [ - "ComputeOperations" - ], + "tags": ["ComputeOperations"], "operationId": "Operations_List", "description": "Gets a list of compute operations.", "parameters": [ @@ -41,9 +35,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] } ], "responses": { @@ -57,19 +49,13 @@ "x-ms-pageable": { "nextLinkName": null }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}": { "put": { - "tags": [ - "AvailabilitySets" - ], + "tags": ["AvailabilitySets"], "operationId": "AvailabilitySets_CreateOrUpdate", "description": "Create or update an availability set.", "parameters": [ @@ -102,9 +88,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -119,17 +103,11 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "patch": { - "tags": [ - "AvailabilitySets" - ], + "tags": ["AvailabilitySets"], "operationId": "AvailabilitySets_Update", "description": "Update an availability set.", "parameters": [ @@ -162,9 +140,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -178,17 +154,11 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { - "tags": [ - "AvailabilitySets" - ], + "tags": ["AvailabilitySets"], "operationId": "AvailabilitySets_Delete", "description": "Delete an availability set.", "parameters": [ @@ -212,9 +182,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -228,17 +196,11 @@ "description": "No Content" } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "get": { - "tags": [ - "AvailabilitySets" - ], + "tags": ["AvailabilitySets"], "operationId": "AvailabilitySets_Get", "description": "Retrieves information about an availability set.", "parameters": [ @@ -262,9 +224,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -278,19 +238,13 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/availabilitySets": { "get": { - "tags": [ - "AvailabilitySets" - ], + "tags": ["AvailabilitySets"], "operationId": "AvailabilitySets_ListBySubscription", "description": "Lists all availability sets in a subscription.", "parameters": [ @@ -300,9 +254,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -327,19 +279,13 @@ "nextLinkName": "nextLink" }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets": { "get": { - "tags": [ - "AvailabilitySets" - ], + "tags": ["AvailabilitySets"], "operationId": "AvailabilitySets_List", "description": "Lists all availability sets in a resource group.", "parameters": [ @@ -356,9 +302,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -375,19 +319,13 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/vmSizes": { "get": { - "tags": [ - "AvailabilitySets" - ], + "tags": ["AvailabilitySets"], "operationId": "AvailabilitySets_ListAvailableSizes", "description": "Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set.", "parameters": [ @@ -411,9 +349,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -430,19 +366,13 @@ "x-ms-pageable": { "nextLinkName": null }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}": { "put": { - "tags": [ - "ProximityPlacementGroups" - ], + "tags": ["ProximityPlacementGroups"], "operationId": "ProximityPlacementGroups_CreateOrUpdate", "description": "Create or update a proximity placement group.", "parameters": [ @@ -475,9 +405,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -498,17 +426,11 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "patch": { - "tags": [ - "ProximityPlacementGroups" - ], + "tags": ["ProximityPlacementGroups"], "operationId": "ProximityPlacementGroups_Update", "description": "Update a proximity placement group.", "parameters": [ @@ -541,9 +463,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -558,17 +478,11 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { - "tags": [ - "ProximityPlacementGroups" - ], + "tags": ["ProximityPlacementGroups"], "operationId": "ProximityPlacementGroups_Delete", "description": "Delete a proximity placement group.", "parameters": [ @@ -592,9 +506,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -606,17 +518,11 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "get": { - "tags": [ - "ProximityPlacementGroups" - ], + "tags": ["ProximityPlacementGroups"], "operationId": "ProximityPlacementGroups_Get", "description": "Retrieves information about a proximity placement group .", "parameters": [ @@ -647,9 +553,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -664,19 +568,13 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/proximityPlacementGroups": { "get": { - "tags": [ - "ProximityPlacementGroups" - ], + "tags": ["ProximityPlacementGroups"], "operationId": "ProximityPlacementGroups_ListBySubscription", "description": "Lists all proximity placement groups in a subscription.", "parameters": [ @@ -686,9 +584,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -706,19 +602,13 @@ "nextLinkName": "nextLink" }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups": { "get": { - "tags": [ - "ProximityPlacementGroups" - ], + "tags": ["ProximityPlacementGroups"], "operationId": "ProximityPlacementGroups_ListByResourceGroup", "description": "Lists all proximity placement groups in a resource group.", "parameters": [ @@ -735,9 +625,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -755,19 +643,13 @@ "nextLinkName": "nextLink" }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}": { "put": { - "tags": [ - "DedicatedHostGroups" - ], + "tags": ["DedicatedHostGroups"], "operationId": "DedicatedHostGroups_CreateOrUpdate", "description": "Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596)", "parameters": [ @@ -800,9 +682,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -823,17 +703,11 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "patch": { - "tags": [ - "DedicatedHostGroups" - ], + "tags": ["DedicatedHostGroups"], "operationId": "DedicatedHostGroups_Update", "description": "Update an dedicated host group.", "parameters": [ @@ -866,9 +740,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -882,17 +754,11 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { - "tags": [ - "DedicatedHostGroups" - ], + "tags": ["DedicatedHostGroups"], "operationId": "DedicatedHostGroups_Delete", "description": "Delete a dedicated host group.", "parameters": [ @@ -916,9 +782,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -932,17 +796,11 @@ "description": "No Content" } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "get": { - "tags": [ - "DedicatedHostGroups" - ], + "tags": ["DedicatedHostGroups"], "operationId": "DedicatedHostGroups_Get", "description": "Retrieves information about a dedicated host group.", "parameters": [ @@ -966,9 +824,7 @@ "required": false, "type": "string", "description": "The expand expression to apply on the operation. The response shows the list of instance view of the dedicated hosts under the dedicated host group.", - "enum": [ - "instanceView" - ], + "enum": ["instanceView"], "x-ms-enum": { "name": "InstanceViewTypes", "modelAsString": false @@ -980,9 +836,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -997,19 +851,13 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups": { "get": { - "tags": [ - "DedicatedHostGroups" - ], + "tags": ["DedicatedHostGroups"], "operationId": "DedicatedHostGroups_ListByResourceGroup", "description": "Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups.", "parameters": [ @@ -1026,9 +874,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -1045,19 +891,13 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/hostGroups": { "get": { - "tags": [ - "DedicatedHostGroups" - ], + "tags": ["DedicatedHostGroups"], "operationId": "DedicatedHostGroups_ListBySubscription", "description": "Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups.", "parameters": [ @@ -1067,9 +907,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -1086,19 +924,13 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}": { "put": { - "tags": [ - "DedicatedHosts" - ], + "tags": ["DedicatedHosts"], "operationId": "DedicatedHosts_CreateOrUpdate", "description": "Create or update a dedicated host .", "parameters": [ @@ -1138,9 +970,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -1162,17 +992,11 @@ }, "x-ms-examples": null, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "patch": { - "tags": [ - "DedicatedHosts" - ], + "tags": ["DedicatedHosts"], "operationId": "DedicatedHosts_Update", "description": "Update an dedicated host .", "parameters": [ @@ -1212,9 +1036,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -1229,17 +1051,11 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { - "tags": [ - "DedicatedHosts" - ], + "tags": ["DedicatedHosts"], "operationId": "DedicatedHosts_Delete", "description": "Delete a dedicated host.", "parameters": [ @@ -1270,9 +1086,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -1290,17 +1104,11 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "get": { - "tags": [ - "DedicatedHosts" - ], + "tags": ["DedicatedHosts"], "operationId": "DedicatedHosts_Get", "description": "Retrieves information about a dedicated host.", "parameters": [ @@ -1331,9 +1139,7 @@ "required": false, "type": "string", "description": "The expand expression to apply on the operation.", - "enum": [ - "instanceView" - ], + "enum": ["instanceView"], "x-ms-enum": { "name": "InstanceViewTypes", "modelAsString": false @@ -1345,9 +1151,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -1362,19 +1166,13 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts": { "get": { - "tags": [ - "DedicatedHost" - ], + "tags": ["DedicatedHost"], "operationId": "DedicatedHosts_ListByHostGroup", "description": "Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts.", "parameters": [ @@ -1398,9 +1196,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -1417,19 +1213,13 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/sshPublicKeys": { "get": { - "tags": [ - "SshPublicKeys" - ], + "tags": ["SshPublicKeys"], "operationId": "SshPublicKeys_ListBySubscription", "description": "Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys.", "parameters": [ @@ -1439,9 +1229,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -1458,19 +1246,13 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys": { "get": { - "tags": [ - "SshPublicKeys" - ], + "tags": ["SshPublicKeys"], "operationId": "SshPublicKeys_ListByResourceGroup", "description": "Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys.", "parameters": [ @@ -1487,9 +1269,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -1506,19 +1286,13 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}": { "put": { - "tags": [ - "SshPublicKeys" - ], + "tags": ["SshPublicKeys"], "operationId": "SshPublicKeys_Create", "description": "Creates a new SSH public key resource.", "parameters": [ @@ -1551,9 +1325,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -1574,17 +1346,11 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "patch": { - "tags": [ - "SshPublicKeys" - ], + "tags": ["SshPublicKeys"], "operationId": "SshPublicKeys_Update", "description": "Updates a new SSH public key resource.", "parameters": [ @@ -1617,9 +1383,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -1633,17 +1397,11 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { - "tags": [ - "SshPublicKeys" - ], + "tags": ["SshPublicKeys"], "operationId": "SshPublicKeys_Delete", "description": "Delete an SSH public key.", "parameters": [ @@ -1667,9 +1425,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -1683,17 +1439,11 @@ "description": "No Content" } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "get": { - "tags": [ - "SshPublicKeys" - ], + "tags": ["SshPublicKeys"], "operationId": "SshPublicKeys_Get", "description": "Retrieves information about an SSH public key.", "parameters": [ @@ -1717,9 +1467,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -1734,19 +1482,13 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}/generateKeyPair": { "post": { - "tags": [ - "SshPublicKeys" - ], + "tags": ["SshPublicKeys"], "operationId": "SshPublicKeys_GenerateKeyPair", "description": "Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource.", "parameters": [ @@ -1770,9 +1512,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -1787,19 +1527,13 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextensi@microsoft.azure/openapi-validator-core/{type}/versions/{version}": { "get": { - "tags": [ - "VirtualMachineExtensionImages" - ], + "tags": ["VirtualMachineExtensionImages"], "operationId": "VirtualMachineExtensionImages_Get", "description": "Gets a virtual machine extension image.", "parameters": [ @@ -1834,9 +1568,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -1850,19 +1582,13 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextensi@microsoft.azure/openapi-validator-core": { "get": { - "tags": [ - "VirtualMachineExtensionImages" - ], + "tags": ["VirtualMachineExtensionImages"], "operationId": "VirtualMachineExtensionImages_ListTypes", "description": "Gets a list of virtual machine extension image types.", "parameters": [ @@ -1885,9 +1611,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -1904,19 +1628,13 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextensi@microsoft.azure/openapi-validator-core/{type}/versions": { "get": { - "tags": [ - "VirtualMachineExtensionImages" - ], + "tags": ["VirtualMachineExtensionImages"], "operationId": "VirtualMachineExtensionImages_ListVersions", "description": "Gets a list of virtual machine extension image versions.", "parameters": [ @@ -1965,9 +1683,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -1985,19 +1701,13 @@ } }, "x-ms-odata": "#/definitions/VirtualMachineExtensionImage", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}": { "put": { - "tags": [ - "VirtualMachineExtensions" - ], + "tags": ["VirtualMachineExtensions"], "operationId": "VirtualMachineExtensions_CreateOrUpdate", "description": "The operation to create or update the extension.", "parameters": [ @@ -2037,9 +1747,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -2060,17 +1768,11 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "patch": { - "tags": [ - "VirtualMachineExtensions" - ], + "tags": ["VirtualMachineExtensions"], "operationId": "VirtualMachineExtensions_Update", "description": "The operation to update the extension.", "parameters": [ @@ -2110,9 +1812,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -2127,17 +1827,11 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { - "tags": [ - "VirtualMachineExtensions" - ], + "tags": ["VirtualMachineExtensions"], "operationId": "VirtualMachineExtensions_Delete", "description": "The operation to delete the extension.", "parameters": [ @@ -2168,9 +1862,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -2188,17 +1880,11 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "get": { - "tags": [ - "VirtualMachineExtensions" - ], + "tags": ["VirtualMachineExtensions"], "operationId": "VirtualMachineExtensions_Get", "description": "The operation to get the extension.", "parameters": [ @@ -2236,9 +1922,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -2252,19 +1936,13 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions": { "get": { - "tags": [ - "VirtualMachineExtensions" - ], + "tags": ["VirtualMachineExtensions"], "operationId": "VirtualMachineExtensions_List", "description": "The operation to get all extensions of a Virtual Machine.", "parameters": [ @@ -2295,9 +1973,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -2311,19 +1987,13 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}": { "get": { - "tags": [ - "VirtualMachineImages" - ], + "tags": ["VirtualMachineImages"], "operationId": "VirtualMachineImages_Get", "description": "Gets a virtual machine image.", "parameters": [ @@ -2368,9 +2038,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -2384,19 +2052,13 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions": { "get": { - "tags": [ - "VirtualMachineImages" - ], + "tags": ["VirtualMachineImages"], "operationId": "VirtualMachineImages_List", "description": "Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU.", "parameters": [ @@ -2454,9 +2116,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -2473,19 +2133,13 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers": { "get": { - "tags": [ - "VirtualMachineImages" - ], + "tags": ["VirtualMachineImages"], "operationId": "VirtualMachineImages_ListOffers", "description": "Gets a list of virtual machine image offers for the specified location and publisher.", "parameters": [ @@ -2509,9 +2163,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -2528,19 +2180,13 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers": { "get": { - "tags": [ - "VirtualMachineImages" - ], + "tags": ["VirtualMachineImages"], "operationId": "VirtualMachineImages_ListPublishers", "description": "Gets a list of virtual machine image publishers for the specified Azure location.", "parameters": [ @@ -2557,9 +2203,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -2576,19 +2220,13 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus": { "get": { - "tags": [ - "VirtualMachineImages" - ], + "tags": ["VirtualMachineImages"], "operationId": "VirtualMachineImages_ListSkus", "description": "Gets a list of virtual machine image SKUs for the specified location, publisher, and offer.", "parameters": [ @@ -2619,9 +2257,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -2638,19 +2274,13 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages": { "get": { - "tags": [ - "Usage" - ], + "tags": ["Usage"], "operationId": "Usage_List", "description": "Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription.", "parameters": [ @@ -2668,9 +2298,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -2687,19 +2315,13 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachines": { "get": { - "tags": [ - "VirtualMachines" - ], + "tags": ["VirtualMachines"], "operationId": "VirtualMachines_ListByLocation", "description": "Gets all the virtual machines under the specified subscription for the specified location.", "parameters": [ @@ -2717,9 +2339,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -2737,19 +2357,13 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes": { "get": { - "tags": [ - "VirtualMachineSizes" - ], + "tags": ["VirtualMachineSizes"], "operationId": "VirtualMachineSizes_List", "description": "This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list)", "parameters": [ @@ -2767,9 +2381,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -2786,19 +2398,13 @@ "x-ms-pageable": { "nextLinkName": null }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}": { "put": { - "tags": [ - "Images" - ], + "tags": ["Images"], "operationId": "Images_CreateOrUpdate", "description": "Create or update an image.", "parameters": [ @@ -2831,9 +2437,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -2855,17 +2459,11 @@ }, "x-ms-examples": null, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "patch": { - "tags": [ - "Images" - ], + "tags": ["Images"], "operationId": "Images_Update", "description": "Update an image.", "parameters": [ @@ -2898,9 +2496,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -2922,17 +2518,11 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { - "tags": [ - "Images" - ], + "tags": ["Images"], "operationId": "Images_Delete", "description": "Deletes an Image.", "parameters": [ @@ -2956,9 +2546,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -2976,17 +2564,11 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "get": { - "tags": [ - "Images" - ], + "tags": ["Images"], "operationId": "Images_Get", "description": "Gets an image.", "parameters": [ @@ -3017,9 +2599,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -3034,19 +2614,13 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images": { "get": { - "tags": [ - "Images" - ], + "tags": ["Images"], "operationId": "Images_ListByResourceGroup", "description": "Gets the list of images under a resource group.", "parameters": [ @@ -3063,9 +2637,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -3083,19 +2655,13 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/images": { "get": { - "tags": [ - "Images" - ], + "tags": ["Images"], "operationId": "Images_List", "description": "Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images.", "parameters": [ @@ -3105,9 +2671,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -3125,19 +2689,13 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture": { "post": { - "tags": [ - "VirtualMachines" - ], + "tags": ["VirtualMachines"], "operationId": "VirtualMachines_Capture", "description": "Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs.", "parameters": [ @@ -3170,9 +2728,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -3193,19 +2749,13 @@ "x-ms-long-running-operation-options": { "final-state-via": "location" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}": { "put": { - "tags": [ - "VirtualMachines" - ], + "tags": ["VirtualMachines"], "operationId": "VirtualMachines_CreateOrUpdate", "description": "The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation.", "parameters": [ @@ -3238,9 +2788,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -3262,17 +2810,11 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "patch": { - "tags": [ - "VirtualMachines" - ], + "tags": ["VirtualMachines"], "operationId": "VirtualMachines_Update", "description": "The operation to update a virtual machine.", "parameters": [ @@ -3305,9 +2847,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -3329,17 +2869,11 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { - "tags": [ - "VirtualMachines" - ], + "tags": ["VirtualMachines"], "operationId": "VirtualMachines_Delete", "description": "The operation to delete a virtual machine.", "parameters": [ @@ -3363,9 +2897,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -3383,17 +2915,11 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "get": { - "tags": [ - "VirtualMachines" - ], + "tags": ["VirtualMachines"], "operationId": "VirtualMachines_Get", "description": "Retrieves information about the model view or the instance view of a virtual machine.", "parameters": [ @@ -3417,9 +2943,7 @@ "required": false, "type": "string", "description": "The expand expression to apply on the operation.", - "enum": [ - "instanceView" - ], + "enum": ["instanceView"], "x-ms-enum": { "name": "InstanceViewTypes", "modelAsString": false @@ -3431,9 +2955,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -3448,19 +2970,13 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/instanceView": { "get": { - "tags": [ - "VirtualMachines" - ], + "tags": ["VirtualMachines"], "operationId": "VirtualMachines_InstanceView", "description": "Retrieves information about the run-time state of a virtual machine.", "parameters": [ @@ -3484,9 +3000,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -3501,19 +3015,13 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/convertToManagedDisks": { "post": { - "tags": [ - "VirtualMachines" - ], + "tags": ["VirtualMachines"], "operationId": "VirtualMachines_ConvertToManagedDisks", "description": "Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation.", "parameters": [ @@ -3537,9 +3045,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -3554,19 +3060,13 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate": { "post": { - "tags": [ - "VirtualMachines" - ], + "tags": ["VirtualMachines"], "operationId": "VirtualMachines_Deallocate", "description": "Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses.", "parameters": [ @@ -3590,9 +3090,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -3607,19 +3105,13 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/generalize": { "post": { - "tags": [ - "VirtualMachines" - ], + "tags": ["VirtualMachines"], "operationId": "VirtualMachines_Generalize", "description": "Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before performing this operation.
For Windows, please refer to [Create a managed image of a generalized VM in Azure](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/capture-image-resource).
For Linux, please refer to [How to create an image of a virtual machine or VHD](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/capture-image).", "parameters": [ @@ -3643,9 +3135,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -3657,19 +3147,13 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines": { "get": { - "tags": [ - "VirtualMachines" - ], + "tags": ["VirtualMachines"], "operationId": "VirtualMachines_ListAll", "description": "Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines.", "parameters": [ @@ -3679,9 +3163,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -3705,19 +3187,13 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/vmSizes": { "get": { - "tags": [ - "VirtualMachines" - ], + "tags": ["VirtualMachines"], "operationId": "VirtualMachines_ListAvailableSizes", "description": "Lists all available virtual machine sizes to which the specified virtual machine can be resized.", "parameters": [ @@ -3741,9 +3217,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -3761,19 +3235,13 @@ "nextLinkName": null }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff": { "post": { - "tags": [ - "VirtualMachines" - ], + "tags": ["VirtualMachines"], "operationId": "VirtualMachines_PowerOff", "description": "The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine.", "parameters": [ @@ -3805,9 +3273,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -3822,19 +3288,13 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/reapply": { "post": { - "tags": [ - "VirtualMachines" - ], + "tags": ["VirtualMachines"], "operationId": "VirtualMachines_Reapply", "description": "The operation to reapply a virtual machine's state.", "parameters": [ @@ -3858,9 +3318,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -3882,19 +3340,13 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/restart": { "post": { - "tags": [ - "VirtualMachines" - ], + "tags": ["VirtualMachines"], "operationId": "VirtualMachines_Restart", "description": "The operation to restart a virtual machine.", "parameters": [ @@ -3918,9 +3370,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -3935,19 +3385,13 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start": { "post": { - "tags": [ - "VirtualMachines" - ], + "tags": ["VirtualMachines"], "operationId": "VirtualMachines_Start", "description": "The operation to start a virtual machine.", "parameters": [ @@ -3971,9 +3415,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -3988,19 +3430,13 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/redeploy": { "post": { - "tags": [ - "VirtualMachines" - ], + "tags": ["VirtualMachines"], "operationId": "VirtualMachines_Redeploy", "description": "Shuts down the virtual machine, moves it to a new node, and powers it back on.", "parameters": [ @@ -4024,9 +3460,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -4041,19 +3475,13 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/reimage": { "post": { - "tags": [ - "VirtualMachines" - ], + "tags": ["VirtualMachines"], "operationId": "VirtualMachines_Reimage", "description": "Reimages the virtual machine which has an ephemeral OS disk back to its initial state.", "parameters": [ @@ -4086,9 +3514,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -4104,19 +3530,13 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/retrieveBootDiagnosticsData": { "post": { - "tags": [ - "VirtualMachines" - ], + "tags": ["VirtualMachines"], "operationId": "VirtualMachines_RetrieveBootDiagnosticsData", "description": "The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs.", "parameters": [ @@ -4148,9 +3568,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -4172,19 +3590,13 @@ }, "x-ms-long-running-operation": false, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/performMaintenance": { "post": { - "tags": [ - "VirtualMachines" - ], + "tags": ["VirtualMachines"], "operationId": "VirtualMachines_PerformMaintenance", "description": "The operation to perform maintenance on a virtual machine.", "parameters": [ @@ -4208,9 +3620,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -4225,19 +3635,13 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/simulateEviction": { "post": { - "tags": [ - "VirtualMachines" - ], + "tags": ["VirtualMachines"], "operationId": "VirtualMachines_SimulateEviction", "description": "The operation to simulate the eviction of spot virtual machine. The eviction will occur within 30 minutes of calling the API", "parameters": [ @@ -4261,9 +3665,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -4276,19 +3678,13 @@ }, "x-ms-long-running-operation": false, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/assessPatches": { "post": { - "tags": [ - "VirtualMachines" - ], + "tags": ["VirtualMachines"], "operationId": "VirtualMachines_AssessPatches", "x-ms-examples": null, "description": "Assess patches on the VM.", @@ -4313,9 +3709,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -4342,19 +3736,13 @@ "x-ms-long-running-operation-options": { "final-state-via": "location" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}": { "put": { - "tags": [ - "VirtualMachineScaleSets" - ], + "tags": ["VirtualMachineScaleSets"], "operationId": "VirtualMachineScaleSets_CreateOrUpdate", "description": "Create or update a VM scale set.", "parameters": [ @@ -4387,9 +3775,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -4411,17 +3797,11 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "patch": { - "tags": [ - "VirtualMachineScaleSets" - ], + "tags": ["VirtualMachineScaleSets"], "operationId": "VirtualMachineScaleSets_Update", "description": "Update a VM scale set.", "parameters": [ @@ -4454,9 +3834,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -4471,17 +3849,11 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { - "tags": [ - "VirtualMachineScaleSets" - ], + "tags": ["VirtualMachineScaleSets"], "operationId": "VirtualMachineScaleSets_Delete", "description": "Deletes a VM scale set.", "parameters": [ @@ -4505,9 +3877,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -4525,17 +3895,11 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "get": { - "tags": [ - "VirtualMachineScaleSets" - ], + "tags": ["VirtualMachineScaleSets"], "operationId": "VirtualMachineScaleSets_Get", "description": "Display information about a virtual machine scale set.", "parameters": [ @@ -4559,9 +3923,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -4576,19 +3938,13 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate": { "post": { - "tags": [ - "VirtualMachineScaleSets" - ], + "tags": ["VirtualMachineScaleSets"], "operationId": "VirtualMachineScaleSets_Deallocate", "description": "Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates.", "parameters": [ @@ -4621,9 +3977,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -4638,19 +3992,13 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete": { "post": { - "tags": [ - "VirtualMachineScaleSets" - ], + "tags": ["VirtualMachineScaleSets"], "operationId": "VirtualMachineScaleSets_DeleteInstances", "description": "Deletes virtual machines in a VM scale set.", "parameters": [ @@ -4683,9 +4031,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -4700,19 +4046,13 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/instanceView": { "get": { - "tags": [ - "VirtualMachineScaleSets" - ], + "tags": ["VirtualMachineScaleSets"], "operationId": "VirtualMachineScaleSets_GetInstanceView", "description": "Gets the status of a VM scale set instance.", "parameters": [ @@ -4736,9 +4076,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -4752,19 +4090,13 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets": { "get": { - "tags": [ - "VirtualMachineScaleSets" - ], + "tags": ["VirtualMachineScaleSets"], "operationId": "VirtualMachineScaleSets_List", "description": "Gets a list of all VM scale sets under a resource group.", "parameters": [ @@ -4781,9 +4113,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -4800,19 +4130,13 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}": { "put": { - "tags": [ - "VirtualMachineScaleSetExtensions" - ], + "tags": ["VirtualMachineScaleSetExtensions"], "operationId": "VirtualMachineScaleSetExtensions_CreateOrUpdate", "description": "The operation to create or update an extension.", "parameters": [ @@ -4852,9 +4176,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -4875,17 +4197,11 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "patch": { - "tags": [ - "VirtualMachineScaleSetExtensions" - ], + "tags": ["VirtualMachineScaleSetExtensions"], "operationId": "VirtualMachineScaleSetExtensions_Update", "description": "The operation to update an extension.", "parameters": [ @@ -4925,9 +4241,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -4948,17 +4262,11 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { - "tags": [ - "VirtualMachineScaleSetExtensions" - ], + "tags": ["VirtualMachineScaleSetExtensions"], "operationId": "VirtualMachineScaleSetExtensions_Delete", "description": "The operation to delete the extension.", "parameters": [ @@ -4989,9 +4297,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -5009,17 +4315,11 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "get": { - "tags": [ - "VirtualMachineScaleSetExtensions" - ], + "tags": ["VirtualMachineScaleSetExtensions"], "operationId": "VirtualMachineScaleSetExtensions_Get", "description": "The operation to get the extension.", "parameters": [ @@ -5057,9 +4357,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -5073,19 +4371,13 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions": { "get": { - "tags": [ - "VirtualMachineScaleSetExtensions" - ], + "tags": ["VirtualMachineScaleSetExtensions"], "operationId": "VirtualMachineScaleSetExtensions_List", "description": "Gets a list of all extensions in a VM scale set.", "parameters": [ @@ -5109,9 +4401,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -5128,19 +4418,13 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets": { "get": { - "tags": [ - "VirtualMachineScaleSets" - ], + "tags": ["VirtualMachineScaleSets"], "operationId": "VirtualMachineScaleSets_ListAll", "description": "Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets.", "parameters": [ @@ -5150,9 +4434,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -5169,19 +4451,13 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus": { "get": { - "tags": [ - "VirtualMachineScaleSets" - ], + "tags": ["VirtualMachineScaleSets"], "operationId": "VirtualMachineScaleSets_ListSkus", "description": "Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU.", "parameters": [ @@ -5205,9 +4481,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -5224,19 +4498,13 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osUpgradeHistory": { "get": { - "tags": [ - "VirtualMachineScaleSets" - ], + "tags": ["VirtualMachineScaleSets"], "operationId": "VirtualMachineScaleSets_GetOSUpgradeHistory", "description": "Gets list of OS upgrades on a VM scale set instance.", "parameters": [ @@ -5260,9 +4528,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -5279,19 +4545,13 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff": { "post": { - "tags": [ - "VirtualMachineScaleSets" - ], + "tags": ["VirtualMachineScaleSets"], "operationId": "VirtualMachineScaleSets_PowerOff", "description": "Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges.", "parameters": [ @@ -5332,9 +4592,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -5349,19 +4607,13 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart": { "post": { - "tags": [ - "VirtualMachineScaleSets" - ], + "tags": ["VirtualMachineScaleSets"], "operationId": "VirtualMachineScaleSets_Restart", "description": "Restarts one or more virtual machines in a VM scale set.", "parameters": [ @@ -5394,9 +4646,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -5411,19 +4661,13 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start": { "post": { - "tags": [ - "VirtualMachineScaleSets" - ], + "tags": ["VirtualMachineScaleSets"], "operationId": "VirtualMachineScaleSets_Start", "description": "Starts one or more virtual machines in a VM scale set.", "parameters": [ @@ -5456,9 +4700,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -5473,19 +4715,13 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/redeploy": { "post": { - "tags": [ - "VirtualMachineScaleSets" - ], + "tags": ["VirtualMachineScaleSets"], "operationId": "VirtualMachineScaleSets_Redeploy", "description": "Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on.", "parameters": [ @@ -5518,9 +4754,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -5535,19 +4769,13 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/performMaintenance": { "post": { - "tags": [ - "VirtualMachineScaleSets" - ], + "tags": ["VirtualMachineScaleSets"], "operationId": "VirtualMachineScaleSets_PerformMaintenance", "description": "Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications", "parameters": [ @@ -5580,9 +4808,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -5597,19 +4823,13 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade": { "post": { - "tags": [ - "VirtualMachineScaleSets" - ], + "tags": ["VirtualMachineScaleSets"], "operationId": "VirtualMachineScaleSets_UpdateInstances", "description": "Upgrades one or more virtual machines to the latest SKU set in the VM scale set model.", "parameters": [ @@ -5642,9 +4862,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -5659,19 +4877,13 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage": { "post": { - "tags": [ - "VirtualMachineScaleSets" - ], + "tags": ["VirtualMachineScaleSets"], "operationId": "VirtualMachineScaleSets_Reimage", "description": "Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state.", "parameters": [ @@ -5704,9 +4916,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -5721,19 +4931,13 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimageall": { "post": { - "tags": [ - "VirtualMachineScaleSets" - ], + "tags": ["VirtualMachineScaleSets"], "operationId": "VirtualMachineScaleSets_ReimageAll", "description": "Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks.", "parameters": [ @@ -5766,9 +4970,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -5783,19 +4985,13 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/cancel": { "post": { - "tags": [ - "VirtualMachineScaleSetRollingUpgrades" - ], + "tags": ["VirtualMachineScaleSetRollingUpgrades"], "operationId": "VirtualMachineScaleSetRollingUpgrades_Cancel", "description": "Cancels the current virtual machine scale set rolling upgrade.", "parameters": [ @@ -5819,9 +5015,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -5836,19 +5030,13 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osRollingUpgrade": { "post": { - "tags": [ - "VirtualMachineScaleSetRollingUpgrades" - ], + "tags": ["VirtualMachineScaleSetRollingUpgrades"], "operationId": "VirtualMachineScaleSetRollingUpgrades_StartOSUpgrade", "description": "Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected.", "parameters": [ @@ -5872,9 +5060,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -5889,19 +5075,13 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensionRollingUpgrade": { "post": { - "tags": [ - "VirtualMachineScaleSetRollingUpgrades" - ], + "tags": ["VirtualMachineScaleSetRollingUpgrades"], "operationId": "VirtualMachineScaleSetRollingUpgrades_StartExtensionUpgrade", "description": "Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest available extension version. Instances which are already running the latest extension versions are not affected.", "parameters": [ @@ -5925,9 +5105,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -5943,19 +5121,13 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/latest": { "get": { - "tags": [ - "VirtualMachineScaleSetRollingUpgrades" - ], + "tags": ["VirtualMachineScaleSetRollingUpgrades"], "operationId": "VirtualMachineScaleSetRollingUpgrades_GetLatest", "description": "Gets the status of the latest virtual machine scale set rolling upgrade.", "parameters": [ @@ -5979,9 +5151,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -5995,19 +5165,13 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/forceRecoveryServiceFabricPlatformUpdateDomainWalk": { "post": { - "tags": [ - "VirtualMachineScaleSets" - ], + "tags": ["VirtualMachineScaleSets"], "operationId": "VirtualMachineScaleSets_ForceRecoveryServiceFabricPlatformUpdateDomainWalk", "description": "Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set.", "parameters": [ @@ -6031,9 +5195,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -6054,19 +5216,13 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/convertToSinglePlacementGroup": { "post": { - "tags": [ - "VirtualMachineScaleSets" - ], + "tags": ["VirtualMachineScaleSets"], "operationId": "VirtualMachineScaleSets_ConvertToSinglePlacementGroup", "description": "Converts SinglePlacementGroup property to false for a existing virtual machine scale set.", "parameters": [ @@ -6099,9 +5255,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -6112,19 +5266,13 @@ "description": "OK" } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/setOrchestrationServiceState": { "post": { - "tags": [ - "VirtualMachineScaleSets" - ], + "tags": ["VirtualMachineScaleSets"], "operationId": "VirtualMachineScaleSets_SetOrchestrationServiceState", "description": "Changes ServiceState property for a given service", "parameters": [ @@ -6157,9 +5305,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -6174,19 +5320,13 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}": { "put": { - "tags": [ - "VirtualMachineScaleSetVMExtensions" - ], + "tags": ["VirtualMachineScaleSetVMExtensions"], "operationId": "VirtualMachineScaleSetVMExtensions_CreateOrUpdate", "description": "The operation to create or update the VMSS VM extension.", "parameters": [ @@ -6233,9 +5373,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -6263,17 +5401,11 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "patch": { - "tags": [ - "VirtualMachineScaleSetVMExtensions" - ], + "tags": ["VirtualMachineScaleSetVMExtensions"], "operationId": "VirtualMachineScaleSetVMExtensions_Update", "description": "The operation to update the VMSS VM extension.", "parameters": [ @@ -6320,9 +5452,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -6344,17 +5474,11 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { - "tags": [ - "VirtualMachineScaleSetVMExtensions" - ], + "tags": ["VirtualMachineScaleSetVMExtensions"], "operationId": "VirtualMachineScaleSetVMExtensions_Delete", "description": "The operation to delete the VMSS VM extension.", "parameters": [ @@ -6392,9 +5516,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -6419,17 +5541,11 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "get": { - "tags": [ - "VirtualMachineScaleSetVMExtensions" - ], + "tags": ["VirtualMachineScaleSetVMExtensions"], "operationId": "VirtualMachineScaleSetVMExtensions_Get", "description": "The operation to get the VMSS VM extension.", "parameters": [ @@ -6474,9 +5590,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -6497,19 +5611,13 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions": { "get": { - "tags": [ - "VirtualMachineScaleSetVMExtensions" - ], + "tags": ["VirtualMachineScaleSetVMExtensions"], "operationId": "VirtualMachineScaleSetVMExtensions_List", "description": "The operation to get all extensions of an instance in Virtual Machine Scaleset.", "parameters": [ @@ -6547,9 +5655,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -6570,19 +5676,13 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimage": { "post": { - "tags": [ - "VirtualMachineScaleSetVMs" - ], + "tags": ["VirtualMachineScaleSetVMs"], "operationId": "VirtualMachineScaleSetVMs_Reimage", "description": "Reimages (upgrade the operating system) a specific virtual machine in a VM scale set.", "parameters": [ @@ -6622,9 +5722,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -6639,19 +5737,13 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimageall": { "post": { - "tags": [ - "VirtualMachineScaleSetVMs" - ], + "tags": ["VirtualMachineScaleSetVMs"], "operationId": "VirtualMachineScaleSetVMs_ReimageAll", "description": "Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks.", "parameters": [ @@ -6682,9 +5774,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -6699,19 +5789,13 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate": { "post": { - "tags": [ - "VirtualMachineScaleSetVMs" - ], + "tags": ["VirtualMachineScaleSetVMs"], "operationId": "VirtualMachineScaleSetVMs_Deallocate", "description": "Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated.", "parameters": [ @@ -6742,9 +5826,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -6759,19 +5841,13 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}": { "put": { - "tags": [ - "VirtualMachineScaleSetVMs" - ], + "tags": ["VirtualMachineScaleSetVMs"], "operationId": "VirtualMachineScaleSetVMs_Update", "description": "Updates a virtual machine of a VM scale set.", "parameters": [ @@ -6811,9 +5887,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -6834,17 +5908,11 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { - "tags": [ - "VirtualMachineScaleSetVMs" - ], + "tags": ["VirtualMachineScaleSetVMs"], "operationId": "VirtualMachineScaleSetVMs_Delete", "description": "Deletes a virtual machine from a VM scale set.", "parameters": [ @@ -6875,9 +5943,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -6895,17 +5961,11 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "get": { - "tags": [ - "VirtualMachineScaleSetVMs" - ], + "tags": ["VirtualMachineScaleSetVMs"], "operationId": "VirtualMachineScaleSetVMs_Get", "description": "Gets a virtual machine from a VM scale set.", "parameters": [ @@ -6936,9 +5996,7 @@ "required": false, "type": "string", "description": "The expand expression to apply on the operation.", - "enum": [ - "instanceView" - ], + "enum": ["instanceView"], "x-ms-enum": { "name": "InstanceViewTypes", "modelAsString": false @@ -6950,9 +6008,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -6966,19 +6022,13 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/instanceView": { "get": { - "tags": [ - "VirtualMachineScaleSetVMs" - ], + "tags": ["VirtualMachineScaleSetVMs"], "operationId": "VirtualMachineScaleSetVMs_GetInstanceView", "description": "Gets the status of a virtual machine from a VM scale set.", "parameters": [ @@ -7009,9 +6059,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -7026,19 +6074,13 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines": { "get": { - "tags": [ - "VirtualMachineScaleSetVMs" - ], + "tags": ["VirtualMachineScaleSetVMs"], "operationId": "VirtualMachineScaleSetVMs_List", "description": "Gets a list of all virtual machines in a VM scale sets.", "parameters": [ @@ -7083,9 +6125,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -7103,19 +6143,13 @@ "nextLinkName": "nextLink" }, "x-ms-odata": "#/definitions/VirtualMachineScaleSetVM", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff": { "post": { - "tags": [ - "VirtualMachineScaleSetVMs" - ], + "tags": ["VirtualMachineScaleSetVMs"], "operationId": "VirtualMachineScaleSetVMs_PowerOff", "description": "Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges.", "parameters": [ @@ -7154,9 +6188,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -7171,19 +6203,13 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart": { "post": { - "tags": [ - "VirtualMachineScaleSetVMs" - ], + "tags": ["VirtualMachineScaleSetVMs"], "operationId": "VirtualMachineScaleSetVMs_Restart", "description": "Restarts a virtual machine in a VM scale set.", "parameters": [ @@ -7214,9 +6240,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -7231,19 +6255,13 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start": { "post": { - "tags": [ - "VirtualMachineScaleSetVMs" - ], + "tags": ["VirtualMachineScaleSetVMs"], "operationId": "VirtualMachineScaleSetVMs_Start", "description": "Starts a virtual machine in a VM scale set.", "parameters": [ @@ -7274,9 +6292,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -7291,19 +6307,13 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/redeploy": { "post": { - "tags": [ - "VirtualMachineScaleSetVMs" - ], + "tags": ["VirtualMachineScaleSetVMs"], "operationId": "VirtualMachineScaleSetVMs_Redeploy", "description": "Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on.", "parameters": [ @@ -7334,9 +6344,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -7351,19 +6359,13 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/retrieveBootDiagnosticsData": { "post": { - "tags": [ - "VirtualMachineScaleSetVMs" - ], + "tags": ["VirtualMachineScaleSetVMs"], "operationId": "VirtualMachineScaleSetVMs_RetrieveBootDiagnosticsData", "description": "The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set.", "parameters": [ @@ -7402,9 +6404,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -7426,19 +6426,13 @@ }, "x-ms-long-running-operation": false, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/performMaintenance": { "post": { - "tags": [ - "VirtualMachineScaleSetVMs" - ], + "tags": ["VirtualMachineScaleSetVMs"], "operationId": "VirtualMachineScaleSetVMs_PerformMaintenance", "description": "Performs maintenance on a virtual machine in a VM scale set.", "parameters": [ @@ -7469,9 +6463,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -7486,19 +6478,13 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/simulateEviction": { "post": { - "tags": [ - "VirtualMachineScaleSetVMs" - ], + "tags": ["VirtualMachineScaleSetVMs"], "operationId": "VirtualMachineScaleSetVMs_SimulateEviction", "description": "The operation to simulate the eviction of spot virtual machine in a VM scale set. The eviction will occur within 30 minutes of calling the API", "parameters": [ @@ -7529,9 +6515,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -7544,19 +6528,13 @@ }, "x-ms-long-running-operation": false, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getRequestRateByInterval": { "post": { - "tags": [ - "LogAnalytics" - ], + "tags": ["LogAnalytics"], "operationId": "LogAnalytics_ExportRequestRateByInterval", "x-ms-examples": null, "description": "Export logs that show Api requests made by this subscription in the given time window to show throttling activities.", @@ -7584,9 +6562,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -7607,19 +6583,13 @@ "x-ms-long-running-operation-options": { "final-state-via": "azure-async-operation" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getThrottledRequests": { "post": { - "tags": [ - "LogAnalytics" - ], + "tags": ["LogAnalytics"], "operationId": "LogAnalytics_ExportThrottledRequests", "x-ms-examples": null, "description": "Export logs that show total throttled Api requests for this subscription in the given time window.", @@ -7647,9 +6617,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -7670,19 +6638,13 @@ "x-ms-long-running-operation-options": { "final-state-via": "azure-async-operation" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands": { "get": { - "tags": [ - "VirtualMachineRunCommands" - ], + "tags": ["VirtualMachineRunCommands"], "operationId": "VirtualMachineRunCommands_List", "x-ms-examples": null, "description": "Lists all available run commands for a subscription in a location.", @@ -7701,9 +6663,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -7720,21 +6680,13 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json", - "text/json" - ], - "consumes": [ - "application/json", - "text/json" - ] + "produces": ["application/json", "text/json"], + "consumes": ["application/json", "text/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands/{commandId}": { "get": { - "tags": [ - "VirtualMachineRunCommands" - ], + "tags": ["VirtualMachineRunCommands"], "operationId": "VirtualMachineRunCommands_Get", "x-ms-examples": null, "description": "Gets specific run command for a subscription in a location.", @@ -7760,9 +6712,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -7776,21 +6726,13 @@ } } }, - "produces": [ - "application/json", - "text/json" - ], - "consumes": [ - "application/json", - "text/json" - ] + "produces": ["application/json", "text/json"], + "consumes": ["application/json", "text/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommand": { "post": { - "tags": [ - "VirtualMachines" - ], + "tags": ["VirtualMachines"], "operationId": "VirtualMachines_RunCommand", "x-ms-examples": null, "description": "Run command on the VM.", @@ -7824,9 +6766,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -7847,21 +6787,13 @@ "x-ms-long-running-operation-options": { "final-state-via": "location" }, - "produces": [ - "application/json", - "text/json" - ], - "consumes": [ - "application/json", - "text/json" - ] + "produces": ["application/json", "text/json"], + "consumes": ["application/json", "text/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/runCommand": { "post": { - "tags": [ - "VirtualMachineScaleSetVMs" - ], + "tags": ["VirtualMachineScaleSetVMs"], "operationId": "VirtualMachineScaleSetVMs_RunCommand", "x-ms-examples": null, "description": "Run command on a virtual machine in a VM scale set.", @@ -7902,9 +6834,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -7925,22 +6855,13 @@ "x-ms-long-running-operation-options": { "final-state-via": "location" }, - "produces": [ - "application/json", - "text/json" - ], - "consumes": [ - "application/json", - "text/json" - ] + "produces": ["application/json", "text/json"], + "consumes": ["application/json", "text/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/skus": { "get": { - "tags": [ - "Skus", - "AvailabilitySets" - ], + "tags": ["Skus", "AvailabilitySets"], "operationId": "ResourceSkus_List", "description": "Gets the list of Microsoft.Compute SKUs available for your Subscription.", "parameters": [ @@ -7950,9 +6871,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2019-04-01" - ] + "enum": ["2019-04-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -7977,19 +6896,13 @@ "nextLinkName": "nextLink" }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}": { "put": { - "tags": [ - "Disks" - ], + "tags": ["Disks"], "operationId": "Disks_CreateOrUpdate", "description": "Creates or updates a disk.", "parameters": [ @@ -8008,9 +6921,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-05-01" - ] + "enum": ["2020-05-01"] }, { "name": "disk", @@ -8038,17 +6949,11 @@ }, "x-ms-examples": null, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "patch": { - "tags": [ - "Disks" - ], + "tags": ["Disks"], "operationId": "Disks_Update", "description": "Updates (patches) a disk.", "parameters": [ @@ -8067,9 +6972,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-05-01" - ] + "enum": ["2020-05-01"] }, { "name": "disk", @@ -8097,17 +7000,11 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "get": { - "tags": [ - "Disks" - ], + "tags": ["Disks"], "operationId": "Disks_Get", "description": "Gets information about a disk.", "parameters": [ @@ -8126,9 +7023,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-05-01" - ] + "enum": ["2020-05-01"] } ], "responses": { @@ -8140,17 +7035,11 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { - "tags": [ - "Disks" - ], + "tags": ["Disks"], "operationId": "Disks_Delete", "description": "Deletes a disk.", "parameters": [ @@ -8169,9 +7058,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-05-01" - ] + "enum": ["2020-05-01"] } ], "responses": { @@ -8186,19 +7073,13 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks": { "get": { - "tags": [ - "Disks" - ], + "tags": ["Disks"], "operationId": "Disks_ListByResourceGroup", "description": "Lists all the disks under a resource group.", "parameters": [ @@ -8214,9 +7095,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-05-01" - ] + "enum": ["2020-05-01"] } ], "responses": { @@ -8231,19 +7110,13 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess": { "post": { - "tags": [ - "Disks" - ], + "tags": ["Disks"], "operationId": "Disks_GrantAccess", "description": "Grants access to a disk.", "parameters": [ @@ -8262,9 +7135,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-05-01" - ] + "enum": ["2020-05-01"] }, { "name": "grantAccessData", @@ -8291,19 +7162,13 @@ "x-ms-long-running-operation-options": { "final-state-via": "location" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess": { "post": { - "tags": [ - "Disks" - ], + "tags": ["Disks"], "operationId": "Disks_RevokeAccess", "description": "Revokes access to a disk.", "parameters": [ @@ -8322,9 +7187,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-05-01" - ] + "enum": ["2020-05-01"] } ], "responses": { @@ -8339,19 +7202,13 @@ "x-ms-long-running-operation-options": { "final-state-via": "location" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}": { "put": { - "tags": [ - "Snapshots" - ], + "tags": ["Snapshots"], "operationId": "Snapshots_CreateOrUpdate", "description": "Creates or updates a snapshot.", "parameters": [ @@ -8370,9 +7227,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-05-01" - ] + "enum": ["2020-05-01"] }, { "name": "snapshot", @@ -8400,17 +7255,11 @@ }, "x-ms-examples": null, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "patch": { - "tags": [ - "Snapshots" - ], + "tags": ["Snapshots"], "operationId": "Snapshots_Update", "description": "Updates (patches) a snapshot.", "parameters": [ @@ -8429,9 +7278,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-05-01" - ] + "enum": ["2020-05-01"] }, { "name": "snapshot", @@ -8458,17 +7305,11 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "get": { - "tags": [ - "Snapshots" - ], + "tags": ["Snapshots"], "operationId": "Snapshots_Get", "description": "Gets information about a snapshot.", "parameters": [ @@ -8487,9 +7328,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-05-01" - ] + "enum": ["2020-05-01"] } ], "responses": { @@ -8501,17 +7340,11 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { - "tags": [ - "Snapshots" - ], + "tags": ["Snapshots"], "operationId": "Snapshots_Delete", "description": "Deletes a snapshot.", "parameters": [ @@ -8530,9 +7363,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-05-01" - ] + "enum": ["2020-05-01"] } ], "responses": { @@ -8547,19 +7378,13 @@ } }, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots": { "get": { - "tags": [ - "Snapshots" - ], + "tags": ["Snapshots"], "operationId": "Snapshots_ListByResourceGroup", "description": "Lists snapshots under a resource group.", "parameters": [ @@ -8575,9 +7400,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-05-01" - ] + "enum": ["2020-05-01"] } ], "responses": { @@ -8592,19 +7415,13 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/snapshots": { "get": { - "tags": [ - "Snapshots" - ], + "tags": ["Snapshots"], "operationId": "Snapshots_List", "description": "Lists snapshots under a subscription.", "parameters": [ @@ -8617,9 +7434,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-05-01" - ] + "enum": ["2020-05-01"] } ], "responses": { @@ -8634,19 +7449,13 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess": { "post": { - "tags": [ - "Snapshots" - ], + "tags": ["Snapshots"], "operationId": "Snapshots_GrantAccess", "description": "Grants access to a snapshot.", "parameters": [ @@ -8665,9 +7474,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-05-01" - ] + "enum": ["2020-05-01"] }, { "name": "grantAccessData", @@ -8694,19 +7501,13 @@ "x-ms-long-running-operation-options": { "final-state-via": "location" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess": { "post": { - "tags": [ - "Snapshots" - ], + "tags": ["Snapshots"], "operationId": "Snapshots_RevokeAccess", "description": "Revokes access to a snapshot.", "parameters": [ @@ -8725,9 +7526,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-05-01" - ] + "enum": ["2020-05-01"] } ], "responses": { @@ -8742,19 +7541,13 @@ "x-ms-long-running-operation-options": { "final-state-via": "location" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}": { "put": { - "tags": [ - "DiskEncryptionSets" - ], + "tags": ["DiskEncryptionSets"], "operationId": "DiskEncryptionSets_CreateOrUpdate", "description": "Creates or updates a disk encryption set", "parameters": [ @@ -8773,9 +7566,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-05-01" - ] + "enum": ["2020-05-01"] }, { "name": "diskEncryptionSet", @@ -8809,17 +7600,11 @@ }, "x-ms-examples": null, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "patch": { - "tags": [ - "DiskEncryptionSets" - ], + "tags": ["DiskEncryptionSets"], "operationId": "DiskEncryptionSets_Update", "description": "Updates (patches) a disk encryption set.", "parameters": [ @@ -8838,9 +7623,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-05-01" - ] + "enum": ["2020-05-01"] }, { "name": "diskEncryptionSet", @@ -8874,17 +7657,11 @@ }, "x-ms-examples": null, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "get": { - "tags": [ - "DiskEncryptionSets" - ], + "tags": ["DiskEncryptionSets"], "operationId": "DiskEncryptionSets_Get", "description": "Gets information about a disk encryption set.", "parameters": [ @@ -8903,9 +7680,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-05-01" - ] + "enum": ["2020-05-01"] } ], "responses": { @@ -8923,17 +7698,11 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { - "tags": [ - "DiskEncryptionSets" - ], + "tags": ["DiskEncryptionSets"], "operationId": "DiskEncryptionSets_Delete", "description": "Deletes a disk encryption set.", "parameters": [ @@ -8952,9 +7721,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-05-01" - ] + "enum": ["2020-05-01"] } ], "responses": { @@ -8976,19 +7743,13 @@ }, "x-ms-examples": null, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets": { "get": { - "tags": [ - "DiskEncryptionSets" - ], + "tags": ["DiskEncryptionSets"], "operationId": "DiskEncryptionSets_ListByResourceGroup", "description": "Lists all the disk encryption sets under a resource group.", "parameters": [ @@ -9004,9 +7765,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-05-01" - ] + "enum": ["2020-05-01"] } ], "responses": { @@ -9027,19 +7786,13 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskEncryptionSets": { "get": { - "tags": [ - "DiskEncryptionSets" - ], + "tags": ["DiskEncryptionSets"], "operationId": "DiskEncryptionSets_List", "description": "Lists all the disk encryption sets under a subscription.", "parameters": [ @@ -9052,9 +7805,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-05-01" - ] + "enum": ["2020-05-01"] } ], "responses": { @@ -9075,19 +7826,13 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}": { "put": { - "tags": [ - "DiskAccesses" - ], + "tags": ["DiskAccesses"], "operationId": "DiskAccesses_CreateOrUpdate", "description": "Creates or updates a disk access resource", "parameters": [ @@ -9106,9 +7851,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-05-01" - ] + "enum": ["2020-05-01"] }, { "name": "diskAccess", @@ -9142,17 +7885,11 @@ }, "x-ms-examples": null, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "patch": { - "tags": [ - "DiskAccesses" - ], + "tags": ["DiskAccesses"], "operationId": "DiskAccesses_Update", "description": "Updates (patches) a disk access resource.", "parameters": [ @@ -9171,9 +7908,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-05-01" - ] + "enum": ["2020-05-01"] }, { "name": "diskAccess", @@ -9207,17 +7942,11 @@ }, "x-ms-examples": null, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "get": { - "tags": [ - "DiskAccesses" - ], + "tags": ["DiskAccesses"], "operationId": "DiskAccesses_Get", "description": "Gets information about a disk access resource.", "parameters": [ @@ -9236,9 +7965,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-05-01" - ] + "enum": ["2020-05-01"] } ], "responses": { @@ -9256,17 +7983,11 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { - "tags": [ - "DiskAccesses" - ], + "tags": ["DiskAccesses"], "operationId": "DiskAccesses_Delete", "description": "Deletes a disk access resource.", "parameters": [ @@ -9285,9 +8006,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-05-01" - ] + "enum": ["2020-05-01"] } ], "responses": { @@ -9309,19 +8028,13 @@ }, "x-ms-examples": null, "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses": { "get": { - "tags": [ - "DiskAccesses" - ], + "tags": ["DiskAccesses"], "operationId": "DiskAccesses_ListByResourceGroup", "description": "Lists all the disk access resources under a resource group.", "parameters": [ @@ -9337,9 +8050,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-05-01" - ] + "enum": ["2020-05-01"] } ], "responses": { @@ -9360,19 +8071,13 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskAccesses": { "get": { - "tags": [ - "DiskAccesses" - ], + "tags": ["DiskAccesses"], "operationId": "DiskAccesses_List", "description": "Lists all the disk access resources under a subscription.", "parameters": [ @@ -9385,9 +8090,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-05-01" - ] + "enum": ["2020-05-01"] } ], "responses": { @@ -9408,19 +8111,13 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateLinkResources": { "get": { - "tags": [ - "DiskAccesses" - ], + "tags": ["DiskAccesses"], "operationId": "DiskAccesses_GetPrivateLinkResources", "description": "Gets the private link resources possible under disk access resource", "parameters": [ @@ -9439,9 +8136,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2020-05-01" - ] + "enum": ["2020-05-01"] } ], "responses": { @@ -9453,19 +8148,13 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}": { "put": { - "tags": [ - "Galleries" - ], + "tags": ["Galleries"], "operationId": "Galleries_CreateOrUpdate", "description": "Create or update a Shared Image Gallery.", "parameters": [ @@ -9488,9 +8177,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2019-12-01" - ] + "enum": ["2019-12-01"] }, { "name": "gallery", @@ -9530,17 +8217,11 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "patch": { - "tags": [ - "Galleries" - ], + "tags": ["Galleries"], "operationId": "Galleries_Update", "description": "Update a Shared Image Gallery.", "parameters": [ @@ -9563,9 +8244,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2019-12-01" - ] + "enum": ["2019-12-01"] }, { "name": "gallery", @@ -9593,17 +8272,11 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "get": { - "tags": [ - "Galleries" - ], + "tags": ["Galleries"], "operationId": "Galleries_Get", "description": "Retrieves information about a Shared Image Gallery.", "parameters": [ @@ -9626,9 +8299,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2019-12-01" - ] + "enum": ["2019-12-01"] } ], "responses": { @@ -9646,17 +8317,11 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { - "tags": [ - "Galleries" - ], + "tags": ["Galleries"], "operationId": "Galleries_Delete", "description": "Delete a Shared Image Gallery.", "parameters": [ @@ -9679,9 +8344,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2019-12-01" - ] + "enum": ["2019-12-01"] } ], "responses": { @@ -9703,19 +8366,13 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}": { "put": { - "tags": [ - "GalleryImages" - ], + "tags": ["GalleryImages"], "operationId": "GalleryImages_CreateOrUpdate", "description": "Create or update a gallery Image Definition.", "parameters": [ @@ -9745,9 +8402,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2019-12-01" - ] + "enum": ["2019-12-01"] }, { "name": "galleryImage", @@ -9787,17 +8442,11 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "patch": { - "tags": [ - "GalleryImages" - ], + "tags": ["GalleryImages"], "operationId": "GalleryImages_Update", "description": "Update a gallery Image Definition.", "parameters": [ @@ -9827,9 +8476,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2019-12-01" - ] + "enum": ["2019-12-01"] }, { "name": "galleryImage", @@ -9857,17 +8504,11 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "get": { - "tags": [ - "GalleryImages" - ], + "tags": ["GalleryImages"], "operationId": "GalleryImages_Get", "description": "Retrieves information about a gallery Image Definition.", "parameters": [ @@ -9897,9 +8538,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2019-12-01" - ] + "enum": ["2019-12-01"] } ], "responses": { @@ -9917,17 +8556,11 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { - "tags": [ - "GalleryImages" - ], + "tags": ["GalleryImages"], "operationId": "GalleryImages_Delete", "description": "Delete a gallery image.", "parameters": [ @@ -9957,9 +8590,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2019-12-01" - ] + "enum": ["2019-12-01"] } ], "responses": { @@ -9981,19 +8612,13 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}": { "put": { - "tags": [ - "GalleryImageVersions" - ], + "tags": ["GalleryImageVersions"], "operationId": "GalleryImageVersions_CreateOrUpdate", "description": "Create or update a gallery Image Version.", "parameters": [ @@ -10030,9 +8655,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2019-12-01" - ] + "enum": ["2019-12-01"] }, { "name": "galleryImageVersion", @@ -10072,17 +8695,11 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "patch": { - "tags": [ - "GalleryImageVersions" - ], + "tags": ["GalleryImageVersions"], "operationId": "GalleryImageVersions_Update", "description": "Update a gallery Image Version.", "parameters": [ @@ -10119,9 +8736,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2019-12-01" - ] + "enum": ["2019-12-01"] }, { "name": "galleryImageVersion", @@ -10149,17 +8764,11 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "get": { - "tags": [ - "GalleryImageVersions" - ], + "tags": ["GalleryImageVersions"], "operationId": "GalleryImageVersions_Get", "description": "Retrieves information about a gallery Image Version.", "parameters": [ @@ -10196,9 +8805,7 @@ "required": false, "type": "string", "description": "The expand expression to apply on the operation.", - "enum": [ - "ReplicationStatus" - ], + "enum": ["ReplicationStatus"], "x-ms-enum": { "name": "ReplicationStatusTypes", "modelAsString": true @@ -10210,9 +8817,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2019-12-01" - ] + "enum": ["2019-12-01"] } ], "responses": { @@ -10230,17 +8835,11 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { - "tags": [ - "GalleryImageVersions" - ], + "tags": ["GalleryImageVersions"], "operationId": "GalleryImageVersions_Delete", "description": "Delete a gallery Image Version.", "parameters": [ @@ -10277,9 +8876,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2019-12-01" - ] + "enum": ["2019-12-01"] } ], "responses": { @@ -10301,19 +8898,13 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}": { "put": { - "tags": [ - "GalleryApplications" - ], + "tags": ["GalleryApplications"], "operationId": "GalleryApplications_CreateOrUpdate", "description": "Create or update a gallery Application Definition.", "parameters": [ @@ -10343,9 +8934,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2019-12-01" - ] + "enum": ["2019-12-01"] }, { "name": "galleryApplication", @@ -10385,17 +8974,11 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "patch": { - "tags": [ - "GalleryApplications" - ], + "tags": ["GalleryApplications"], "operationId": "GalleryApplications_Update", "description": "Update a gallery Application Definition.", "parameters": [ @@ -10425,9 +9008,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2019-12-01" - ] + "enum": ["2019-12-01"] }, { "name": "galleryApplication", @@ -10455,17 +9036,11 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "get": { - "tags": [ - "GalleryApplications" - ], + "tags": ["GalleryApplications"], "operationId": "GalleryApplications_Get", "description": "Retrieves information about a gallery Application Definition.", "parameters": [ @@ -10495,9 +9070,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2019-12-01" - ] + "enum": ["2019-12-01"] } ], "responses": { @@ -10515,17 +9088,11 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { - "tags": [ - "GalleryApplications" - ], + "tags": ["GalleryApplications"], "operationId": "GalleryApplications_Delete", "description": "Delete a gallery Application.", "parameters": [ @@ -10555,9 +9122,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2019-12-01" - ] + "enum": ["2019-12-01"] } ], "responses": { @@ -10579,19 +9144,13 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}": { "put": { - "tags": [ - "GalleryApplicationVersions" - ], + "tags": ["GalleryApplicationVersions"], "operationId": "GalleryApplicationVersions_CreateOrUpdate", "description": "Create or update a gallery Application Version.", "parameters": [ @@ -10628,9 +9187,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2019-12-01" - ] + "enum": ["2019-12-01"] }, { "name": "galleryApplicationVersion", @@ -10670,17 +9227,11 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "patch": { - "tags": [ - "GalleryApplicationVersions" - ], + "tags": ["GalleryApplicationVersions"], "operationId": "GalleryApplicationVersions_Update", "description": "Update a gallery Application Version.", "parameters": [ @@ -10717,9 +9268,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2019-12-01" - ] + "enum": ["2019-12-01"] }, { "name": "galleryApplicationVersion", @@ -10747,17 +9296,11 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "get": { - "tags": [ - "GalleryApplicationVersions" - ], + "tags": ["GalleryApplicationVersions"], "operationId": "GalleryApplicationVersions_Get", "description": "Retrieves information about a gallery Application Version.", "parameters": [ @@ -10794,9 +9337,7 @@ "required": false, "type": "string", "description": "The expand expression to apply on the operation.", - "enum": [ - "ReplicationStatus" - ], + "enum": ["ReplicationStatus"], "x-ms-enum": { "name": "ReplicationStatusTypes", "modelAsString": true @@ -10808,9 +9349,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2019-12-01" - ] + "enum": ["2019-12-01"] } ], "responses": { @@ -10828,17 +9367,11 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { - "tags": [ - "GalleryApplicationVersions" - ], + "tags": ["GalleryApplicationVersions"], "operationId": "GalleryApplicationVersions_Delete", "description": "Delete a gallery Application Version.", "parameters": [ @@ -10875,9 +9408,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2019-12-01" - ] + "enum": ["2019-12-01"] } ], "responses": { @@ -10899,19 +9430,13 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries": { "get": { - "tags": [ - "Galleries" - ], + "tags": ["Galleries"], "operationId": "Galleries_ListByResourceGroup", "description": "List galleries under a resource group.", "parameters": [ @@ -10927,9 +9452,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2019-12-01" - ] + "enum": ["2019-12-01"] } ], "responses": { @@ -10950,19 +9473,13 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/galleries": { "get": { - "tags": [ - "Galleries" - ], + "tags": ["Galleries"], "operationId": "Galleries_List", "description": "List galleries under a subscription.", "parameters": [ @@ -10975,9 +9492,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2019-12-01" - ] + "enum": ["2019-12-01"] } ], "responses": { @@ -10998,19 +9513,13 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images": { "get": { - "tags": [ - "GalleryImages" - ], + "tags": ["GalleryImages"], "operationId": "GalleryImages_ListByGallery", "description": "List gallery Image Definitions in a gallery.", "parameters": [ @@ -11033,9 +9542,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2019-12-01" - ] + "enum": ["2019-12-01"] } ], "responses": { @@ -11056,19 +9563,13 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions": { "get": { - "tags": [ - "GalleryImageVersions" - ], + "tags": ["GalleryImageVersions"], "operationId": "GalleryImageVersions_ListByGalleryImage", "description": "List gallery Image Versions in a gallery Image Definition.", "parameters": [ @@ -11098,9 +9599,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2019-12-01" - ] + "enum": ["2019-12-01"] } ], "responses": { @@ -11121,19 +9620,13 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions": { "get": { - "tags": [ - "GalleryApplicationVersions" - ], + "tags": ["GalleryApplicationVersions"], "operationId": "GalleryApplicationVersions_ListByGalleryApplication", "description": "List gallery Application Versions in a gallery Application Definition.", "parameters": [ @@ -11163,9 +9656,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2019-12-01" - ] + "enum": ["2019-12-01"] } ], "responses": { @@ -11186,19 +9677,13 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/containerServices": { "get": { - "tags": [ - "ContainerServices" - ], + "tags": ["ContainerServices"], "operationId": "ContainerServices_List", "summary": "Gets a list of container services in the specified subscription.", "description": "Gets a list of container services in the specified subscription. The operation returns properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents.", @@ -11209,9 +9694,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2017-01-31" - ] + "enum": ["2017-01-31"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -11229,19 +9712,13 @@ "nextLinkName": "nextLink" }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}": { "put": { - "tags": [ - "ContainerServices" - ], + "tags": ["ContainerServices"], "operationId": "ContainerServices_CreateOrUpdate", "summary": "Creates or updates a container service.", "description": "Creates or updates a container service with the specified configuration of orchestrator, masters, and agents.", @@ -11275,9 +9752,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2017-01-31" - ] + "enum": ["2017-01-31"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -11305,17 +9780,11 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "get": { - "tags": [ - "ContainerService" - ], + "tags": ["ContainerService"], "operationId": "ContainerServices_Get", "summary": "Gets the properties of the specified container service.", "description": "Gets the properties of the specified container service in the specified subscription and resource group. The operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. ", @@ -11340,9 +9809,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2017-01-31" - ] + "enum": ["2017-01-31"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -11357,17 +9824,11 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { - "tags": [ - "ContainerService" - ], + "tags": ["ContainerService"], "operationId": "ContainerServices_Delete", "summary": "Deletes the specified container service.", "description": "Deletes the specified container service in the specified subscription and resource group. The operation does not delete other resources created as part of creating a container service, including storage accounts, VMs, and availability sets. All the other resources created with the container service are part of the same resource group and can be deleted individually.", @@ -11392,9 +9853,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2017-01-31" - ] + "enum": ["2017-01-31"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -11410,19 +9869,13 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices": { "get": { - "tags": [ - "ContainerService" - ], + "tags": ["ContainerService"], "operationId": "ContainerServices_ListByResourceGroup", "summary": "Gets a list of container services in the specified resource group.", "description": "Gets a list of container services in the specified subscription and resource group. The operation returns properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents.", @@ -11440,9 +9893,7 @@ "required": true, "type": "string", "description": "Client Api Version.", - "enum": [ - "2017-01-31" - ] + "enum": ["2017-01-31"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -11460,12 +9911,8 @@ "nextLinkName": "nextLink" }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } } }, @@ -11532,10 +9979,7 @@ "vmDiskType": { "type": "string", "description": "VM disk types which are disallowed.", - "enum": [ - "None", - "Unmanaged" - ], + "enum": ["None", "Unmanaged"], "x-ms-enum": { "name": "VmDiskTypes", "modelAsString": true @@ -11562,10 +10006,7 @@ "HyperVGenerationType": { "type": "string", "description": "Specifies the HyperVGeneration Type", - "enum": [ - "V1", - "V2" - ], + "enum": ["V1", "V2"], "x-ms-enum": { "name": "HyperVGenerationTypes", "modelAsString": true @@ -11580,11 +10021,7 @@ "level": { "type": "string", "description": "The level code.", - "enum": [ - "Info", - "Warning", - "Error" - ], + "enum": ["Info", "Warning", "Error"], "x-ms-enum": { "name": "StatusLevelTypes", "modelAsString": false @@ -11643,10 +10080,7 @@ "AvailabilitySetSkuType": { "type": "string", "description": "Specifies the sku of an Availability Set. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'.", - "enum": [ - "Classic", - "Aligned" - ], + "enum": ["Classic", "Aligned"], "x-ms-enum": { "name": "AvailabilitySetSkuTypes", "modelAsString": true @@ -11702,9 +10136,7 @@ "description": "The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to fetch the next page of AvailabilitySets." } }, - "required": [ - "value" - ], + "required": ["value"], "description": "The List Availability Set operation response." }, "SubResourceWithColocationStatus": { @@ -11725,10 +10157,7 @@ "proximityPlacementGroupType": { "type": "string", "description": "Specifies the type of the proximity placement group.

Possible values are:

**Standard** : Co-locate resources within an Azure region or Availability Zone.

**Ultra** : For future use.", - "enum": [ - "Standard", - "Ultra" - ], + "enum": ["Standard", "Ultra"], "x-ms-enum": { "name": "ProximityPlacementGroupType", "modelAsString": true @@ -11802,9 +10231,7 @@ "description": "The URI to fetch the next page of proximity placement groups." } }, - "required": [ - "value" - ], + "required": ["value"], "description": "The List Proximity Placement Group operation response." }, "DedicatedHostGroupInstanceView": { @@ -11845,9 +10272,7 @@ "description": "Specifies whether virtual machines or virtual machine scale sets can be placed automatically on the dedicated host group. Automatic placement means resources are allocated on dedicated hosts, that are chosen by Azure, under the dedicated host group. The value is defaulted to 'true' when not provided.

Minimum api-version: 2020-06-01." } }, - "required": [ - "platformFaultDomainCount" - ], + "required": ["platformFaultDomainCount"], "description": "Dedicated Host Group Properties." }, "DedicatedHostGroup": { @@ -11906,19 +10331,13 @@ "description": "The URI to fetch the next page of Dedicated Host Groups. Call ListNext() with this URI to fetch the next page of Dedicated Host Groups." } }, - "required": [ - "value" - ], + "required": ["value"], "description": "The List Dedicated Host Group with resource group response." }, "DedicatedHostLicenseType": { "type": "string", "description": "Specifies the software license type that will be applied to the VMs deployed on the dedicated host.

Possible values are:

**None**

**Windows_Server_Hybrid**

**Windows_Server_Perpetual**

Default: **None**", - "enum": [ - "None", - "Windows_Server_Hybrid", - "Windows_Server_Perpetual" - ], + "enum": ["None", "Windows_Server_Hybrid", "Windows_Server_Perpetual"], "x-ms-enum": { "name": "DedicatedHostLicenseTypes", "modelAsString": false @@ -12051,9 +10470,7 @@ "$ref": "#/definitions/Resource" } ], - "required": [ - "sku" - ], + "required": ["sku"], "description": "Specifies information about the Dedicated host." }, "DedicatedHostUpdate": { @@ -12084,9 +10501,7 @@ "description": "The URI to fetch the next page of dedicated hosts. Call ListNext() with this URI to fetch the next page of dedicated hosts." } }, - "required": [ - "value" - ], + "required": ["value"], "description": "The list dedicated host operation response." }, "SshPublicKeyGenerateKeyPairResult": { @@ -12104,11 +10519,7 @@ "description": "The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{SshPublicKeyName}" } }, - "required": [ - "privateKey", - "publicKey", - "id" - ], + "required": ["privateKey", "publicKey", "id"], "description": "Response from generation of an SSH key pair." }, "SshPublicKeyResourceProperties": { @@ -12164,9 +10575,7 @@ "description": "The URI to fetch the next page of SSH public keys. Call ListNext() with this URI to fetch the next page of SSH public keys." } }, - "required": [ - "value" - ], + "required": ["value"], "description": "The list SSH public keys operation response." }, "VirtualMachineSize": { @@ -12238,11 +10647,7 @@ "description": "Whether the handler can support multiple extensions." } }, - "required": [ - "operatingSystem", - "computeRole", - "handlerSchema" - ], + "required": ["operatingSystem", "computeRole", "handlerSchema"], "description": "Describes the properties of a Virtual Machine Extension Image." }, "VirtualMachineExtensionImage": { @@ -12252,10 +10657,7 @@ "$ref": "#/definitions/VirtualMachineExtensionImageProperties" } }, - "required": [ - "name", - "location" - ], + "required": ["name", "location"], "allOf": [ { "$ref": "#/definitions/Resource" @@ -12281,10 +10683,7 @@ "description": "Specifies the tags that are assigned to the virtual machine. For more information about using tags, see [Using tags to organize your Azure resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md)." } }, - "required": [ - "name", - "location" - ], + "required": ["name", "location"], "allOf": [ { "$ref": "#/definitions/SubResource" @@ -12472,11 +10871,7 @@ "type": "string", "readOnly": true, "description": "Describes the reboot requirements of the patch.", - "enum": [ - "NeverReboots", - "AlwaysRequiresReboot", - "CanRequestReboot" - ], + "enum": ["NeverReboots", "AlwaysRequiresReboot", "CanRequestReboot"], "x-ms-enum": { "name": "SoftwareUpdateRebootBehavior", "modelAsString": true @@ -12503,14 +10898,7 @@ "type": "string", "readOnly": true, "description": "Describes the outcome of an install operation for a given patch.", - "enum": [ - "Installed", - "Failed", - "Excluded", - "NotSelected", - "Pending", - "Available" - ], + "enum": ["Installed", "Failed", "Excluded", "NotSelected", "Pending", "Available"], "x-ms-enum": { "name": "PatchAssessmentState", "modelAsString": true @@ -12525,12 +10913,7 @@ "type": "string", "readOnly": true, "description": "The overall success or failure status of the operation. It remains \"InProgress\" until the operation completes. At that point it will become \"Failed\", \"Succeeded\", or \"CompletedWithWarnings.\"", - "enum": [ - "InProgress", - "Failed", - "Succeeded", - "CompletedWithWarnings" - ], + "enum": ["InProgress", "Failed", "Succeeded", "CompletedWithWarnings"], "x-ms-enum": { "name": "PatchOperationStatus", "modelAsString": true @@ -12596,11 +10979,7 @@ "description": "Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element." } }, - "required": [ - "publisher", - "name", - "product" - ], + "required": ["publisher", "name", "product"], "description": "Used for establishing the purchase context of any 3rd Party artifact through MarketPlace." }, "OSDiskImage": { @@ -12608,19 +10987,14 @@ "operatingSystem": { "type": "string", "description": "The operating system of the osDiskImage.", - "enum": [ - "Windows", - "Linux" - ], + "enum": ["Windows", "Linux"], "x-ms-enum": { "name": "OperatingSystemTypes", "modelAsString": false } } }, - "required": [ - "operatingSystem" - ], + "required": ["operatingSystem"], "description": "Contains the os disk image information." }, "DataDiskImage": { @@ -12641,9 +11015,7 @@ "description": "Specifies whether automatic OS upgrade is supported on the image." } }, - "required": [ - "automaticOSUpgradeSupported" - ], + "required": ["automaticOSUpgradeSupported"], "description": "Describes automatic OS upgrade properties on the image." }, "VirtualMachineImageProperties": { @@ -12680,10 +11052,7 @@ "$ref": "#/definitions/VirtualMachineImageProperties" } }, - "required": [ - "name", - "location" - ], + "required": ["name", "location"], "allOf": [ { "$ref": "#/definitions/VirtualMachineImageResource" @@ -12709,9 +11078,7 @@ "unit": { "type": "string", "description": "An enum describing the unit of usage measurement.", - "enum": [ - "Count" - ], + "enum": ["Count"], "x-ms-enum": { "name": "UsageUnit", "modelAsString": false @@ -12732,12 +11099,7 @@ "description": "The name of the type of usage." } }, - "required": [ - "unit", - "currentValue", - "limit", - "name" - ], + "required": ["unit", "currentValue", "limit", "name"], "description": "Describes Compute Resource Usage." }, "ListUsagesResult": { @@ -12754,9 +11116,7 @@ "description": "The URI to fetch the next page of compute resource usage information. Call ListNext() with this to fetch the next page of compute resource usage information." } }, - "required": [ - "value" - ], + "required": ["value"], "description": "The List Usages operation response." }, "VirtualMachineReimageParameters": { @@ -12783,11 +11143,7 @@ "description": "Specifies whether to overwrite the destination virtual hard disk, in case of conflict." } }, - "required": [ - "vhdPrefix", - "destinationContainerName", - "overwriteVhds" - ], + "required": ["vhdPrefix", "destinationContainerName", "overwriteVhds"], "description": "Capture Virtual Machine parameters." }, "VirtualMachineCaptureResult": { @@ -13068,10 +11424,7 @@ "description": "The relative URL of the Key Vault containing the secret." } }, - "required": [ - "secretUrl", - "sourceVault" - ], + "required": ["secretUrl", "sourceVault"], "description": "Describes a reference to Key Vault Secret" }, "DiskEncryptionSetParameters": { @@ -13093,10 +11446,7 @@ "description": "The relative URL of the Key Vault containing the key." } }, - "required": [ - "keyUrl", - "sourceVault" - ], + "required": ["keyUrl", "sourceVault"], "description": "Describes a reference to Key Vault Key" }, "DiskEncryptionSettings": { @@ -13128,11 +11478,7 @@ "Caching": { "type": "string", "description": "Specifies the caching requirements.

Possible values are:

**None**

**ReadOnly**

**ReadWrite**

Default: **None for Standard storage. ReadOnly for Premium storage**", - "enum": [ - "None", - "ReadOnly", - "ReadWrite" - ], + "enum": ["None", "ReadOnly", "ReadWrite"], "x-ms-enum": { "name": "CachingTypes", "modelAsString": false @@ -13141,11 +11487,7 @@ "CreateOption": { "type": "string", "description": "Specifies how the virtual machine should be created.

Possible values are:

**Attach** \\u2013 This value is used when you are using a specialized disk to create the virtual machine.

**FromImage** \\u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described.", - "enum": [ - "FromImage", - "Empty", - "Attach" - ], + "enum": ["FromImage", "Empty", "Attach"], "x-ms-enum": { "name": "DiskCreateOptionTypes", "modelAsString": true @@ -13154,12 +11496,7 @@ "StorageAccountType": { "type": "string", "description": "Specifies the storage account type for the managed disk. Managed OS disk storage account type can only be set when you create the scale set. NOTE: UltraSSD_LRS can only be used with data disks. It cannot be used with OS Disk. Standard_LRS uses Standard HDD. StandardSSD_LRS uses Standard SSD. Premium_LRS uses Premium SSD. UltraSSD_LRS uses Ultra disk. For more information regarding disks supported for Windows Virtual Machines, refer to https://docs.microsoft.com/en-us/azure/virtual-machines/windows/disks-types and, for Linux Virtual Machines, refer to https://docs.microsoft.com/en-us/azure/virtual-machines/linux/disks-types", - "enum": [ - "Standard_LRS", - "Premium_LRS", - "StandardSSD_LRS", - "UltraSSD_LRS" - ], + "enum": ["Standard_LRS", "Premium_LRS", "StandardSSD_LRS", "UltraSSD_LRS"], "x-ms-enum": { "name": "StorageAccountTypes", "modelAsString": true @@ -13168,9 +11505,7 @@ "DiffDiskOption": { "type": "string", "description": "Specifies the ephemeral disk option for operating system disk.", - "enum": [ - "Local" - ], + "enum": ["Local"], "x-ms-enum": { "name": "DiffDiskOptions", "modelAsString": true @@ -13179,10 +11514,7 @@ "DiffDiskPlacement": { "type": "string", "description": "Specifies the ephemeral disk placement for operating system disk. This property can be used by user in the request to choose the location i.e, cache disk or resource disk space for Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer Ephemeral OS disk size requirements for Windows VM at https://docs.microsoft.com/en-us/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VM at https://docs.microsoft.com/en-us/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements", - "enum": [ - "CacheDisk", - "ResourceDisk" - ], + "enum": ["CacheDisk", "ResourceDisk"], "x-ms-enum": { "name": "DiffDiskPlacement", "modelAsString": true @@ -13224,10 +11556,7 @@ "osType": { "type": "string", "description": "This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD.

Possible values are:

**Windows**

**Linux**", - "enum": [ - "Windows", - "Linux" - ], + "enum": ["Windows", "Linux"], "x-ms-enum": { "name": "OperatingSystemTypes", "modelAsString": false @@ -13275,9 +11604,7 @@ "$ref": "#/definitions/ManagedDiskParameters" } }, - "required": [ - "createOption" - ], + "required": ["createOption"], "description": "Specifies information about the operating system disk used by the virtual machine.

For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)." }, "DataDisk": { @@ -13337,10 +11664,7 @@ "description": "Specifies the bandwidth in MB per second for the managed disk when StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine ScaleSet VM disks. Can be updated only via updates to the VirtualMachine Scale Set." } }, - "required": [ - "lun", - "createOption" - ], + "required": ["lun", "createOption"], "description": "Describes a data disk." }, "StorageProfile": { @@ -13386,9 +11710,7 @@ "passName": { "type": "string", "description": "The pass name. Currently, the only allowable value is OobeSystem.", - "enum": [ - "OobeSystem" - ], + "enum": ["OobeSystem"], "x-ms-enum": { "name": "PassNames", "modelAsString": false @@ -13397,9 +11719,7 @@ "componentName": { "type": "string", "description": "The component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup.", - "enum": [ - "Microsoft-Windows-Shell-Setup" - ], + "enum": ["Microsoft-Windows-Shell-Setup"], "x-ms-enum": { "name": "ComponentNames", "modelAsString": false @@ -13408,10 +11728,7 @@ "settingName": { "type": "string", "description": "Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon.", - "enum": [ - "AutoLogon", - "FirstLogonCommands" - ], + "enum": ["AutoLogon", "FirstLogonCommands"], "x-ms-enum": { "name": "SettingNames", "modelAsString": false @@ -13429,10 +11746,7 @@ "protocol": { "type": "string", "description": "Specifies the protocol of WinRM listener.

Possible values are:
**http**

**https**", - "enum": [ - "Http", - "Https" - ], + "enum": ["Http", "Https"], "x-ms-enum": { "name": "ProtocolTypes", "modelAsString": false @@ -13677,11 +11991,7 @@ "priority": { "type": "string", "description": "Specifies the priority for a standalone virtual machine or the virtual machines in the scale set.

'Low' enum will be deprecated in the future, please use 'Spot' as the enum to deploy Azure Spot VM/VMSS.", - "enum": [ - "Regular", - "Low", - "Spot" - ], + "enum": ["Regular", "Low", "Spot"], "x-ms-enum": { "name": "VirtualMachinePriorityTypes", "modelAsString": true @@ -13690,10 +12000,7 @@ "evictionPolicy": { "type": "string", "description": "Specifies the eviction policy for the Azure Spot VM/VMSS", - "enum": [ - "Deallocate", - "Delete" - ], + "enum": ["Deallocate", "Delete"], "x-ms-enum": { "name": "VirtualMachineEvictionPolicyTypes", "modelAsString": true @@ -13807,12 +12114,7 @@ "type": { "type": "string", "description": "The type of identity used for the virtual machine. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine.", - "enum": [ - "SystemAssigned", - "UserAssigned", - "SystemAssigned, UserAssigned", - "None" - ], + "enum": ["SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned", "None"], "x-ms-enum": { "name": "ResourceIdentityType", "modelAsString": false @@ -13869,12 +12171,7 @@ "lastOperationResultCode": { "type": "string", "description": "The Last Maintenance Operation Result Code.", - "enum": [ - "None", - "RetryLater", - "MaintenanceAborted", - "MaintenanceCompleted" - ], + "enum": ["None", "RetryLater", "MaintenanceAborted", "MaintenanceCompleted"], "x-ms-enum": { "name": "MaintenanceOperationResultCodeTypes", "modelAsString": false @@ -13914,10 +12211,7 @@ "hyperVGeneration": { "type": "string", "description": "Specifies the HyperVGeneration Type associated with a resource", - "enum": [ - "V1", - "V2" - ], + "enum": ["V1", "V2"], "x-ms-enum": { "name": "HyperVGenerationType", "modelAsString": true @@ -14141,9 +12435,7 @@ "description": "The URI to fetch the next page of VMs. Call ListNext() with this URI to fetch the next page of Virtual Machines." } }, - "required": [ - "value" - ], + "required": ["value"], "description": "The List Virtual Machine operation response." }, "Sku": { @@ -14182,11 +12474,7 @@ "mode": { "type": "string", "description": "Specifies the mode of an upgrade to virtual machines in the scale set.

Possible values are:

**Manual** - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade action.

**Automatic** - All virtual machines in the scale set are automatically updated at the same time.", - "enum": [ - "Automatic", - "Manual", - "Rolling" - ], + "enum": ["Automatic", "Manual", "Rolling"], "x-ms-enum": { "name": "UpgradeMode", "modelAsString": false @@ -14239,11 +12527,7 @@ "type": "array", "items": { "type": "string", - "enum": [ - "Default", - "OldestVM", - "NewestVM" - ], + "enum": ["Default", "OldestVM", "NewestVM"], "x-ms-enum": { "name": "VirtualMachineScaleSetScaleInRules", "modelAsString": true @@ -14259,10 +12543,7 @@ "osType": { "type": "string", "description": "This property allows you to specify the type of the OS that is included in the disk if creating a VM from a custom image.

Possible values are:

**Windows**

**Linux**", - "enum": [ - "Windows", - "Linux" - ], + "enum": ["Windows", "Linux"], "x-ms-enum": { "name": "OperatingSystemTypes", "modelAsString": false @@ -14271,10 +12552,7 @@ "osState": { "type": "string", "description": "The OS State.", - "enum": [ - "Generalized", - "Specialized" - ], + "enum": ["Generalized", "Specialized"], "x-ms-enum": { "name": "OperatingSystemStateTypes", "modelAsString": false, @@ -14296,10 +12574,7 @@ "$ref": "#/definitions/ImageDisk" } ], - "required": [ - "osType", - "osState" - ], + "required": ["osType", "osState"], "description": "Describes an Operating System disk." }, "ImageDataDisk": { @@ -14315,9 +12590,7 @@ "$ref": "#/definitions/ImageDisk" } ], - "required": [ - "lun" - ], + "required": ["lun"], "description": "Describes a data disk." }, "ImageDisk": { @@ -14337,11 +12610,7 @@ "caching": { "type": "string", "description": "Specifies the caching requirements.

Possible values are:

**None**

**ReadOnly**

**ReadWrite**

Default: **None for Standard storage. ReadOnly for Premium storage**", - "enum": [ - "None", - "ReadOnly", - "ReadWrite" - ], + "enum": ["None", "ReadOnly", "ReadWrite"], "x-ms-enum": { "name": "CachingTypes", "modelAsString": false @@ -14447,9 +12716,7 @@ "description": "The uri to fetch the next page of Images. Call ListNext() with this to fetch the next page of Images." } }, - "required": [ - "value" - ], + "required": ["value"], "description": "The List Image operation response." }, "VirtualMachineScaleSetIdentity": { @@ -14467,12 +12734,7 @@ "type": { "type": "string", "description": "The type of identity used for the virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine scale set.", - "enum": [ - "SystemAssigned", - "UserAssigned", - "SystemAssigned, UserAssigned", - "None" - ], + "enum": ["SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned", "None"], "x-ms-enum": { "name": "ResourceIdentityType", "modelAsString": false @@ -14603,10 +12865,7 @@ "osType": { "type": "string", "description": "This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD.

Possible values are:

**Windows**

**Linux**", - "enum": [ - "Windows", - "Linux" - ], + "enum": ["Windows", "Linux"], "x-ms-enum": { "name": "OperatingSystemTypes", "modelAsString": false @@ -14628,9 +12887,7 @@ "$ref": "#/definitions/VirtualMachineScaleSetManagedDiskParameters" } }, - "required": [ - "createOption" - ], + "required": ["createOption"], "description": "Describes a virtual machine scale set operating system disk." }, "VirtualMachineScaleSetUpdateOSDisk": { @@ -14709,10 +12966,7 @@ "description": "Specifies the bandwidth in MB per second for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on diskSizeGB." } }, - "required": [ - "lun", - "createOption" - ], + "required": ["lun", "createOption"], "description": "Describes a virtual machine scale set data disk." }, "VirtualMachineScaleSetStorageProfile": { @@ -14781,10 +13035,7 @@ "privateIPAddressVersion": { "type": "string", "description": "Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'.", - "enum": [ - "IPv4", - "IPv6" - ], + "enum": ["IPv4", "IPv6"], "x-ms-enum": { "name": "IPVersion", "modelAsString": true @@ -14838,10 +13089,7 @@ "privateIPAddressVersion": { "type": "string", "description": "Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'.", - "enum": [ - "IPv4", - "IPv6" - ], + "enum": ["IPv4", "IPv6"], "x-ms-enum": { "name": "IPVersion", "modelAsString": true @@ -14889,9 +13137,7 @@ "$ref": "#/definitions/VirtualMachineScaleSetIPConfigurationProperties" } }, - "required": [ - "name" - ], + "required": ["name"], "allOf": [ { "$ref": "#/definitions/SubResource" @@ -14947,9 +13193,7 @@ "description": "Whether IP forwarding enabled on this NIC." } }, - "required": [ - "ipConfigurations" - ], + "required": ["ipConfigurations"], "description": "Describes a virtual machine scale set network profile's IP configuration." }, "VirtualMachineScaleSetUpdateNetworkConfigurationProperties": { @@ -14995,9 +13239,7 @@ "$ref": "#/definitions/VirtualMachineScaleSetNetworkConfigurationProperties" } }, - "required": [ - "name" - ], + "required": ["name"], "allOf": [ { "$ref": "#/definitions/SubResource" @@ -15042,9 +13284,7 @@ "description": "The Domain name label.The concatenation of the domain name label and vm index will be the domain name labels of the PublicIPAddress resources that will be created" } }, - "required": [ - "domainNameLabel" - ], + "required": ["domainNameLabel"], "description": "Describes a virtual machines scale sets network configuration's DNS settings." }, "VirtualMachineScaleSetIpTag": { @@ -15071,9 +13311,7 @@ "$ref": "#/definitions/VirtualMachineScaleSetPublicIPAddressConfigurationProperties" } }, - "required": [ - "name" - ], + "required": ["name"], "description": "Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration" }, "VirtualMachineScaleSetUpdatePublicIPAddressConfiguration": { @@ -15114,10 +13352,7 @@ "publicIPAddressVersion": { "type": "string", "description": "Available from Api-Version 2019-07-01 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'.", - "enum": [ - "IPv4", - "IPv6" - ], + "enum": ["IPv4", "IPv6"], "x-ms-enum": { "name": "IPVersion", "modelAsString": true @@ -15278,9 +13513,7 @@ "description": "The uri to fetch the next page of VM scale set extensions. Call ListNext() with this to fetch the next page of VM scale set extensions." } }, - "required": [ - "value" - ], + "required": ["value"], "description": "The List VM scale set extension operation response." }, "VirtualMachineScaleSetExtensionProfile": { @@ -15600,9 +13833,7 @@ "description": "The virtual machine scale set instance ids." } }, - "required": [ - "instanceIds" - ], + "required": ["instanceIds"], "description": "Specifies a list of virtual machine instance IDs from the VM scale set." }, "VirtualMachineStatusCodeCount": { @@ -15658,9 +13889,7 @@ "type": "string", "readOnly": true, "description": "The name of the service.", - "enum": [ - "AutomaticRepairs" - ], + "enum": ["AutomaticRepairs"], "x-ms-enum": { "name": "OrchestrationServiceNames", "modelAsString": true @@ -15670,11 +13899,7 @@ "type": "string", "readOnly": true, "description": "The current state of the service.", - "enum": [ - "NotRunning", - "Running", - "Suspended" - ], + "enum": ["NotRunning", "Running", "Suspended"], "x-ms-enum": { "name": "OrchestrationServiceState", "modelAsString": true @@ -15730,9 +13955,7 @@ "description": "The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of VMSS." } }, - "required": [ - "value" - ], + "required": ["value"], "description": "The List Virtual Machine operation response." }, "VirtualMachineScaleSetListWithLinkResult": { @@ -15749,9 +13972,7 @@ "description": "The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of Virtual Machine Scale Sets." } }, - "required": [ - "value" - ], + "required": ["value"], "description": "The List Virtual Machine operation response." }, "VirtualMachineScaleSetSkuCapacity": { @@ -15778,10 +13999,7 @@ "readOnly": true, "type": "string", "description": "The scale type applicable to the sku.", - "enum": [ - "Automatic", - "None" - ], + "enum": ["Automatic", "None"], "x-ms-enum": { "name": "VirtualMachineScaleSetSkuScaleType", "modelAsString": false @@ -15824,9 +14042,7 @@ "description": "The uri to fetch the next page of Virtual Machine Scale Set Skus. Call ListNext() with this to fetch the next page of VMSS Skus." } }, - "required": [ - "value" - ], + "required": ["value"], "description": "The Virtual Machine Scale Set List Skus operation response." }, "RollbackStatusInfo": { @@ -15857,12 +14073,7 @@ "type": "string", "readOnly": true, "description": "Code indicating the current status of the upgrade.", - "enum": [ - "RollingForward", - "Cancelled", - "Completed", - "Faulted" - ], + "enum": ["RollingForward", "Cancelled", "Completed", "Faulted"], "x-ms-enum": { "name": "UpgradeState", "modelAsString": false @@ -15904,11 +14115,7 @@ "readOnly": true, "type": "string", "description": "Invoker of the Upgrade Operation", - "enum": [ - "Unknown", - "User", - "Platform" - ], + "enum": ["Unknown", "User", "Platform"], "x-ms-enum": { "name": "UpgradeOperationInvoker", "modelAsString": false @@ -15961,9 +14168,7 @@ "description": "The uri to fetch the next page of OS Upgrade History. Call ListNext() with this to fetch the next page of history of upgrades." } }, - "required": [ - "value" - ], + "required": ["value"], "description": "List of Virtual Machine Scale Set OS Upgrade History operation response." }, "VirtualMachineScaleSetVMProperties": { @@ -16221,9 +14426,7 @@ "description": "The uri to fetch the next page of Virtual Machine Scale Set VMs. Call ListNext() with this to fetch the next page of VMSS VMs" } }, - "required": [ - "value" - ], + "required": ["value"], "description": "The List Virtual Machine Scale Set VMs operation response." }, "RollingUpgradeStatusInfo": { @@ -16271,12 +14474,7 @@ "type": "string", "readOnly": true, "description": "Code indicating the current status of the upgrade.", - "enum": [ - "RollingForward", - "Cancelled", - "Completed", - "Faulted" - ], + "enum": ["RollingForward", "Cancelled", "Completed", "Faulted"], "x-ms-enum": { "name": "RollingUpgradeStatusCode", "modelAsString": false @@ -16292,10 +14490,7 @@ "type": "string", "readOnly": true, "description": "The last action performed on the rolling upgrade.", - "enum": [ - "Start", - "Cancel" - ], + "enum": ["Start", "Cancel"], "x-ms-enum": { "name": "RollingUpgradeActionType", "modelAsString": false @@ -16436,9 +14631,7 @@ "description": "Resource tags" } }, - "required": [ - "location" - ], + "required": ["location"], "x-ms-azure-resource": true }, "UpdateResource": { @@ -16492,21 +14685,14 @@ "intervalLength": { "type": "string", "description": "Interval value in minutes used to create LogAnalytics call rate logs.", - "enum": [ - "ThreeMins", - "FiveMins", - "ThirtyMins", - "SixtyMins" - ], + "enum": ["ThreeMins", "FiveMins", "ThirtyMins", "SixtyMins"], "x-ms-enum": { "name": "IntervalInMins", "modelAsString": false } } }, - "required": [ - "intervalLength" - ], + "required": ["intervalLength"], "allOf": [ { "$ref": "#/definitions/LogAnalyticsInputBase" @@ -16551,11 +14737,7 @@ "description": "Group query result by Resource Name." } }, - "required": [ - "blobContainerSasUri", - "fromTime", - "toTime" - ], + "required": ["blobContainerSasUri", "fromTime", "toTime"], "description": "Api input base class for LogAnalytics Api." }, "LogAnalyticsOperationResult": { @@ -16591,9 +14773,7 @@ "serviceName": { "type": "string", "description": "The name of the service.", - "enum": [ - "AutomaticRepairs" - ], + "enum": ["AutomaticRepairs"], "x-ms-enum": { "name": "OrchestrationServiceNames", "modelAsString": true @@ -16602,10 +14782,7 @@ "action": { "type": "string", "description": "The action to be performed.", - "enum": [ - "Resume", - "Suspend" - ], + "enum": ["Resume", "Suspend"], "x-ms-enum": { "name": "OrchestrationServiceStateAction", "modelAsString": true @@ -16613,21 +14790,14 @@ } }, "description": "The input for OrchestrationServiceState", - "required": [ - "serviceName", - "action" - ] + "required": ["serviceName", "action"] }, "PatchSettings": { "properties": { "patchMode": { "type": "string", "description": "Specifies the mode of in-guest patching to IaaS virtual machine.

Possible values are:

**Manual** - You control the application of patches to a virtual machine. You do this by applying patches manually inside the VM. In this mode, automatic updates are disabled; the property WindowsConfiguration.enableAutomaticUpdates must be false

**AutomaticByOS** - The virtual machine will automatically be updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates must be true.

** AutomaticByPlatform** - the virtual machine will automatically updated by the OS. The properties provisionVMAgent and WindowsConfiguration.enableAutomaticUpdates must be true ", - "enum": [ - "Manual", - "AutomaticByOS", - "AutomaticByPlatform" - ], + "enum": ["Manual", "AutomaticByOS", "AutomaticByPlatform"], "x-ms-enum": { "name": "InGuestPatchMode", "modelAsString": true @@ -16646,10 +14816,7 @@ "description": "The run command parameter value." } }, - "required": [ - "name", - "value" - ], + "required": ["name", "value"], "description": "Describes the properties of a run command parameter." }, "RunCommandInput": { @@ -16673,9 +14840,7 @@ "description": "The run command parameters." } }, - "required": [ - "commandId" - ], + "required": ["commandId"], "description": "Capture Virtual Machine parameters." }, "RunCommandParameterDefinition": { @@ -16698,10 +14863,7 @@ "default": false } }, - "required": [ - "name", - "type" - ], + "required": ["name", "type"], "description": "Describes the properties of a run command parameter." }, "RunCommandDocumentBase": { @@ -16717,10 +14879,7 @@ "osType": { "type": "string", "description": "The Operating System type.", - "enum": [ - "Windows", - "Linux" - ], + "enum": ["Windows", "Linux"], "x-ms-enum": { "name": "OperatingSystemTypes", "modelAsString": false @@ -16735,13 +14894,7 @@ "description": "The VM run command description." } }, - "required": [ - "$schema", - "id", - "osType", - "label", - "description" - ], + "required": ["$schema", "id", "osType", "label", "description"], "description": "Describes the properties of a Run Command metadata." }, "RunCommandDocument": { @@ -16766,9 +14919,7 @@ "description": "The parameters used by the script." } }, - "required": [ - "script" - ], + "required": ["script"], "description": "Describes the properties of a Run Command." }, "RunCommandListResult": { @@ -16785,9 +14936,7 @@ "description": "The uri to fetch the next page of run commands. Call ListNext() with this to fetch the next page of run commands." } }, - "required": [ - "value" - ], + "required": ["value"], "description": "The List Virtual Machine operation response." }, "RunCommandResult": { @@ -16825,11 +14974,7 @@ "type": "string", "readOnly": true, "description": "The scale type applicable to the sku.", - "enum": [ - "Automatic", - "Manual", - "None" - ], + "enum": ["Automatic", "Manual", "None"], "x-ms-enum": { "name": "ResourceSkuCapacityScaleType", "modelAsString": false @@ -16901,10 +15046,7 @@ "type": "string", "readOnly": true, "description": "The type of restrictions.", - "enum": [ - "Location", - "Zone" - ], + "enum": ["Location", "Zone"], "x-ms-enum": { "name": "ResourceSkuRestrictionsType", "modelAsString": false @@ -16927,10 +15069,7 @@ "type": "string", "readOnly": true, "description": "The reason for restriction.", - "enum": [ - "QuotaId", - "NotAvailableForSubscription" - ], + "enum": ["QuotaId", "NotAvailableForSubscription"], "x-ms-enum": { "name": "ResourceSkuRestrictionsReasonCode", "modelAsString": false @@ -17086,9 +15225,7 @@ "description": "The URI to fetch the next page of Resource Skus. Call ListNext() with this URI to fetch the next page of Resource Skus" } }, - "required": [ - "value" - ], + "required": ["value"], "description": "The List Resource Skus operation response." }, "Disk": { @@ -17161,21 +15298,14 @@ "description": "The uri to fetch the next page of disks. Call ListNext() with this to fetch the next page of disks." } }, - "required": [ - "value" - ], + "required": ["value"], "description": "The List Disks operation response." }, "DiskSku": { "properties": { "name": { "type": "string", - "enum": [ - "Standard_LRS", - "Premium_LRS", - "StandardSSD_LRS", - "UltraSSD_LRS" - ], + "enum": ["Standard_LRS", "Premium_LRS", "StandardSSD_LRS", "UltraSSD_LRS"], "x-ms-enum": { "name": "DiskStorageAccountTypes", "modelAsString": true, @@ -17212,11 +15342,7 @@ "properties": { "name": { "type": "string", - "enum": [ - "Standard_LRS", - "Premium_LRS", - "Standard_ZRS" - ], + "enum": ["Standard_LRS", "Premium_LRS", "Standard_ZRS"], "x-ms-enum": { "name": "SnapshotStorageAccountTypes", "modelAsString": true, @@ -17256,10 +15382,7 @@ "osType": { "type": "string", "description": "The Operating System type.", - "enum": [ - "Windows", - "Linux" - ], + "enum": ["Windows", "Linux"], "x-ms-enum": { "name": "OperatingSystemTypes", "modelAsString": false @@ -17268,10 +15391,7 @@ "hyperVGeneration": { "type": "string", "description": "The hypervisor generation of the Virtual Machine. Applicable to OS disks only.", - "enum": [ - "V1", - "V2" - ], + "enum": ["V1", "V2"], "x-ms-enum": { "name": "HyperVGeneration", "modelAsString": true @@ -17330,14 +15450,7 @@ "type": "string", "description": "The state of the disk.", "readOnly": true, - "enum": [ - "Unattached", - "Attached", - "Reserved", - "ActiveSAS", - "ReadyToUpload", - "ActiveUpload" - ], + "enum": ["Unattached", "Attached", "Reserved", "ActiveSAS", "ReadyToUpload", "ActiveUpload"], "x-ms-enum": { "name": "DiskState", "modelAsString": true, @@ -17394,9 +15507,7 @@ "description": "ARM id of the DiskAccess resource for using private endpoints on disks." } }, - "required": [ - "creationData" - ], + "required": ["creationData"], "description": "Disk resource properties." }, "SnapshotProperties": { @@ -17410,10 +15521,7 @@ "osType": { "type": "string", "description": "The Operating System type.", - "enum": [ - "Windows", - "Linux" - ], + "enum": ["Windows", "Linux"], "x-ms-enum": { "name": "OperatingSystemTypes", "modelAsString": false @@ -17422,10 +15530,7 @@ "hyperVGeneration": { "type": "string", "description": "The hypervisor generation of the Virtual Machine. Applicable to OS disks only.", - "enum": [ - "V1", - "V2" - ], + "enum": ["V1", "V2"], "x-ms-enum": { "name": "HyperVGeneration", "modelAsString": true @@ -17476,9 +15581,7 @@ "description": "ARM id of the DiskAccess resource for using private endpoints on disks." } }, - "required": [ - "creationData" - ], + "required": ["creationData"], "description": "Snapshot resource properties." }, "ShareInfoElement": { @@ -17532,9 +15635,7 @@ "description": "Describes what type of encryption is used for the disks. Once this field is set, it cannot be overwritten. '1.0' corresponds to Azure Disk Encryption with AAD app.'1.1' corresponds to Azure Disk Encryption." } }, - "required": [ - "enabled" - ], + "required": ["enabled"], "description": "Encryption settings for disk or snapshot" }, "EncryptionSettingsElement": { @@ -17561,10 +15662,7 @@ "description": "Url pointing to a key or secret in KeyVault" } }, - "required": [ - "secretUrl", - "sourceVault" - ], + "required": ["secretUrl", "sourceVault"], "description": "Key Vault Secret Url and vault id of the encryption key " }, "KeyVaultAndKeyReference": { @@ -17578,10 +15676,7 @@ "description": "Url pointing to a key or secret in KeyVault" } }, - "required": [ - "keyUrl", - "sourceVault" - ], + "required": ["keyUrl", "sourceVault"], "description": "Key Vault Key Url and vault id of KeK, KeK is optional and when provided is used to unwrap the encryptionKey" }, "SourceVault": { @@ -17596,11 +15691,7 @@ "EncryptionType": { "type": "string", "description": "The type of key used to encrypt the data of the disk.", - "enum": [ - "EncryptionAtRestWithPlatformKey", - "EncryptionAtRestWithCustomerKey", - "EncryptionAtRestWithPlatformAndCustomerKeys" - ], + "enum": ["EncryptionAtRestWithPlatformKey", "EncryptionAtRestWithCustomerKey", "EncryptionAtRestWithPlatformAndCustomerKeys"], "x-ms-enum": { "name": "EncryptionType", "modelAsString": true, @@ -17635,11 +15726,7 @@ "NetworkAccessPolicy": { "type": "string", "description": "Policy for accessing the disk via network.", - "enum": [ - "AllowAll", - "AllowPrivate", - "DenyAll" - ], + "enum": ["AllowAll", "AllowPrivate", "DenyAll"], "x-ms-enum": { "name": "NetworkAccessPolicy", "modelAsString": true, @@ -17664,10 +15751,7 @@ "osType": { "type": "string", "description": "the Operating System type.", - "enum": [ - "Windows", - "Linux" - ], + "enum": ["Windows", "Linux"], "x-ms-enum": { "name": "OperatingSystemTypes", "modelAsString": false @@ -17726,10 +15810,7 @@ "osType": { "type": "string", "description": "the Operating System type.", - "enum": [ - "Windows", - "Linux" - ], + "enum": ["Windows", "Linux"], "x-ms-enum": { "name": "OperatingSystemTypes", "modelAsString": false @@ -17773,15 +15854,7 @@ "properties": { "createOption": { "type": "string", - "enum": [ - "Empty", - "Attach", - "FromImage", - "Import", - "Copy", - "Restore", - "Upload" - ], + "enum": ["Empty", "Attach", "FromImage", "Import", "Copy", "Restore", "Upload"], "x-ms-enum": { "name": "DiskCreateOption", "modelAsString": true, @@ -17849,9 +15922,7 @@ "description": "If createOption is Upload, this is the size of the contents of the upload including the VHD footer. This value should be between 20972032 (20 MiB + 512 bytes for the VHD footer) and 35183298347520 bytes (32 TiB + 512 bytes for the VHD footer)." } }, - "required": [ - "createOption" - ], + "required": ["createOption"], "description": "Data used when creating a disk." }, "ImageDiskReference": { @@ -17866,20 +15937,14 @@ "description": "If the disk is created from an image's data disk, this is an index that indicates which of the data disks in the image to use. For OS disks, this field is null." } }, - "required": [ - "id" - ], + "required": ["id"], "description": "The source image used for creating the disk." }, "GrantAccessData": { "properties": { "access": { "type": "string", - "enum": [ - "None", - "Read", - "Write" - ], + "enum": ["None", "Read", "Write"], "x-ms-enum": { "name": "AccessLevel", "modelAsString": true @@ -17891,10 +15956,7 @@ "description": "Time duration in seconds until the SAS access expires." } }, - "required": [ - "access", - "durationInSeconds" - ], + "required": ["access", "durationInSeconds"], "description": "Data used for requesting a SAS." }, "AccessUri": { @@ -17962,18 +16024,14 @@ "description": "The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots." } }, - "required": [ - "value" - ], + "required": ["value"], "description": "The List Snapshots operation response." }, "EncryptionSetIdentity": { "properties": { "type": { "type": "string", - "enum": [ - "SystemAssigned" - ], + "enum": ["SystemAssigned"], "x-ms-enum": { "name": "DiskEncryptionSetIdentityType", "modelAsString": true @@ -18040,9 +16098,7 @@ "description": "The uri to fetch the next page of disk encryption sets. Call ListNext() with this to fetch the next page of disk encryption sets." } }, - "required": [ - "value" - ], + "required": ["value"], "description": "The List disk encryption set operation response." }, "PrivateEndpoint": { @@ -18058,11 +16114,7 @@ "PrivateEndpointServiceConnectionStatus": { "type": "string", "description": "The private endpoint connection status.", - "enum": [ - "Pending", - "Approved", - "Rejected" - ], + "enum": ["Pending", "Approved", "Rejected"], "x-ms-enum": { "name": "PrivateEndpointServiceConnectionStatus", "modelAsString": true @@ -18072,12 +16124,7 @@ "type": "string", "readOnly": true, "description": "The current provisioning state.", - "enum": [ - "Succeeded", - "Creating", - "Deleting", - "Failed" - ], + "enum": ["Succeeded", "Creating", "Deleting", "Failed"], "x-ms-enum": { "name": "PrivateEndpointConnectionProvisioningState", "modelAsString": true @@ -18115,9 +16162,7 @@ "description": "The provisioning state of the private endpoint connection resource." } }, - "required": [ - "privateLinkServiceConnectionState" - ], + "required": ["privateLinkServiceConnectionState"], "description": "Properties of the PrivateEndpointConnectProperties." }, "PrivateEndpointConnection": { @@ -18196,9 +16241,7 @@ "description": "The uri to fetch the next page of disk access resources. Call ListNext() with this to fetch the next page of disk access resources." } }, - "required": [ - "value" - ], + "required": ["value"], "description": "The List disk access operation response." }, "DiskAccessUpdate": { @@ -18317,14 +16360,7 @@ "type": "string", "title": "The current state of the gallery.", "description": "The provisioning state, which only appears in the response.", - "enum": [ - "Creating", - "Updating", - "Failed", - "Succeeded", - "Deleting", - "Migrating" - ] + "enum": ["Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating"] } }, "description": "Describes the properties of a Shared Image Gallery." @@ -18393,19 +16429,14 @@ "supportedOSType": { "type": "string", "description": "This property allows you to specify the supported type of the OS that application is built for.

Possible values are:

**Windows**

**Linux**", - "enum": [ - "Windows", - "Linux" - ], + "enum": ["Windows", "Linux"], "x-ms-enum": { "name": "OperatingSystemTypes", "modelAsString": false } } }, - "required": [ - "supportedOSType" - ], + "required": ["supportedOSType"], "description": "Describes the properties of a gallery Application Definition." }, "GalleryApplicationVersion": { @@ -18446,23 +16477,14 @@ "type": "string", "title": "The current state of the gallery Application Version.", "description": "The provisioning state, which only appears in the response.", - "enum": [ - "Creating", - "Updating", - "Failed", - "Succeeded", - "Deleting", - "Migrating" - ] + "enum": ["Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating"] }, "replicationStatus": { "readOnly": true, "$ref": "#/definitions/ReplicationStatus" } }, - "required": [ - "publishingProfile" - ], + "required": ["publishingProfile"], "description": "Describes the properties of a gallery Image Version." }, "GalleryApplicationVersionPublishingProfile": { @@ -18484,9 +16506,7 @@ "$ref": "#/definitions/GalleryArtifactPublishingProfileBase" } ], - "required": [ - "source" - ], + "required": ["source"], "description": "The publishing profile of a gallery Image Version." }, "UserArtifactSource": { @@ -18500,10 +16520,7 @@ "description": "Required. The mediaLink of the artifact, must be a readable storage blob." } }, - "required": [ - "fileName", - "mediaLink" - ], + "required": ["fileName", "mediaLink"], "description": "The source image from which the Image Version is going to be created." }, "GalleryImage": { @@ -18555,10 +16572,7 @@ "osType": { "type": "string", "description": "This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image.

Possible values are:

**Windows**

**Linux**", - "enum": [ - "Windows", - "Linux" - ], + "enum": ["Windows", "Linux"], "x-ms-enum": { "name": "OperatingSystemTypes", "modelAsString": false @@ -18567,10 +16581,7 @@ "osState": { "type": "string", "description": "This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'.", - "enum": [ - "Generalized", - "Specialized" - ], + "enum": ["Generalized", "Specialized"], "x-ms-enum": { "name": "OperatingSystemStateTypes", "modelAsString": false @@ -18579,10 +16590,7 @@ "hyperVGeneration": { "type": "string", "description": "The hypervisor generation of the Virtual Machine. Applicable to OS disks only.", - "enum": [ - "V1", - "V2" - ], + "enum": ["V1", "V2"], "x-ms-enum": { "name": "HyperVGeneration", "modelAsString": true @@ -18610,21 +16618,10 @@ "type": "string", "title": "The current state of the gallery Image Definition.", "description": "The provisioning state, which only appears in the response.", - "enum": [ - "Creating", - "Updating", - "Failed", - "Succeeded", - "Deleting", - "Migrating" - ] - } - }, - "required": [ - "osType", - "osState", - "identifier" - ], + "enum": ["Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating"] + } + }, + "required": ["osType", "osState", "identifier"], "description": "Describes the properties of a gallery Image Definition." }, "GalleryImageIdentifier": { @@ -18642,11 +16639,7 @@ "description": "The name of the gallery Image Definition SKU." } }, - "required": [ - "publisher", - "offer", - "sku" - ], + "required": ["publisher", "offer", "sku"], "description": "This is the gallery Image Definition identifier." }, "RecommendedMachineConfiguration": { @@ -18742,14 +16735,7 @@ "type": "string", "title": "The current state of the gallery Image Version.", "description": "The provisioning state, which only appears in the response.", - "enum": [ - "Creating", - "Updating", - "Failed", - "Succeeded", - "Deleting", - "Migrating" - ] + "enum": ["Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating"] }, "storageProfile": { "$ref": "#/definitions/GalleryImageVersionStorageProfile" @@ -18759,9 +16745,7 @@ "$ref": "#/definitions/ReplicationStatus" } }, - "required": [ - "storageProfile" - ], + "required": ["storageProfile"], "description": "Describes the properties of a gallery Image Version." }, "GalleryArtifactPublishingProfileBase": { @@ -18796,11 +16780,7 @@ "storageAccountType": { "type": "string", "description": "Specifies the storage account type to be used to store the image. This property is not updatable.", - "enum": [ - "Standard_LRS", - "Standard_ZRS", - "Premium_LRS" - ], + "enum": ["Standard_LRS", "Standard_ZRS", "Premium_LRS"], "x-ms-enum": { "name": "StorageAccountType", "modelAsString": true @@ -18823,11 +16803,7 @@ "storageAccountType": { "type": "string", "description": "Specifies the storage account type to be used to store the image. This property is not updatable.", - "enum": [ - "Standard_LRS", - "Standard_ZRS", - "Premium_LRS" - ], + "enum": ["Standard_LRS", "Standard_ZRS", "Premium_LRS"], "x-ms-enum": { "name": "StorageAccountType", "modelAsString": true @@ -18837,9 +16813,7 @@ "$ref": "#/definitions/EncryptionImages" } }, - "required": [ - "name" - ], + "required": ["name"], "description": "Describes the target region information." }, "EncryptionImages": { @@ -18878,9 +16852,7 @@ "$ref": "#/definitions/DiskImageEncryption" } ], - "required": [ - "lun" - ], + "required": ["lun"], "description": "Contains encryption settings for a data disk image." }, "DiskImageEncryption": { @@ -18898,9 +16870,7 @@ "$ref": "#/definitions/ManagedArtifact" } }, - "required": [ - "managedImage" - ], + "required": ["managedImage"], "description": "The source image from which the Image Version is going to be created." }, "ManagedArtifact": { @@ -18910,9 +16880,7 @@ "description": "The managed artifact id." } }, - "required": [ - "id" - ], + "required": ["id"], "description": "The managed artifact." }, "GalleryImageVersionPublishingProfile": { @@ -18971,9 +16939,7 @@ "$ref": "#/definitions/GalleryDiskImage" } ], - "required": [ - "lun" - ], + "required": ["lun"], "description": "This is the data disk image." }, "GalleryDiskImage": { @@ -18987,11 +16953,7 @@ "hostCaching": { "type": "string", "description": "The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'", - "enum": [ - "None", - "ReadOnly", - "ReadWrite" - ], + "enum": ["None", "ReadOnly", "ReadWrite"], "x-ms-enum": { "name": "HostCaching", "modelAsString": false @@ -19009,12 +16971,7 @@ "readOnly": true, "type": "string", "description": "This is the aggregated replication status based on all the regional replication status flags.", - "enum": [ - "Unknown", - "InProgress", - "Completed", - "Failed" - ], + "enum": ["Unknown", "InProgress", "Completed", "Failed"], "x-ms-enum": { "name": "AggregatedReplicationState", "modelAsString": true @@ -19042,12 +16999,7 @@ "readOnly": true, "type": "string", "description": "This is the regional replication state.", - "enum": [ - "Unknown", - "Replicating", - "Completed", - "Failed" - ], + "enum": ["Unknown", "Replicating", "Completed", "Failed"], "x-ms-enum": { "name": "ReplicationState", "modelAsString": true @@ -19081,9 +17033,7 @@ "description": "The uri to fetch the next page of galleries. Call ListNext() with this to fetch the next page of galleries." } }, - "required": [ - "value" - ], + "required": ["value"], "description": "The List Galleries operation response." }, "GalleryImageList": { @@ -19100,9 +17050,7 @@ "description": "The uri to fetch the next page of Image Definitions in the Shared Image Gallery. Call ListNext() with this to fetch the next page of gallery Image Definitions." } }, - "required": [ - "value" - ], + "required": ["value"], "description": "The List Gallery Images operation response." }, "GalleryImageVersionList": { @@ -19119,9 +17067,7 @@ "description": "The uri to fetch the next page of gallery Image Versions. Call ListNext() with this to fetch the next page of gallery Image Versions." } }, - "required": [ - "value" - ], + "required": ["value"], "description": "The List Gallery Image version operation response." }, "GalleryApplicationList": { @@ -19138,9 +17084,7 @@ "description": "The uri to fetch the next page of Application Definitions in the Application Gallery. Call ListNext() with this to fetch the next page of gallery Application Definitions." } }, - "required": [ - "value" - ], + "required": ["value"], "description": "The List Gallery Applications operation response." }, "GalleryApplicationVersionList": { @@ -19157,9 +17101,7 @@ "description": "The uri to fetch the next page of gallery Application Versions. Call ListNext() with this to fetch the next page of gallery Application Versions." } }, - "required": [ - "value" - ], + "required": ["value"], "description": "The List Gallery Application version operation response." }, "UpdateResourceDefinition": { @@ -19198,9 +17140,7 @@ } }, "description": "Properties to configure a custom container service cluster.", - "required": [ - "orchestrator" - ] + "required": ["orchestrator"] }, "ContainerServiceServicePrincipalProfile": { "properties": { @@ -19214,21 +17154,13 @@ } }, "description": "Information about a service principal identity for the cluster to use for manipulating Azure APIs.", - "required": [ - "clientId", - "secret" - ] + "required": ["clientId", "secret"] }, "ContainerServiceOrchestratorProfile": { "properties": { "orchestratorType": { "type": "string", - "enum": [ - "Swarm", - "DCOS", - "Custom", - "Kubernetes" - ], + "enum": ["Swarm", "DCOS", "Custom", "Kubernetes"], "x-ms-enum": { "name": "ContainerServiceOrchestratorTypes", "modelAsString": false @@ -19237,20 +17169,14 @@ } }, "description": "Profile for the container service orchestrator.", - "required": [ - "orchestratorType" - ] + "required": ["orchestratorType"] }, "ContainerServiceMasterProfile": { "properties": { "count": { "type": "integer", "format": "int32", - "enum": [ - 1, - 3, - 5 - ], + "enum": [1, 3, 5], "description": "Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1.", "default": 1 }, @@ -19264,9 +17190,7 @@ "description": "FQDN for the master." } }, - "required": [ - "dnsPrefix" - ], + "required": ["dnsPrefix"], "description": "Profile for the container service master." }, "ContainerServiceAgentPoolProfile": { @@ -19350,12 +17274,7 @@ "description": "FQDN for the agent pool." } }, - "required": [ - "name", - "dnsPrefix", - "count", - "vmSize" - ], + "required": ["name", "dnsPrefix", "count", "vmSize"], "description": "Profile for the container service agent pool." }, "ContainerServiceWindowsProfile": { @@ -19371,10 +17290,7 @@ "pattern": "^(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%\\^&\\*\\(\\)])[a-zA-Z\\d!@#$%\\^&\\*\\(\\)]{12,123}$" } }, - "required": [ - "adminUsername", - "adminPassword" - ], + "required": ["adminUsername", "adminPassword"], "description": "Profile for Windows VMs in the container service cluster." }, "ContainerServiceLinuxProfile": { @@ -19389,10 +17305,7 @@ "description": "The ssh key configuration for Linux VMs." } }, - "required": [ - "adminUsername", - "ssh" - ], + "required": ["adminUsername", "ssh"], "description": "Profile for Linux VMs in the container service cluster." }, "ContainerServiceSshConfiguration": { @@ -19406,9 +17319,7 @@ } }, "description": "SSH configuration for Linux-based VMs running on Azure.", - "required": [ - "publicKeys" - ] + "required": ["publicKeys"] }, "ContainerServiceSshPublicKey": { "properties": { @@ -19417,9 +17328,7 @@ "description": "Certificate public key used to authenticate with VMs through SSH. The certificate must be in PEM format with or without headers." } }, - "required": [ - "keyData" - ], + "required": ["keyData"], "description": "Contains information about SSH certificate public key data." }, "ContainerServiceDiagnosticsProfile": { @@ -19429,9 +17338,7 @@ "description": "Profile for the container service VM diagnostic agent." } }, - "required": [ - "vmDiagnostics" - ] + "required": ["vmDiagnostics"] }, "ContainerServiceVMDiagnostics": { "properties": { @@ -19446,9 +17353,7 @@ } }, "description": "Profile for diagnostics on the container service VMs.", - "required": [ - "enabled" - ] + "required": ["enabled"] }, "ContainerService": { "properties": { @@ -19523,11 +17428,7 @@ "description": "Properties of the diagnostic agent." } }, - "required": [ - "masterProfile", - "agentPoolProfiles", - "linuxProfile" - ], + "required": ["masterProfile", "agentPoolProfiles", "linuxProfile"], "description": "Properties of the container service." } }, @@ -19580,4 +17481,4 @@ "x-ms-parameter-location": "method" } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/armResource/containerservice.json b/packages/rulesets/src/native/tests/resources/armResource/containerservice.json index ca2a9f87c..4d9aa6afa 100644 --- a/packages/rulesets/src/native/tests/resources/armResource/containerservice.json +++ b/packages/rulesets/src/native/tests/resources/armResource/containerservice.json @@ -5,14 +5,10 @@ "description": "The Container Service Client." }, "host": "management.azure.com", - "schemes": [ - "https" - ], + "schemes": ["https"], "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], "securityDefinitions": { @@ -29,9 +25,7 @@ "paths": { "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/openShiftManagedClusters": { "get": { - "tags": [ - "OpenShiftManagedClusters" - ], + "tags": ["OpenShiftManagedClusters"], "operationId": "OpenShiftManagedClusters_List", "summary": "Gets a list of OpenShift managed clusters in the specified subscription.", "description": "Gets a list of OpenShift managed clusters in the specified subscription. The operation returns properties of each OpenShift managed cluster.", @@ -43,9 +37,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2019-04-30" - ] + "enum": ["2019-04-30"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -63,19 +55,13 @@ "nextLinkName": "nextLink" }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters": { "get": { - "tags": [ - "OpenShiftManagedClusters" - ], + "tags": ["OpenShiftManagedClusters"], "operationId": "OpenShiftManagedClusters_ListByResourceGroup", "summary": "Lists OpenShift managed clusters in the specified subscription and resource group.", "description": "Lists OpenShift managed clusters in the specified subscription and resource group. The operation returns properties of each OpenShift managed cluster.", @@ -87,9 +73,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2019-04-30" - ] + "enum": ["2019-04-30"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -115,19 +99,13 @@ "nextLinkName": "nextLink" }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}": { "get": { - "tags": [ - "OpenShiftManagedClusters" - ], + "tags": ["OpenShiftManagedClusters"], "operationId": "OpenShiftManagedClusters_Get", "summary": "Gets a OpenShift managed cluster.", "description": "Gets the details of the managed OpenShift cluster with a specified resource group and name.", @@ -139,9 +117,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2019-04-30" - ] + "enum": ["2019-04-30"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -177,17 +153,11 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "put": { - "tags": [ - "OpenShiftManagedClusters" - ], + "tags": ["OpenShiftManagedClusters"], "operationId": "OpenShiftManagedClusters_CreateOrUpdate", "summary": "Creates or updates an OpenShift managed cluster.", "description": "Creates or updates a OpenShift managed cluster with the specified configuration for agents and OpenShift version.", @@ -199,9 +169,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2019-04-30" - ] + "enum": ["2019-04-30"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -253,17 +221,11 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "patch": { - "tags": [ - "OpenShiftManagedClusters" - ], + "tags": ["OpenShiftManagedClusters"], "operationId": "OpenShiftManagedClusters_UpdateTags", "summary": "Updates tags on an OpenShift managed cluster.", "description": "Updates an OpenShift managed cluster with the specified tags.", @@ -275,9 +237,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2019-04-30" - ] + "enum": ["2019-04-30"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -323,17 +283,11 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { - "tags": [ - "OpenShiftManagedClusters" - ], + "tags": ["OpenShiftManagedClusters"], "operationId": "OpenShiftManagedClusters_Delete", "summary": "Deletes an OpenShift managed cluster.", "description": "Deletes the OpenShift managed cluster with a specified resource group and name.", @@ -345,9 +299,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2019-04-30" - ] + "enum": ["2019-04-30"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -384,20 +336,14 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/containerServices": { "get": { "deprecated": true, - "tags": [ - "ContainerServices" - ], + "tags": ["ContainerServices"], "operationId": "ContainerServices_List", "summary": "Gets a list of container services in the specified subscription.", "description": "Gets a list of container services in the specified subscription. The operation returns properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents.", @@ -409,9 +355,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2017-07-01" - ] + "enum": ["2017-07-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -429,20 +373,14 @@ "nextLinkName": "nextLink" }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}": { "put": { "deprecated": true, - "tags": [ - "ContainerService" - ], + "tags": ["ContainerService"], "operationId": "ContainerServices_CreateOrUpdate", "summary": "Creates or updates a container service.", "description": "Creates or updates a container service with the specified configuration of orchestrator, masters, and agents.", @@ -473,9 +411,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2017-07-01" - ] + "enum": ["2017-07-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -503,18 +439,12 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "get": { "deprecated": true, - "tags": [ - "ContainerService" - ], + "tags": ["ContainerService"], "operationId": "ContainerServices_Get", "summary": "Gets the properties of the specified container service.", "description": "Gets the properties of the specified container service in the specified subscription and resource group. The operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. ", @@ -536,9 +466,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2017-07-01" - ] + "enum": ["2017-07-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -553,18 +481,12 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { "deprecated": true, - "tags": [ - "ContainerService" - ], + "tags": ["ContainerService"], "operationId": "ContainerServices_Delete", "summary": "Deletes the specified container service.", "description": "Deletes the specified container service in the specified subscription and resource group. The operation does not delete other resources created as part of creating a container service, including storage accounts, VMs, and availability sets. All the other resources created with the container service are part of the same resource group and can be deleted individually.", @@ -586,9 +508,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2017-07-01" - ] + "enum": ["2017-07-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -604,20 +524,14 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices": { "get": { "deprecated": true, - "tags": [ - "ContainerServices" - ], + "tags": ["ContainerServices"], "operationId": "ContainerServices_ListByResourceGroup", "summary": "Gets a list of container services in the specified resource group.", "description": "Gets a list of container services in the specified subscription and resource group. The operation returns properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents.", @@ -632,9 +546,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2017-07-01" - ] + "enum": ["2017-07-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -652,19 +564,13 @@ "nextLinkName": "nextLink" }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/orchestrators": { "get": { - "tags": [ - "ContainerServices" - ], + "tags": ["ContainerServices"], "operationId": "ContainerServices_ListOrchestrators", "summary": "Gets a list of supported orchestrators in the specified subscription.", "description": "Gets a list of supported orchestrators in the specified subscription. The operation returns properties of each orchestrator including version, available upgrades and whether that version or upgrades are in preview.", @@ -676,9 +582,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2019-08-01" - ] + "enum": ["2019-08-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -699,19 +603,13 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/providers/Microsoft.ContainerService/operations": { "get": { - "tags": [ - "managedClusters" - ], + "tags": ["managedClusters"], "operationId": "Operations_List", "description": "Gets a list of compute operations.", "parameters": [ @@ -722,9 +620,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] } ], "responses": { @@ -744,19 +640,13 @@ "x-ms-pageable": { "nextLinkName": null }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters": { "get": { - "tags": [ - "ManagedClusters" - ], + "tags": ["ManagedClusters"], "operationId": "ManagedClusters_List", "summary": "Gets a list of managed clusters in the specified subscription.", "description": "Gets a list of managed clusters in the specified subscription. The operation returns properties of each managed cluster.", @@ -768,9 +658,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -794,19 +682,13 @@ "nextLinkName": "nextLink" }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters": { "get": { - "tags": [ - "ManagedClusters" - ], + "tags": ["ManagedClusters"], "operationId": "ManagedClusters_ListByResourceGroup", "summary": "Lists managed clusters in the specified subscription and resource group.", "description": "Lists managed clusters in the specified subscription and resource group. The operation returns properties of each managed cluster.", @@ -818,9 +700,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -847,19 +727,13 @@ "nextLinkName": "nextLink" }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default": { "get": { - "tags": [ - "ManagedClusters" - ], + "tags": ["ManagedClusters"], "operationId": "ManagedClusters_GetUpgradeProfile", "summary": "Gets upgrade profile for a managed cluster.", "description": "Gets the details of the upgrade profile for a managed cluster with a specified resource group and name.", @@ -871,9 +745,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -900,20 +772,14 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential": { "post": { "deprecated": true, - "tags": [ - "ManagedClusters" - ], + "tags": ["ManagedClusters"], "operationId": "ManagedClusters_GetAccessProfile", "summary": "Gets an access profile of a managed cluster.", "description": "Gets the accessProfile for the specified role name of the managed cluster with a specified resource group and name. **WARNING**: This API will be deprecated. Instead use [ListClusterUserCredentials](https://docs.microsoft.com/en-us/rest/api/aks/managedclusters/listclusterusercredentials) or [ListClusterAdminCredentials](https://docs.microsoft.com/en-us/rest/api/aks/managedclusters/listclusteradmincredentials) .", @@ -925,9 +791,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -961,19 +825,13 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential": { "post": { - "tags": [ - "ManagedClusters" - ], + "tags": ["ManagedClusters"], "operationId": "ManagedClusters_ListClusterAdminCredentials", "summary": "Gets cluster admin credential of a managed cluster.", "description": "Gets cluster admin credential of the managed cluster with a specified resource group and name.", @@ -985,9 +843,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -1014,19 +870,13 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential": { "post": { - "tags": [ - "ManagedClusters" - ], + "tags": ["ManagedClusters"], "operationId": "ManagedClusters_ListClusterUserCredentials", "summary": "Gets cluster user credential of a managed cluster.", "description": "Gets cluster user credential of the managed cluster with a specified resource group and name.", @@ -1038,9 +888,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -1067,19 +915,13 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential": { "post": { - "tags": [ - "ManagedClusters" - ], + "tags": ["ManagedClusters"], "operationId": "ManagedClusters_ListClusterMonitoringUserCredentials", "summary": "Gets cluster monitoring user credential of a managed cluster.", "description": "Gets cluster monitoring user credential of the managed cluster with a specified resource group and name.", @@ -1091,9 +933,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -1120,19 +960,13 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}": { "get": { - "tags": [ - "ManagedClusters" - ], + "tags": ["ManagedClusters"], "operationId": "ManagedClusters_Get", "summary": "Gets a managed cluster.", "description": "Gets the details of the managed cluster with a specified resource group and name.", @@ -1144,9 +978,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -1173,17 +1005,11 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "put": { - "tags": [ - "ManagedClusters" - ], + "tags": ["ManagedClusters"], "operationId": "ManagedClusters_CreateOrUpdate", "summary": "Creates or updates a managed cluster.", "description": "Creates or updates a managed cluster with the specified configuration for agents and Kubernetes version.", @@ -1195,9 +1021,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -1240,17 +1064,11 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "patch": { - "tags": [ - "ManagedClusters" - ], + "tags": ["ManagedClusters"], "operationId": "ManagedClusters_UpdateTags", "summary": "Updates tags on a managed cluster.", "description": "Updates a managed cluster with the specified tags.", @@ -1262,9 +1080,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -1301,17 +1117,11 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { - "tags": [ - "ManagedClusters" - ], + "tags": ["ManagedClusters"], "operationId": "ManagedClusters_Delete", "summary": "Deletes a managed cluster.", "description": "Deletes the managed cluster with a specified resource group and name.", @@ -1323,9 +1133,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -1353,19 +1161,13 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools": { "get": { - "tags": [ - "AgentPools" - ], + "tags": ["AgentPools"], "operationId": "AgentPools_List", "summary": "Gets a list of agent pools in the specified managed cluster.", "description": "Gets a list of agent pools in the specified managed cluster. The operation returns properties of each agent pool.", @@ -1377,9 +1179,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -1409,19 +1209,13 @@ "nextLinkName": "nextLink" }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}": { "get": { - "tags": [ - "AgentPools" - ], + "tags": ["AgentPools"], "operationId": "AgentPools_Get", "summary": "Gets the agent pool.", "description": "Gets the details of the agent pool by managed cluster and resource group.", @@ -1433,9 +1227,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -1469,17 +1261,11 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "put": { - "tags": [ - "AgentPools" - ], + "tags": ["AgentPools"], "operationId": "AgentPools_CreateOrUpdate", "summary": "Creates or updates an agent pool.", "description": "Creates or updates an agent pool in the specified managed cluster.", @@ -1491,9 +1277,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -1543,17 +1327,11 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { - "tags": [ - "AgentPools" - ], + "tags": ["AgentPools"], "operationId": "AgentPools_Delete", "summary": "Deletes an agent pool.", "description": "Deletes the agent pool in the specified managed cluster.", @@ -1565,9 +1343,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -1602,19 +1378,13 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default": { "get": { - "tags": [ - "AgentPools" - ], + "tags": ["AgentPools"], "operationId": "AgentPools_GetUpgradeProfile", "summary": "Gets upgrade profile for an agent pool.", "description": "Gets the details of the upgrade profile for an agent pool with a specified resource group and managed cluster name.", @@ -1626,9 +1396,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -1662,19 +1430,13 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions": { "get": { - "tags": [ - "AgentPools" - ], + "tags": ["AgentPools"], "operationId": "AgentPools_GetAvailableAgentPoolVersions", "summary": "Gets a list of supported versions for the specified agent pool.", "description": "Gets a list of supported versions for the specified agent pool.", @@ -1686,9 +1448,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -1709,19 +1469,13 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile": { "post": { - "tags": [ - "ManagedClusters" - ], + "tags": ["ManagedClusters"], "operationId": "ManagedClusters_ResetServicePrincipalProfile", "summary": "Reset Service Principal Profile of a managed cluster.", "description": "Update the service principal Profile for a managed cluster.", @@ -1733,9 +1487,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -1772,19 +1524,13 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile": { "post": { - "tags": [ - "ManagedClusters" - ], + "tags": ["ManagedClusters"], "operationId": "ManagedClusters_ResetAADProfile", "summary": "Reset AAD Profile of a managed cluster.", "description": "Update the AAD Profile for a managed cluster.", @@ -1796,9 +1542,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -1835,19 +1579,13 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates": { "post": { - "tags": [ - "ManagedClusters" - ], + "tags": ["ManagedClusters"], "operationId": "ManagedClusters_RotateClusterCertificates", "summary": "Rotate certificates of a managed cluster.", "description": "Rotate certificates of a managed cluster.", @@ -1859,9 +1597,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -1889,19 +1625,13 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections": { "get": { - "tags": [ - "PrivateEndpointConnections" - ], + "tags": ["PrivateEndpointConnections"], "operationId": "PrivateEndpointConnections_List", "summary": "Gets a list of private endpoint connections in the specified managed cluster.", "description": "Gets a list of private endpoint connections in the specified managed cluster. The operation returns properties of each private endpoint connection.", @@ -1913,9 +1643,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -1942,19 +1670,13 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}": { "get": { - "tags": [ - "PrivateEndpointConnections" - ], + "tags": ["PrivateEndpointConnections"], "operationId": "PrivateEndpointConnections_Get", "summary": "Gets the private endpoint connection.", "description": "Gets the details of the private endpoint connection by managed cluster and resource group.", @@ -1966,9 +1688,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -2002,17 +1722,11 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "put": { - "tags": [ - "PrivateEndpointConnections" - ], + "tags": ["PrivateEndpointConnections"], "operationId": "PrivateEndpointConnections_Update", "summary": "Updates a private endpoint connection.", "description": "Updates a private endpoint connection in the specified managed cluster.", @@ -2024,9 +1738,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -2069,17 +1781,11 @@ } }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { - "tags": [ - "PrivateEndpointConnections" - ], + "tags": ["PrivateEndpointConnections"], "operationId": "PrivateEndpointConnections_Delete", "summary": "Deletes a private endpoint connection.", "description": "Deletes the private endpoint connection in the specified managed cluster.", @@ -2091,9 +1797,7 @@ "type": "string", "description": "Client Api Version.", "x-ms-parameter-location": "client", - "enum": [ - "2020-06-01" - ] + "enum": ["2020-06-01"] }, { "$ref": "#/parameters/SubscriptionIdParameter" @@ -2128,12 +1832,8 @@ }, "x-ms-long-running-operation": true, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } } }, @@ -2159,10 +1859,7 @@ "location": { "type": "string", "description": "Resource location", - "x-ms-mutability": [ - "read", - "create" - ] + "x-ms-mutability": ["read", "create"] }, "tags": { "type": "object", @@ -2172,9 +1869,7 @@ "description": "Resource tags" } }, - "required": [ - "location" - ], + "required": ["location"], "x-ms-azure-resource": true }, "CloudError": { @@ -2273,10 +1968,7 @@ "OSType": { "type": "string", "default": "Linux", - "enum": [ - "Linux", - "Windows" - ], + "enum": ["Linux", "Windows"], "x-ms-enum": { "name": "OSType", "modelAsString": true @@ -2328,10 +2020,7 @@ }, "OpenShiftAgentPoolProfileRole": { "type": "string", - "enum": [ - "compute", - "infra" - ], + "enum": ["compute", "infra"], "x-ms-enum": { "name": "OpenShiftAgentPoolProfileRole", "modelAsString": true @@ -2362,10 +2051,7 @@ "description": "OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux." } }, - "required": [ - "count", - "vmSize" - ], + "required": ["count", "vmSize"], "description": "OpenShiftManagedClusterMaterPoolProfile contains configuration for OpenShift master VMs." }, "OpenShiftManagedClusterAgentPoolProfile": { @@ -2397,11 +2083,7 @@ "$ref": "#/definitions/OpenShiftAgentPoolProfileRole" } }, - "required": [ - "name", - "count", - "vmSize" - ], + "required": ["name", "count", "vmSize"], "description": "Defines the configuration of the OpenShift cluster VMs." }, "OpenShiftManagedClusterIdentityProvider": { @@ -2482,9 +2164,7 @@ "description": "Configures OpenShift authentication." } }, - "required": [ - "openShiftVersion" - ], + "required": ["openShiftVersion"], "description": "Properties of the OpenShift managed cluster." }, "OpenShiftManagedCluster": { @@ -2510,9 +2190,7 @@ }, "OpenShiftManagedClusterBaseIdentityProvider": { "discriminator": "kind", - "required": [ - "kind" - ], + "required": ["kind"], "properties": { "kind": { "type": "string", @@ -2592,10 +2270,7 @@ "name": "ContainerServiceStorageProfileTypes", "modelAsString": true }, - "enum": [ - "StorageAccount", - "ManagedDisks" - ], + "enum": ["StorageAccount", "ManagedDisks"], "description": "Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice." }, "ContainerServiceVnetSubnetID": { @@ -2794,9 +2469,7 @@ } }, "description": "Properties to configure a custom container service cluster.", - "required": [ - "orchestrator" - ] + "required": ["orchestrator"] }, "KeyVaultSecretRef": { "properties": { @@ -2814,10 +2487,7 @@ } }, "description": "Reference to a secret stored in Azure Key Vault.", - "required": [ - "vaultID", - "secretName" - ] + "required": ["vaultID", "secretName"] }, "ContainerServiceServicePrincipalProfile": { "properties": { @@ -2835,21 +2505,13 @@ } }, "description": "Information about a service principal identity for the cluster to use for manipulating Azure APIs. Either secret or keyVaultSecretRef must be specified.", - "required": [ - "clientId" - ] + "required": ["clientId"] }, "ContainerServiceOrchestratorProfile": { "properties": { "orchestratorType": { "type": "string", - "enum": [ - "Kubernetes", - "Swarm", - "DCOS", - "DockerCE", - "Custom" - ], + "enum": ["Kubernetes", "Swarm", "DCOS", "DockerCE", "Custom"], "x-ms-enum": { "name": "ContainerServiceOrchestratorTypes", "modelAsString": true @@ -2862,20 +2524,14 @@ } }, "description": "Profile for the container service orchestrator.", - "required": [ - "orchestratorType" - ] + "required": ["orchestratorType"] }, "ContainerServiceMasterProfile": { "properties": { "count": { "type": "integer", "format": "int32", - "enum": [ - 1, - 3, - 5 - ], + "enum": [1, 3, 5], "x-ms-enum": { "name": "Count", "modelAsString": false @@ -2914,10 +2570,7 @@ "description": "FQDN for the master pool." } }, - "required": [ - "dnsPrefix", - "vmSize" - ], + "required": ["dnsPrefix", "vmSize"], "description": "Profile for the container service master." }, "ContainerServiceAgentPoolProfile": { @@ -2973,10 +2626,7 @@ "description": "OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux." } }, - "required": [ - "name", - "vmSize" - ], + "required": ["name", "vmSize"], "description": "Profile for the container service agent pool." }, "ContainerServiceWindowsProfile": { @@ -2992,10 +2642,7 @@ "pattern": "^(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%\\^&\\*\\(\\)])[a-zA-Z\\d!@#$%\\^&\\*\\(\\)]{12,123}$" } }, - "required": [ - "adminUsername", - "adminPassword" - ], + "required": ["adminUsername", "adminPassword"], "description": "Profile for Windows VMs in the container service cluster." }, "ContainerServiceLinuxProfile": { @@ -3010,10 +2657,7 @@ "description": "SSH configuration for Linux-based VMs running on Azure." } }, - "required": [ - "adminUsername", - "ssh" - ], + "required": ["adminUsername", "ssh"], "description": "Profile for Linux VMs in the container service cluster." }, "ContainerServiceSshConfiguration": { @@ -3027,9 +2671,7 @@ } }, "description": "SSH configuration for Linux-based VMs running on Azure.", - "required": [ - "publicKeys" - ] + "required": ["publicKeys"] }, "ContainerServiceSshPublicKey": { "properties": { @@ -3038,9 +2680,7 @@ "description": "Certificate public key used to authenticate with VMs through SSH. The certificate must be in PEM format with or without headers." } }, - "required": [ - "keyData" - ], + "required": ["keyData"], "description": "Contains information about SSH certificate public key data." }, "ContainerServiceDiagnosticsProfile": { @@ -3051,9 +2691,7 @@ } }, "description": "Profile for diagnostics on the container service cluster.", - "required": [ - "vmDiagnostics" - ] + "required": ["vmDiagnostics"] }, "ContainerServiceVMDiagnostics": { "properties": { @@ -3068,9 +2706,7 @@ } }, "description": "Profile for diagnostics on the container service VMs.", - "required": [ - "enabled" - ] + "required": ["enabled"] }, "ContainerService": { "allOf": [ @@ -3149,11 +2785,7 @@ "description": "Profile for diagnostics in the container service cluster." } }, - "required": [ - "orchestratorProfile", - "masterProfile", - "linuxProfile" - ], + "required": ["orchestratorProfile", "masterProfile", "linuxProfile"], "description": "Properties of the container service." }, "OrchestratorProfile": { @@ -3171,9 +2803,7 @@ "description": "Whether Kubernetes version is currently in preview." } }, - "required": [ - "orchestratorVersion" - ], + "required": ["orchestratorVersion"], "description": "Contains information about orchestrator." }, "OrchestratorVersionProfile": { @@ -3202,10 +2832,7 @@ "description": "The list of available upgrade versions." } }, - "required": [ - "orchestratorVersion", - "orchestratorType" - ], + "required": ["orchestratorVersion", "orchestratorType"], "description": "The profile of an orchestrator and its available versions." }, "OrchestratorVersionProfileProperties": { @@ -3218,9 +2845,7 @@ "description": "List of orchestrator version profiles." } }, - "required": [ - "orchestrators" - ], + "required": ["orchestrators"], "description": "The properties of an orchestrator version profile." }, "OrchestratorVersionProfileListResult": { @@ -3246,9 +2871,7 @@ "x-ms-client-flatten": true } }, - "required": [ - "properties" - ], + "required": ["properties"], "description": "The list of versions for supported orchestrators." }, "OperationListResult": { @@ -3342,9 +2965,7 @@ } }, "description": "Information about a service principal identity for the cluster to use for manipulating Azure APIs.", - "required": [ - "clientId" - ] + "required": ["clientId"] }, "ManagedClusterAgentPoolProfileProperties": { "properties": { @@ -3479,17 +3100,12 @@ } } ], - "required": [ - "name" - ], + "required": ["name"], "description": "Profile for the container service agent pool." }, "AgentPoolType": { "type": "string", - "enum": [ - "VirtualMachineScaleSets", - "AvailabilitySet" - ], + "enum": ["VirtualMachineScaleSets", "AvailabilitySet"], "x-ms-enum": { "name": "AgentPoolType", "modelAsString": true @@ -3498,10 +3114,7 @@ }, "AgentPoolMode": { "type": "string", - "enum": [ - "System", - "User" - ], + "enum": ["System", "User"], "x-ms-enum": { "name": "AgentPoolMode", "modelAsString": true @@ -3564,19 +3177,14 @@ "pattern": "^(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%\\^&\\*\\(\\)])[a-zA-Z\\d!@#$%\\^&\\*\\(\\)]{12,123}$" } }, - "required": [ - "adminUsername" - ], + "required": ["adminUsername"], "description": "Profile for Windows VMs in the container service cluster." }, "ContainerServiceNetworkProfile": { "properties": { "networkPlugin": { "type": "string", - "enum": [ - "azure", - "kubenet" - ], + "enum": ["azure", "kubenet"], "default": "kubenet", "x-ms-enum": { "name": "NetworkPlugin", @@ -3586,10 +3194,7 @@ }, "networkPolicy": { "type": "string", - "enum": [ - "calico", - "azure" - ], + "enum": ["calico", "azure"], "x-ms-enum": { "name": "NetworkPolicy", "modelAsString": true @@ -3598,10 +3203,7 @@ }, "networkMode": { "type": "string", - "enum": [ - "transparent", - "bridge" - ], + "enum": ["transparent", "bridge"], "x-ms-enum": { "name": "networkMode", "modelAsString": true @@ -3634,10 +3236,7 @@ }, "outboundType": { "type": "string", - "enum": [ - "loadBalancer", - "userDefinedRouting" - ], + "enum": ["loadBalancer", "userDefinedRouting"], "x-ms-enum": { "name": "outboundType", "modelAsString": true @@ -3647,10 +3246,7 @@ }, "loadBalancerSku": { "type": "string", - "enum": [ - "standard", - "basic" - ], + "enum": ["standard", "basic"], "x-ms-enum": { "name": "loadBalancerSku", "modelAsString": true @@ -3944,11 +3540,7 @@ "type": { "type": "string", "description": "The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service principal will be used instead.", - "enum": [ - "SystemAssigned", - "UserAssigned", - "None" - ], + "enum": ["SystemAssigned", "UserAssigned", "None"], "x-ms-enum": { "name": "ResourceIdentityType", "modelAsString": false @@ -4033,10 +3625,7 @@ }, "osType": { "$ref": "#/definitions/OSType", - "enum": [ - "Linux", - "Windows" - ], + "enum": ["Linux", "Windows"], "x-ms-enum": { "name": "ContainerServiceOSTypes", "modelAsString": true @@ -4061,10 +3650,7 @@ "description": "List of orchestrator types and versions available for upgrade." } }, - "required": [ - "kubernetesVersion", - "osType" - ], + "required": ["kubernetesVersion", "osType"], "description": "The list of available upgrade versions." }, "ManagedClusterUpgradeProfileProperties": { @@ -4081,10 +3667,7 @@ "description": "The list of available upgrade versions for agent pools." } }, - "required": [ - "controlPlaneProfile", - "agentPoolProfiles" - ], + "required": ["controlPlaneProfile", "agentPoolProfiles"], "description": "Control plane and agent pool upgrade profiles." }, "ManagedClusterAADProfile": { @@ -4145,9 +3728,7 @@ ] } }, - "required": [ - "enabled" - ], + "required": ["enabled"], "description": "A Kubernetes add-on profile for a managed cluster." }, "ManagedClusterUpgradeProfile": { @@ -4173,9 +3754,7 @@ "x-ms-client-flatten": true } }, - "required": [ - "properties" - ], + "required": ["properties"], "description": "The list of available upgrades for compute pools." }, "AgentPoolUpgradeProfile": { @@ -4201,9 +3780,7 @@ "x-ms-client-flatten": true } }, - "required": [ - "properties" - ], + "required": ["properties"], "description": "The list of available upgrades for an agent pool." }, "AgentPoolUpgradeProfileProperties": { @@ -4214,10 +3791,7 @@ }, "osType": { "$ref": "#/definitions/OSType", - "enum": [ - "Linux", - "Windows" - ], + "enum": ["Linux", "Windows"], "x-ms-enum": { "name": "ContainerServiceOSTypes", "modelAsString": true @@ -4246,10 +3820,7 @@ "description": "LatestNodeImageVersion is the latest AKS supported node image version." } }, - "required": [ - "kubernetesVersion", - "osType" - ], + "required": ["kubernetesVersion", "osType"], "description": "The list of available upgrade versions." }, "AgentPoolAvailableVersions": { @@ -4275,9 +3846,7 @@ "x-ms-client-flatten": true } }, - "required": [ - "properties" - ], + "required": ["properties"], "description": "The list of available versions for an agent pool." }, "AgentPoolAvailableVersionsProperties": { @@ -4309,10 +3878,7 @@ "ScaleSetPriority": { "type": "string", "default": "Regular", - "enum": [ - "Spot", - "Regular" - ], + "enum": ["Spot", "Regular"], "x-ms-enum": { "name": "ScaleSetPriority", "modelAsString": true @@ -4322,10 +3888,7 @@ "ScaleSetEvictionPolicy": { "type": "string", "default": "Delete", - "enum": [ - "Delete", - "Deallocate" - ], + "enum": ["Delete", "Deallocate"], "x-ms-enum": { "name": "ScaleSetEvictionPolicy", "modelAsString": true @@ -4376,9 +3939,7 @@ "name": { "type": "string", "description": "Name of a managed cluster SKU.", - "enum": [ - "Basic" - ], + "enum": ["Basic"], "x-ms-enum": { "name": "ManagedClusterSKUName", "modelAsString": true @@ -4387,10 +3948,7 @@ "tier": { "type": "string", "description": "Tier of a managed cluster SKU.", - "enum": [ - "Paid", - "Free" - ], + "enum": ["Paid", "Free"], "x-ms-enum": { "name": "ManagedClusterSKUTier", "modelAsString": true @@ -4449,12 +4007,7 @@ "type": "string", "readOnly": true, "description": "The current provisioning state.", - "enum": [ - "Succeeded", - "Creating", - "Deleting", - "Failed" - ], + "enum": ["Succeeded", "Creating", "Deleting", "Failed"], "x-ms-enum": { "name": "PrivateEndpointConnectionProvisioningState", "modelAsString": true @@ -4469,9 +4022,7 @@ "description": "A collection of information about the state of the connection between service consumer and provider." } }, - "required": [ - "privateLinkServiceConnectionState" - ] + "required": ["privateLinkServiceConnectionState"] }, "PrivateEndpoint": { "type": "object", @@ -4488,12 +4039,7 @@ "type": "object", "properties": { "status": { - "enum": [ - "Pending", - "Approved", - "Rejected", - "Disconnected" - ], + "enum": ["Pending", "Approved", "Rejected", "Disconnected"], "type": "string", "description": "The private link service connection status.", "x-ms-enum": { @@ -4562,4 +4108,4 @@ "x-ms-parameter-location": "method" } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/armResource/deploymentmanager.json b/packages/rulesets/src/native/tests/resources/armResource/deploymentmanager.json index 4a53b3e61..3a7dbdf77 100644 --- a/packages/rulesets/src/native/tests/resources/armResource/deploymentmanager.json +++ b/packages/rulesets/src/native/tests/resources/armResource/deploymentmanager.json @@ -6,20 +6,12 @@ "description": "REST APIs for orchestrating deployments using the Azure Deployment Manager (ADM). See https://docs.microsoft.com/en-us/azure/azure-resource-manager/deployment-manager-overview for more information." }, "host": "management.azure.com", - "schemes": [ - "https" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], + "schemes": ["https"], + "consumes": ["application/json"], + "produces": ["application/json"], "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], "paths": { @@ -39,9 +31,7 @@ } ], "put": { - "tags": [ - "ServiceTopologies" - ], + "tags": ["ServiceTopologies"], "operationId": "ServiceTopologies_CreateOrUpdate", "summary": "Creates or updates a service topology.", "description": "Synchronously creates a new service topology or updates an existing service topology.", @@ -73,9 +63,7 @@ } }, "get": { - "tags": [ - "ServiceTopologies" - ], + "tags": ["ServiceTopologies"], "operationId": "ServiceTopologies_Get", "summary": "Gets the service topology.", "x-ms-examples": null, @@ -109,9 +97,7 @@ } }, "delete": { - "tags": [ - "ServiceTopologies" - ], + "tags": ["ServiceTopologies"], "operationId": "ServiceTopologies_Delete", "summary": "Deletes the service topology.", "x-ms-examples": null, @@ -158,9 +144,7 @@ } ], "get": { - "tags": [ - "ServiceTopologies" - ], + "tags": ["ServiceTopologies"], "operationId": "ServiceTopologies_List", "summary": "Lists the service topologies in the resource group.", "x-ms-examples": null, @@ -193,9 +177,7 @@ }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/serviceTopologies/{serviceTopologyName}/services/{serviceName}": { "put": { - "tags": [ - "Services" - ], + "tags": ["Services"], "operationId": "Services_CreateOrUpdate", "summary": "Creates or updates a service in the service topology.", "description": "Synchronously creates a new service or updates an existing service.", @@ -242,9 +224,7 @@ } }, "get": { - "tags": [ - "Services" - ], + "tags": ["Services"], "operationId": "Services_Get", "summary": "Gets the service.", "x-ms-examples": null, @@ -281,9 +261,7 @@ } }, "delete": { - "tags": [ - "Services" - ], + "tags": ["Services"], "operationId": "Services_Delete", "summary": "Deletes the service.", "x-ms-examples": null, @@ -336,9 +314,7 @@ } ], "get": { - "tags": [ - "Services" - ], + "tags": ["Services"], "operationId": "Services_List", "summary": "Lists the services in the service topology.", "x-ms-examples": null, @@ -374,9 +350,7 @@ }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/serviceTopologies/{serviceTopologyName}/services/{serviceName}/serviceUnits/{serviceUnitName}": { "put": { - "tags": [ - "ServiceUnits" - ], + "tags": ["ServiceUnits"], "operationId": "ServiceUnits_CreateOrUpdate", "x-ms-long-running-operation": true, "summary": "Creates or updates a service unit under the service in the service topology.", @@ -433,9 +407,7 @@ } }, "get": { - "tags": [ - "ServiceUnits" - ], + "tags": ["ServiceUnits"], "operationId": "ServiceUnits_Get", "summary": "Gets the service unit.", "x-ms-examples": null, @@ -475,9 +447,7 @@ } }, "delete": { - "tags": [ - "ServiceUnits" - ], + "tags": ["ServiceUnits"], "operationId": "ServiceUnits_Delete", "summary": "Deletes the service unit.", "x-ms-examples": null, @@ -536,9 +506,7 @@ } ], "get": { - "tags": [ - "ServiceUnits" - ], + "tags": ["ServiceUnits"], "operationId": "ServiceUnits_List", "summary": "Lists the service units under a service in the service topology.", "x-ms-examples": null, @@ -577,9 +545,7 @@ }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/steps/{stepName}": { "put": { - "tags": [ - "Steps" - ], + "tags": ["Steps"], "operationId": "Steps_CreateOrUpdate", "summary": "Creates or updates a rollout step with the given step properties.", "description": "Synchronously creates a new step or updates an existing step.", @@ -621,9 +587,7 @@ } }, "get": { - "tags": [ - "Steps" - ], + "tags": ["Steps"], "operationId": "Steps_Get", "summary": "Gets the step.", "parameters": [ @@ -656,9 +620,7 @@ } }, "delete": { - "tags": [ - "Steps" - ], + "tags": ["Steps"], "operationId": "Steps_Delete", "summary": "Deletes the step.", "parameters": [ @@ -704,9 +666,7 @@ } ], "get": { - "tags": [ - "Steps" - ], + "tags": ["Steps"], "operationId": "Steps_List", "summary": "Lists the steps in a resource group.", "parameters": [ @@ -738,9 +698,7 @@ }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/rollouts/{rolloutName}": { "put": { - "tags": [ - "Rollouts" - ], + "tags": ["Rollouts"], "operationId": "Rollouts_CreateOrUpdate", "x-ms-long-running-operation": true, "summary": "Creates or updates a rollout.", @@ -790,9 +748,7 @@ } }, "get": { - "tags": [ - "Rollouts" - ], + "tags": ["Rollouts"], "operationId": "Rollouts_Get", "summary": "Gets detailed information of a rollout.", "x-ms-examples": null, @@ -829,9 +785,7 @@ } }, "delete": { - "tags": [ - "Rollouts" - ], + "tags": ["Rollouts"], "operationId": "Rollouts_Delete", "summary": "Deletes a rollout resource.", "description": "Only rollouts in terminal state can be deleted.", @@ -868,9 +822,7 @@ }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/rollouts/{rolloutName}/cancel": { "post": { - "tags": [ - "Rollouts" - ], + "tags": ["Rollouts"], "operationId": "Rollouts_Cancel", "summary": "Stops a running rollout.", "description": "Only running rollouts can be canceled.", @@ -907,9 +859,7 @@ }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/rollouts/{rolloutName}/restart": { "post": { - "tags": [ - "Rollouts" - ], + "tags": ["Rollouts"], "operationId": "Rollouts_Restart", "summary": "Restarts a failed rollout and optionally skips all succeeded steps.", "description": "Only failed rollouts can be restarted.", @@ -964,9 +914,7 @@ } ], "get": { - "tags": [ - "Rollouts" - ], + "tags": ["Rollouts"], "operationId": "Rollouts_List", "summary": "Lists the rollouts in a resource group.", "x-ms-examples": null, @@ -999,9 +947,7 @@ }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeploymentManager/artifactSources/{artifactSourceName}": { "put": { - "tags": [ - "ArtifactSources" - ], + "tags": ["ArtifactSources"], "operationId": "ArtifactSources_CreateOrUpdate", "summary": "Creates or updates an artifact source.", "description": "Synchronously creates a new artifact source or updates an existing artifact source.", @@ -1044,9 +990,7 @@ } }, "get": { - "tags": [ - "ArtifactSources" - ], + "tags": ["ArtifactSources"], "operationId": "ArtifactSources_Get", "summary": "Gets an artifact source.", "x-ms-examples": null, @@ -1080,9 +1024,7 @@ } }, "delete": { - "tags": [ - "ArtifactSources" - ], + "tags": ["ArtifactSources"], "operationId": "ArtifactSources_Delete", "summary": "Deletes an artifact source.", "x-ms-examples": null, @@ -1129,9 +1071,7 @@ } ], "get": { - "tags": [ - "ArtifactSources" - ], + "tags": ["ArtifactSources"], "operationId": "ArtifactSources_List", "summary": "Lists the artifact sources in a resource group.", "x-ms-examples": null, @@ -1164,9 +1104,7 @@ }, "/providers/Microsoft.DeploymentManager/operations": { "get": { - "tags": [ - "Operations" - ], + "tags": ["Operations"], "operationId": "Operations_List", "summary": "Lists the supported operations.", "x-ms-examples": null, @@ -1211,10 +1149,7 @@ "description": "The list of identities." } }, - "required": [ - "type", - "identityIds" - ] + "required": ["type", "identityIds"] }, "RolloutRequest": { "description": "Defines the PUT rollout request body.", @@ -1234,10 +1169,7 @@ "$ref": "#/definitions/RolloutRequestProperties" } }, - "required": [ - "identity", - "properties" - ] + "required": ["identity", "properties"] }, "RolloutRequestProperties": { "description": "The properties for defining a rollout.", @@ -1265,11 +1197,7 @@ } } }, - "required": [ - "stepGroups", - "targetServiceTopologyId", - "buildVersion" - ] + "required": ["stepGroups", "targetServiceTopologyId", "buildVersion"] }, "StepGroup": { "description": "The properties that define a Step group in a rollout.", @@ -1284,10 +1212,7 @@ "items": { "type": "string" }, - "example": [ - "stepGroup1", - "stepGroup2" - ] + "example": ["stepGroup1", "stepGroup2"] }, "preDeploymentSteps": { "description": "The list of steps to be run before deploying the target.", @@ -1309,10 +1234,7 @@ } } }, - "required": [ - "deploymentTargetId", - "name" - ] + "required": ["deploymentTargetId", "name"] }, "PrePostStep": { "description": "The properties that define a step.", @@ -1323,9 +1245,7 @@ "example": "Microsoft.DeploymentManager/steps/healthCheckStep1" } }, - "required": [ - "stepId" - ] + "required": ["stepId"] }, "ArtifactSource": { "description": "The resource that defines the source location where the artifacts are located.", @@ -1364,10 +1284,7 @@ "$ref": "#/definitions/Authentication" } }, - "required": [ - "sourceType", - "authentication" - ] + "required": ["sourceType", "authentication"] }, "Authentication": { "description": "Defines the authentication method and properties to access the artifacts.", @@ -1379,9 +1296,7 @@ "description": "The authentication type" } }, - "required": [ - "type" - ] + "required": ["type"] }, "SasAuthentication": { "x-ms-discriminator-value": "Sas", @@ -1408,9 +1323,7 @@ "description": "The SAS URI to the Azure Storage blob container. Any offset from the root of the container to where the artifacts are located can be defined in the artifactRoot." } }, - "required": [ - "sasUri" - ] + "required": ["sasUri"] }, "Rollout": { "description": "Defines the rollout.", @@ -1518,9 +1431,7 @@ ] } }, - "required": [ - "properties" - ] + "required": ["properties"] }, "ServiceTopologyProperties": { "description": "The properties of a service topology.", @@ -1549,9 +1460,7 @@ ] } }, - "required": [ - "properties" - ] + "required": ["properties"] }, "Service": { "description": "Defines a service.", @@ -1586,10 +1495,7 @@ "description": "The subscription to which the resources in the service belong to or should be deployed to." } }, - "required": [ - "targetLocation", - "targetSubscriptionId" - ] + "required": ["targetLocation", "targetSubscriptionId"] }, "ServiceUnitResource": { "allOf": [ @@ -1609,9 +1515,7 @@ ] } }, - "required": [ - "properties" - ] + "required": ["properties"] }, "ServiceUnit": { "description": "Defines a service unit.", @@ -1643,10 +1547,7 @@ }, "deploymentMode": { "type": "string", - "enum": [ - "Incremental", - "Complete" - ], + "enum": ["Incremental", "Complete"], "x-ms-enum": { "name": "DeploymentMode", "modelAsString": false @@ -1659,10 +1560,7 @@ "$ref": "#/definitions/ServiceUnitArtifacts" } }, - "required": [ - "targetResourceGroup", - "deploymentMode" - ] + "required": ["targetResourceGroup", "deploymentMode"] }, "ServiceUnitArtifacts": { "description": "Defines the artifacts of a service unit.", @@ -1727,9 +1625,7 @@ "description": "Supplementary informative messages during rollout." } }, - "required": [ - "name" - ] + "required": ["name"] }, "StepOperationInfo": { "description": "Detailed information of a specific step run.", @@ -1920,9 +1816,7 @@ "$ref": "#/definitions/StepProperties" } }, - "required": [ - "properties" - ] + "required": ["properties"] }, "StepProperties": { "description": "The properties of a step resource.", @@ -1932,19 +1826,14 @@ "stepType": { "type": "string", "description": "The type of step.", - "enum": [ - "Wait", - "HealthCheck" - ], + "enum": ["Wait", "HealthCheck"], "x-ms-enum": { "name": "StepType", "modelAsString": false } } }, - "required": [ - "stepType" - ] + "required": ["stepType"] }, "HealthCheckStepProperties": { "x-ms-discriminator-value": "HealthCheck", @@ -1961,9 +1850,7 @@ "$ref": "#/definitions/HealthCheckStepAttributes" } }, - "required": [ - "attributes" - ] + "required": ["attributes"] }, "HealthCheckStepAttributes": { "type": "object", @@ -1991,10 +1878,7 @@ "example": "PT60M" } }, - "required": [ - "type", - "healthyStateDuration" - ] + "required": ["type", "healthyStateDuration"] }, "RestHealthCheckStepAttributes": { "x-ms-discriminator-value": "REST", @@ -2025,9 +1909,7 @@ "description": "The list of checks that form the health check step." } }, - "required": [ - "healthChecks" - ] + "required": ["healthChecks"] }, "RestHealthCheck": { "type": "object", @@ -2046,10 +1928,7 @@ "$ref": "#/definitions/RestResponse" } }, - "required": [ - "name", - "request" - ] + "required": ["name", "request"] }, "RestRequest": { "type": "object", @@ -2058,10 +1937,7 @@ "method": { "type": "string", "description": "The HTTP method to use for the request.", - "enum": [ - "GET", - "POST" - ], + "enum": ["GET", "POST"], "x-ms-enum": { "name": "RestRequestMethod", "modelAsString": false @@ -2076,11 +1952,7 @@ "$ref": "#/definitions/RestRequestAuthentication" } }, - "required": [ - "method", - "uri", - "authentication" - ] + "required": ["method", "uri", "authentication"] }, "RestRequestAuthentication": { "type": "object", @@ -2091,19 +1963,14 @@ "type": "string", "description": "The authentication type.", "example": "ApiKey", - "enum": [ - "ApiKey", - "RolloutIdentity" - ], + "enum": ["ApiKey", "RolloutIdentity"], "x-ms-enum": { "name": "RestAuthType", "modelAsString": false } } }, - "required": [ - "type" - ] + "required": ["type"] }, "RolloutIdentityAuthentication": { "x-ms-discriminator-value": "RolloutIdentity", @@ -2132,10 +1999,7 @@ "in": { "type": "string", "description": "The location of the authentication key/value pair in the request.", - "enum": [ - "Query", - "Header" - ], + "enum": ["Query", "Header"], "x-ms-enum": { "name": "RestAuthLocation", "modelAsString": false @@ -2146,11 +2010,7 @@ "description": "The value of the authentication key/value pair." } }, - "required": [ - "name", - "in", - "value" - ] + "required": ["name", "in", "value"] }, "RestResponse": { "type": "object", @@ -2162,10 +2022,7 @@ "items": { "type": "string" }, - "example": [ - "Ok", - "No Content" - ] + "example": ["Ok", "No Content"] }, "regex": { "type": "object", @@ -2186,10 +2043,7 @@ "matchQuantifier": { "type": "string", "description": "Indicates whether any or all of the expressions should match with the response content.", - "enum": [ - "All", - "Any" - ], + "enum": ["All", "Any"], "x-ms-enum": { "name": "RestMatchQuantifier", "modelAsString": false @@ -2214,9 +2068,7 @@ "$ref": "#/definitions/WaitStepAttributes" } }, - "required": [ - "attributes" - ] + "required": ["attributes"] }, "WaitStepAttributes": { "type": "object", @@ -2228,9 +2080,7 @@ "example": "PT30M" } }, - "required": [ - "duration" - ] + "required": ["duration"] }, "ServiceTopologiesListResult": { "description": "The list of service topologies.", @@ -2326,25 +2176,16 @@ "additionalProperties": { "type": "string" }, - "x-ms-mutability": [ - "read", - "create", - "update" - ], + "x-ms-mutability": ["read", "create", "update"], "description": "Resource tags." }, "location": { "type": "string", - "x-ms-mutability": [ - "read", - "create" - ], + "x-ms-mutability": ["read", "create"], "description": "The geo-location where the resource lives" } }, - "required": [ - "location" - ], + "required": ["location"], "allOf": [ { "$ref": "#/definitions/Resource" @@ -2448,4 +2289,4 @@ } } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/armResource/extensionTrackedResourceNoListBySubscription.json b/packages/rulesets/src/native/tests/resources/armResource/extensionTrackedResourceNoListBySubscription.json index 3cbb681fc..96d8a662f 100644 --- a/packages/rulesets/src/native/tests/resources/armResource/extensionTrackedResourceNoListBySubscription.json +++ b/packages/rulesets/src/native/tests/resources/armResource/extensionTrackedResourceNoListBySubscription.json @@ -60,7 +60,7 @@ }, "produces": ["application/json"], "consumes": ["application/json"] - }, + }, "get": { "tags": ["Clusters"], "operationId": "Clusters_Get", diff --git a/packages/rulesets/src/native/tests/resources/armResource/labservices.json b/packages/rulesets/src/native/tests/resources/armResource/labservices.json index ba732e650..05229477e 100644 --- a/packages/rulesets/src/native/tests/resources/armResource/labservices.json +++ b/packages/rulesets/src/native/tests/resources/armResource/labservices.json @@ -6,15 +6,11 @@ "description": "The Managed Labs Client." }, "host": "management.azure.com", - "schemes": [ - "https" - ], + "schemes": ["https"], "paths": { "/providers/Microsoft.LabServices/operations": { "get": { - "tags": [ - "ProviderOperations" - ], + "tags": ["ProviderOperations"], "description": "Result of the request to list REST API operations", "operationId": "ProviderOperations_List", "parameters": [ @@ -32,27 +28,19 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/providers/Microsoft.LabServices/users/{userName}/getEnvironment": { "post": { - "tags": [ - "GlobalUsers" - ], + "tags": ["GlobalUsers"], "description": "Gets the virtual machine details", "operationId": "GlobalUsers_GetEnvironment", "parameters": [ @@ -99,24 +87,16 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/providers/Microsoft.LabServices/users/{userName}/getOperationBatchStatus": { "post": { - "tags": [ - "GlobalUsers" - ], + "tags": ["GlobalUsers"], "description": "Get batch operation status", "operationId": "GlobalUsers_GetOperationBatchStatus", "parameters": [ @@ -156,24 +136,16 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/providers/Microsoft.LabServices/users/{userName}/getOperationStatus": { "post": { - "tags": [ - "GlobalUsers" - ], + "tags": ["GlobalUsers"], "description": "Gets the status of long running operation", "operationId": "GlobalUsers_GetOperationStatus", "parameters": [ @@ -213,24 +185,16 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/providers/Microsoft.LabServices/users/{userName}/getPersonalPreferences": { "post": { - "tags": [ - "GlobalUsers" - ], + "tags": ["GlobalUsers"], "description": "Get personal preferences for a user", "operationId": "GlobalUsers_GetPersonalPreferences", "parameters": [ @@ -270,24 +234,16 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/providers/Microsoft.LabServices/users/{userName}/listEnvironments": { "post": { - "tags": [ - "GlobalUsers" - ], + "tags": ["GlobalUsers"], "description": "List Environments for the user", "operationId": "GlobalUsers_ListEnvironments", "parameters": [ @@ -327,24 +283,16 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/providers/Microsoft.LabServices/users/{userName}/listLabs": { "post": { - "tags": [ - "GlobalUsers" - ], + "tags": ["GlobalUsers"], "description": "List labs for the user.", "operationId": "GlobalUsers_ListLabs", "parameters": [ @@ -375,24 +323,16 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/providers/Microsoft.LabServices/users/{userName}/register": { "post": { - "tags": [ - "GlobalUsers" - ], + "tags": ["GlobalUsers"], "description": "Register a user to a managed lab", "operationId": "GlobalUsers_Register", "parameters": [ @@ -429,24 +369,16 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/providers/Microsoft.LabServices/users/{userName}/resetPassword": { "post": { - "tags": [ - "GlobalUsers" - ], + "tags": ["GlobalUsers"], "description": "Resets the user password on an environment This operation can take a while to complete", "operationId": "GlobalUsers_ResetPassword", "parameters": [ @@ -486,25 +418,17 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/providers/Microsoft.LabServices/users/{userName}/startEnvironment": { "post": { - "tags": [ - "GlobalUsers" - ], + "tags": ["GlobalUsers"], "description": "Starts an environment by starting all resources inside the environment. This operation can take a while to complete", "operationId": "GlobalUsers_StartEnvironment", "parameters": [ @@ -544,25 +468,17 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/providers/Microsoft.LabServices/users/{userName}/stopEnvironment": { "post": { - "tags": [ - "GlobalUsers" - ], + "tags": ["GlobalUsers"], "description": "Stops an environment by stopping all resources inside the environment This operation can take a while to complete", "operationId": "GlobalUsers_StopEnvironment", "parameters": [ @@ -602,25 +518,17 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.LabServices/labaccounts": { "get": { - "tags": [ - "LabAccounts" - ], + "tags": ["LabAccounts"], "description": "List lab accounts in a subscription.", "operationId": "LabAccounts_ListBySubscription", "parameters": [ @@ -676,28 +584,20 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], "x-ms-pageable": { "nextLinkName": "nextLink" }, "x-ms-odata": "#/definitions/LabAccount", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.LabServices/locations/{locationName}/operations/{operationName}": { "get": { - "tags": [ - "Operations" - ], + "tags": ["Operations"], "description": "Get operation", "operationId": "Operations_Get", "parameters": [ @@ -734,24 +634,16 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts": { "get": { - "tags": [ - "LabAccounts" - ], + "tags": ["LabAccounts"], "description": "List lab accounts in a resource group.", "operationId": "LabAccounts_ListByResourceGroup", "parameters": [ @@ -810,28 +702,20 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], "x-ms-pageable": { "nextLinkName": "nextLink" }, "x-ms-odata": "#/definitions/LabAccount", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}": { "get": { - "tags": [ - "LabAccounts" - ], + "tags": ["LabAccounts"], "description": "Get lab account", "operationId": "LabAccounts_Get", "parameters": [ @@ -875,22 +759,14 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "put": { - "tags": [ - "LabAccounts" - ], + "tags": ["LabAccounts"], "description": "Create or replace an existing Lab Account.", "operationId": "LabAccounts_CreateOrUpdate", "parameters": [ @@ -942,22 +818,14 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { - "tags": [ - "LabAccounts" - ], + "tags": ["LabAccounts"], "description": "Delete lab account. This operation can take a while to complete", "operationId": "LabAccounts_Delete", "parameters": [ @@ -994,23 +862,15 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "patch": { - "tags": [ - "LabAccounts" - ], + "tags": ["LabAccounts"], "description": "Modify properties of lab accounts.", "operationId": "LabAccounts_Update", "parameters": [ @@ -1056,24 +916,16 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/createLab": { "post": { - "tags": [ - "LabAccounts" - ], + "tags": ["LabAccounts"], "description": "Create a lab in a lab account.", "operationId": "LabAccounts_CreateLab", "parameters": [ @@ -1116,24 +968,16 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/galleryimages": { "get": { - "tags": [ - "GalleryImages" - ], + "tags": ["GalleryImages"], "description": "List gallery images in a given lab account.", "operationId": "GalleryImages_List", "parameters": [ @@ -1199,28 +1043,20 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], "x-ms-pageable": { "nextLinkName": "nextLink" }, "x-ms-odata": "#/definitions/GalleryImage", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/galleryimages/{galleryImageName}": { "get": { - "tags": [ - "GalleryImages" - ], + "tags": ["GalleryImages"], "description": "Get gallery image", "operationId": "GalleryImages_Get", "parameters": [ @@ -1271,22 +1107,14 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "put": { - "tags": [ - "GalleryImages" - ], + "tags": ["GalleryImages"], "description": "Create or replace an existing Gallery Image.", "operationId": "GalleryImages_CreateOrUpdate", "parameters": [ @@ -1345,22 +1173,14 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { - "tags": [ - "GalleryImages" - ], + "tags": ["GalleryImages"], "description": "Delete gallery image.", "operationId": "GalleryImages_Delete", "parameters": [ @@ -1404,22 +1224,14 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "patch": { - "tags": [ - "GalleryImages" - ], + "tags": ["GalleryImages"], "description": "Modify properties of gallery images.", "operationId": "GalleryImages_Update", "parameters": [ @@ -1472,24 +1284,16 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/getRegionalAvailability": { "post": { - "tags": [ - "LabAccounts" - ], + "tags": ["LabAccounts"], "description": "Get regional availability information for each size category configured under a lab account", "operationId": "LabAccounts_GetRegionalAvailability", "parameters": [ @@ -1526,24 +1330,16 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs": { "get": { - "tags": [ - "Labs" - ], + "tags": ["Labs"], "description": "List labs in a given lab account.", "operationId": "Labs_List", "parameters": [ @@ -1609,9 +1405,7 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], "x-ms-pageable": { @@ -1619,19 +1413,13 @@ }, "x-ms-odata": "#/definitions/Lab", "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}": { "get": { - "tags": [ - "Labs" - ], + "tags": ["Labs"], "description": "Get lab", "operationId": "Labs_Get", "parameters": [ @@ -1682,22 +1470,14 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "put": { - "tags": [ - "Labs" - ], + "tags": ["Labs"], "description": "Create or replace an existing Lab.", "operationId": "Labs_CreateOrUpdate", "parameters": [ @@ -1756,22 +1536,14 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { - "tags": [ - "Labs" - ], + "tags": ["Labs"], "description": "Delete lab. This operation can take a while to complete", "operationId": "Labs_Delete", "parameters": [ @@ -1815,23 +1587,15 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "patch": { - "tags": [ - "Labs" - ], + "tags": ["Labs"], "description": "Modify properties of labs.", "operationId": "Labs_Update", "parameters": [ @@ -1884,24 +1648,16 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/addUsers": { "post": { - "tags": [ - "Labs" - ], + "tags": ["Labs"], "description": "Add users to a lab", "operationId": "Labs_AddUsers", "parameters": [ @@ -1951,24 +1707,16 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings": { "get": { - "tags": [ - "EnvironmentSettings" - ], + "tags": ["EnvironmentSettings"], "description": "List environment setting in a given lab.", "operationId": "EnvironmentSettings_List", "parameters": [ @@ -2041,28 +1789,20 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], "x-ms-pageable": { "nextLinkName": "nextLink" }, "x-ms-odata": "#/definitions/EnvironmentSetting", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}": { "get": { - "tags": [ - "EnvironmentSettings" - ], + "tags": ["EnvironmentSettings"], "description": "Get environment setting", "operationId": "EnvironmentSettings_Get", "parameters": [ @@ -2120,22 +1860,14 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "put": { - "tags": [ - "EnvironmentSettings" - ], + "tags": ["EnvironmentSettings"], "description": "Create or replace an existing Environment Setting. This operation can take a while to complete", "operationId": "EnvironmentSettings_CreateOrUpdate", "parameters": [ @@ -2201,23 +1933,15 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { - "tags": [ - "EnvironmentSettings" - ], + "tags": ["EnvironmentSettings"], "description": "Delete environment setting. This operation can take a while to complete", "operationId": "EnvironmentSettings_Delete", "parameters": [ @@ -2268,23 +1992,15 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "patch": { - "tags": [ - "EnvironmentSettings" - ], + "tags": ["EnvironmentSettings"], "description": "Modify properties of environment setting.", "operationId": "EnvironmentSettings_Update", "parameters": [ @@ -2344,24 +2060,16 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/claimAny": { "post": { - "tags": [ - "EnvironmentSettings" - ], + "tags": ["EnvironmentSettings"], "description": "Claims a random environment for a user in an environment settings", "operationId": "EnvironmentSettings_ClaimAny", "parameters": [ @@ -2409,24 +2117,16 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments": { "get": { - "tags": [ - "Environments" - ], + "tags": ["Environments"], "description": "List environments in a given environment setting.", "operationId": "Environments_List", "parameters": [ @@ -2506,28 +2206,20 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], "x-ms-pageable": { "nextLinkName": "nextLink" }, "x-ms-odata": "#/definitions/Environment", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}": { "get": { - "tags": [ - "Environments" - ], + "tags": ["Environments"], "description": "Get environment", "operationId": "Environments_Get", "parameters": [ @@ -2592,22 +2284,14 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "put": { - "tags": [ - "Environments" - ], + "tags": ["Environments"], "description": "Create or replace an existing Environment.", "operationId": "Environments_CreateOrUpdate", "parameters": [ @@ -2680,22 +2364,14 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { - "tags": [ - "Environments" - ], + "tags": ["Environments"], "description": "Delete environment. This operation can take a while to complete", "operationId": "Environments_Delete", "parameters": [ @@ -2753,23 +2429,15 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "patch": { - "tags": [ - "Environments" - ], + "tags": ["Environments"], "description": "Modify properties of environments.", "operationId": "Environments_Update", "parameters": [ @@ -2836,24 +2504,16 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}/claim": { "post": { - "tags": [ - "Environments" - ], + "tags": ["Environments"], "description": "Claims the environment and assigns it to the user", "operationId": "Environments_Claim", "parameters": [ @@ -2908,24 +2568,16 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}/resetPassword": { "post": { - "tags": [ - "Environments" - ], + "tags": ["Environments"], "description": "Resets the user password on an environment This operation can take a while to complete", "operationId": "Environments_ResetPassword", "parameters": [ @@ -2992,25 +2644,17 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}/start": { "post": { - "tags": [ - "Environments" - ], + "tags": ["Environments"], "description": "Starts an environment by starting all resources inside the environment. This operation can take a while to complete", "operationId": "Environments_Start", "parameters": [ @@ -3068,25 +2712,17 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}/stop": { "post": { - "tags": [ - "Environments" - ], + "tags": ["Environments"], "description": "Stops an environment by stopping all resources inside the environment This operation can take a while to complete", "operationId": "Environments_Stop", "parameters": [ @@ -3144,25 +2780,17 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/publish": { "post": { - "tags": [ - "EnvironmentSettings" - ], + "tags": ["EnvironmentSettings"], "description": "Provisions/deprovisions required resources for an environment setting based on current state of the lab/environment setting.", "operationId": "EnvironmentSettings_Publish", "parameters": [ @@ -3219,24 +2847,16 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/start": { "post": { - "tags": [ - "EnvironmentSettings" - ], + "tags": ["EnvironmentSettings"], "description": "Starts a template by starting all resources inside the template. This operation can take a while to complete", "operationId": "EnvironmentSettings_Start", "parameters": [ @@ -3287,25 +2907,17 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/stop": { "post": { - "tags": [ - "EnvironmentSettings" - ], + "tags": ["EnvironmentSettings"], "description": "Starts a template by starting all resources inside the template. This operation can take a while to complete", "operationId": "EnvironmentSettings_Stop", "parameters": [ @@ -3356,25 +2968,17 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/register": { "post": { - "tags": [ - "Labs" - ], + "tags": ["Labs"], "description": "Register to managed lab.", "operationId": "Labs_Register", "parameters": [ @@ -3415,24 +3019,16 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/users": { "get": { - "tags": [ - "Users" - ], + "tags": ["Users"], "description": "List users in a given lab.", "operationId": "Users_List", "parameters": [ @@ -3505,28 +3101,20 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], "x-ms-pageable": { "nextLinkName": "nextLink" }, "x-ms-odata": "#/definitions/User", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/users/{userName}": { "get": { - "tags": [ - "Users" - ], + "tags": ["Users"], "description": "Get user", "operationId": "Users_Get", "parameters": [ @@ -3584,22 +3172,14 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "put": { - "tags": [ - "Users" - ], + "tags": ["Users"], "description": "Create or replace an existing User.", "operationId": "Users_CreateOrUpdate", "parameters": [ @@ -3665,22 +3245,14 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { - "tags": [ - "Users" - ], + "tags": ["Users"], "description": "Delete user. This operation can take a while to complete", "operationId": "Users_Delete", "parameters": [ @@ -3731,23 +3303,15 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], "x-ms-long-running-operation": true, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "patch": { - "tags": [ - "Users" - ], + "tags": ["Users"], "description": "Modify properties of users.", "operationId": "Users_Update", "parameters": [ @@ -3807,26 +3371,18 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } } }, "definitions": { "AddUsersPayload": { "description": "Payload for Add Users operation on a Lab.", - "required": [ - "emailAddresses" - ], + "required": ["emailAddresses"], "type": "object", "properties": { "emailAddresses": { @@ -3873,10 +3429,7 @@ }, "CreateLabProperties": { "description": "Properties for creating a managed lab and a default environment setting", - "required": [ - "labCreationParameters", - "name" - ], + "required": ["labCreationParameters", "name"], "type": "object", "properties": { "environmentSettingCreationParameters": { @@ -3991,9 +3544,7 @@ }, "EnvironmentOperationsPayload": { "description": "Represents payload for any Environment operations like get, start, stop, connect", - "required": [ - "environmentId" - ], + "required": ["environmentId"], "type": "object", "properties": { "environmentId": { @@ -4103,9 +3654,7 @@ }, "EnvironmentSettingCreationParameters": { "description": "Settings related to creating an environment setting", - "required": [ - "resourceSettingCreationParameters" - ], + "required": ["resourceSettingCreationParameters"], "type": "object", "properties": { "resourceSettingCreationParameters": { @@ -4132,20 +3681,12 @@ }, "EnvironmentSettingProperties": { "description": "Properties of an environment setting", - "required": [ - "resourceSettings" - ], + "required": ["resourceSettings"], "type": "object", "properties": { "publishingState": { "description": "Describes the readiness of this environment setting", - "enum": [ - "Draft", - "Publishing", - "Published", - "PublishFailed", - "Scaling" - ], + "enum": ["Draft", "Publishing", "Published", "PublishFailed", "Scaling"], "type": "string", "readOnly": true, "x-ms-enum": { @@ -4177,10 +3718,7 @@ }, "configurationState": { "description": "Describes the user's progress in configuring their environment setting", - "enum": [ - "NotApplicable", - "Completed" - ], + "enum": ["NotApplicable", "Completed"], "type": "string", "x-ms-enum": { "name": "ConfigurationState", @@ -4242,10 +3780,7 @@ "properties": { "configurationState": { "description": "Describes the user's progress in configuring their environment setting", - "enum": [ - "NotApplicable", - "Completed" - ], + "enum": ["NotApplicable", "Completed"], "type": "string", "x-ms-enum": { "name": "ConfigurationState", @@ -4290,11 +3825,7 @@ "properties": { "name": { "description": "The size category", - "enum": [ - "Basic", - "Standard", - "Performance" - ], + "enum": ["Basic", "Standard", "Performance"], "type": "string", "x-ms-enum": { "name": "ManagedLabVmSize", @@ -4348,11 +3879,7 @@ "properties": { "name": { "description": "The size category", - "enum": [ - "Basic", - "Standard", - "Performance" - ], + "enum": ["Basic", "Standard", "Performance"], "type": "string", "x-ms-enum": { "name": "ManagedLabVmSize", @@ -4772,10 +4299,7 @@ }, "userAccessMode": { "description": "Lab user access mode (open to all vs. restricted to those listed on the lab).", - "enum": [ - "Restricted", - "Open" - ], + "enum": ["Restricted", "Open"], "type": "string", "x-ms-enum": { "name": "LabUserAccessMode", @@ -4834,10 +4358,7 @@ }, "userAccessMode": { "description": "Lab user access mode (open to all vs. restricted to those listed on the lab).", - "enum": [ - "Restricted", - "Open" - ], + "enum": ["Restricted", "Open"], "type": "string", "x-ms-enum": { "name": "LabUserAccessMode", @@ -4974,9 +4495,7 @@ }, "OperationBatchStatusPayload": { "description": "Payload to get the status of an operation", - "required": [ - "urls" - ], + "required": ["urls"], "type": "object", "properties": { "urls": { @@ -5084,9 +4603,7 @@ }, "OperationStatusPayload": { "description": "Payload to get the status of an operation", - "required": [ - "operationUrl" - ], + "required": ["operationUrl"], "type": "object", "properties": { "operationUrl": { @@ -5116,10 +4633,7 @@ }, "addRemove": { "description": "Enum indicating if user is adding or removing a favorite lab", - "enum": [ - "Add", - "Remove" - ], + "enum": ["Add", "Remove"], "type": "string", "x-ms-enum": { "name": "AddRemove", @@ -5172,9 +4686,7 @@ }, "ReferenceVm": { "description": "Details of a Reference Vm", - "required": [ - "userName" - ], + "required": ["userName"], "type": "object", "properties": { "userName": { @@ -5199,10 +4711,7 @@ }, "ReferenceVmCreationParameters": { "description": "Creation parameters for Reference Vm", - "required": [ - "userName", - "password" - ], + "required": ["userName", "password"], "type": "object", "properties": { "userName": { @@ -5258,9 +4767,7 @@ }, "ResetPasswordPayload": { "description": "Represents the payload for resetting passwords.", - "required": [ - "environmentId" - ], + "required": ["environmentId"], "type": "object", "properties": { "environmentId": { @@ -5340,10 +4847,7 @@ }, "ResourceSettingCreationParameters": { "description": "Represents resource specific settings", - "required": [ - "galleryImageResourceId", - "referenceVmCreationParameters" - ], + "required": ["galleryImageResourceId", "referenceVmCreationParameters"], "type": "object", "properties": { "location": { @@ -5360,11 +4864,7 @@ }, "size": { "description": "The size of the virtual machine", - "enum": [ - "Basic", - "Standard", - "Performance" - ], + "enum": ["Basic", "Standard", "Performance"], "type": "string", "x-ms-enum": { "name": "ManagedLabVmSize", @@ -5393,9 +4893,7 @@ }, "ResourceSettings": { "description": "Represents resource specific settings", - "required": [ - "referenceVm" - ], + "required": ["referenceVm"], "type": "object", "properties": { "id": { @@ -5414,11 +4912,7 @@ }, "size": { "description": "The size of the virtual machine", - "enum": [ - "Basic", - "Standard", - "Performance" - ], + "enum": ["Basic", "Standard", "Performance"], "type": "string", "x-ms-enum": { "name": "ManagedLabVmSize", @@ -5461,11 +4955,7 @@ }, "size": { "description": "The size of the virtual machine", - "enum": [ - "Basic", - "Standard", - "Performance" - ], + "enum": ["Basic", "Standard", "Performance"], "type": "string", "x-ms-enum": { "name": "ManagedLabVmSize", @@ -5600,11 +5090,7 @@ "properties": { "sizeCategory": { "description": "The category of the size (Basic, Standard, Performance).", - "enum": [ - "Basic", - "Standard", - "Performance" - ], + "enum": ["Basic", "Standard", "Performance"], "type": "string", "x-ms-enum": { "name": "ManagedLabVmSize", @@ -5912,9 +5398,7 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ] -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/armResource/machinelearning.json b/packages/rulesets/src/native/tests/resources/armResource/machinelearning.json index cb8fb24ef..f5cdce874 100644 --- a/packages/rulesets/src/native/tests/resources/armResource/machinelearning.json +++ b/packages/rulesets/src/native/tests/resources/armResource/machinelearning.json @@ -10,9 +10,7 @@ "description": "Migrate your workloads to Azure." }, "host": "management.azure.com", - "schemes": [ - "https" - ], + "schemes": ["https"], "parameters": { "subscriptionId": { "name": "subscriptionId", @@ -99,9 +97,7 @@ "type": "string", "in": "query", "required": true, - "enum": [ - "2018-09-01-preview" - ] + "enum": ["2018-09-01-preview"] }, "acceptLanguage": { "description": "Standard request header. Used by service to respond to client in appropriate language.", @@ -124,17 +120,13 @@ }, "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/migrateProjects/{migrateProjectName}/databaseInstances": { "get": { - "tags": [ - "DatabaseInstances" - ], + "tags": ["DatabaseInstances"], "summary": "Gets a list of database instances in the migrate project.", "operationId": "DatabaseInstances_EnumerateDatabaseInstances", "parameters": [ @@ -170,19 +162,13 @@ }, "deprecated": false, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/migrateProjects/{migrateProjectName}/databaseInstances/{databaseInstanceName}": { "get": { - "tags": [ - "DatabaseInstances" - ], + "tags": ["DatabaseInstances"], "summary": "Gets a database instance in the migrate project.", "operationId": "DatabaseInstances_GetDatabaseInstance", "parameters": [ @@ -215,19 +201,13 @@ }, "deprecated": false, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/migrateProjects/{migrateProjectName}/databases": { "get": { - "tags": [ - "Databases" - ], + "tags": ["Databases"], "summary": "Gets a list of databases in the migrate project.", "operationId": "Databases_EnumerateDatabases", "parameters": [ @@ -263,19 +243,13 @@ }, "deprecated": false, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/migrateProjects/{migrateProjectName}/databases/{databaseName}": { "get": { - "tags": [ - "Databases" - ], + "tags": ["Databases"], "summary": "Gets a database in the migrate project.", "operationId": "Databases_GetDatabase", "parameters": [ @@ -308,19 +282,13 @@ }, "deprecated": false, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/migrateProjects/{migrateProjectName}/migrateEvents": { "get": { - "tags": [ - "Events" - ], + "tags": ["Events"], "summary": "Gets a list of events in the migrate project.", "operationId": "Events_EnumerateEvents", "parameters": [ @@ -356,19 +324,13 @@ }, "deprecated": false, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/migrateProjects/{migrateProjectName}/migrateEvents/{eventName}": { "get": { - "tags": [ - "Events" - ], + "tags": ["Events"], "summary": "Gets an event in the migrate project.", "operationId": "Events_GetEvent", "parameters": [ @@ -398,17 +360,11 @@ }, "deprecated": false, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { - "tags": [ - "Events" - ], + "tags": ["Events"], "summary": "Delete the migrate event", "description": "Delete the migrate event. Deleting non-existent migrate event is a no-operation.", "operationId": "Events_DeleteEvent", @@ -436,19 +392,13 @@ }, "deprecated": false, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/migrateProjects/{migrateProjectName}/machines": { "get": { - "tags": [ - "Machines" - ], + "tags": ["Machines"], "summary": "Gets a list of machines in the migrate project.", "operationId": "Machines_EnumerateMachines", "parameters": [ @@ -481,19 +431,13 @@ }, "deprecated": false, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/migrateProjects/{migrateProjectName}/machines/{machineName}": { "get": { - "tags": [ - "Machines" - ], + "tags": ["Machines"], "summary": "Gets a machine in the migrate project.", "operationId": "Machines_GetMachine", "parameters": [ @@ -523,19 +467,13 @@ }, "deprecated": false, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/migrateProjects/{migrateProjectName}": { "get": { - "tags": [ - "MigrateProjects" - ], + "tags": ["MigrateProjects"], "summary": "Method to get a migrate project.", "operationId": "MigrateProjects_GetMigrateProject", "parameters": [ @@ -562,17 +500,11 @@ }, "deprecated": false, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "put": { - "tags": [ - "MigrateProjects" - ], + "tags": ["MigrateProjects"], "summary": "Method to create or update a migrate project.", "operationId": "MigrateProjects_PutMigrateProject", "parameters": [ @@ -617,17 +549,11 @@ }, "deprecated": false, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "patch": { - "tags": [ - "MigrateProjects" - ], + "tags": ["MigrateProjects"], "summary": "Update migrate project.", "description": "Update a migrate project with specified name. Supports partial updates, for example only tags can be provided.", "operationId": "MigrateProjects_PatchMigrateProject", @@ -667,17 +593,11 @@ }, "deprecated": false, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { - "tags": [ - "MigrateProjects" - ], + "tags": ["MigrateProjects"], "summary": "Delete the migrate project", "description": "Delete the migrate project. Deleting non-existent project is a no-operation.", "operationId": "MigrateProjects_DeleteMigrateProject", @@ -705,19 +625,13 @@ }, "deprecated": false, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/migrateProjects/{migrateProjectName}/registerTool": { "post": { - "tags": [ - "MigrateProjects" - ], + "tags": ["MigrateProjects"], "summary": "Registers a tool with the migrate project.", "operationId": "MigrateProjects_RegisterTool", "parameters": [ @@ -756,19 +670,13 @@ }, "deprecated": false, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/migrateProjects/{migrateProjectName}/refreshSummary": { "post": { - "tags": [ - "MigrateProjects" - ], + "tags": ["MigrateProjects"], "summary": "Refresh the summary of the migrate project.", "operationId": "MigrateProjects_RefreshMigrateProjectSummary", "parameters": [ @@ -804,19 +712,13 @@ }, "deprecated": false, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/migrateProjects/{migrateProjectName}/solutions/{solutionName}": { "get": { - "tags": [ - "Solutions" - ], + "tags": ["Solutions"], "summary": "Gets a solution in the migrate project.", "operationId": "Solutions_GetSolution", "parameters": [ @@ -846,17 +748,11 @@ }, "deprecated": false, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "put": { - "tags": [ - "Solutions" - ], + "tags": ["Solutions"], "summary": "Creates a solution in the migrate project.", "operationId": "Solutions_PutSolution", "parameters": [ @@ -901,17 +797,11 @@ }, "deprecated": false, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "patch": { - "tags": [ - "Solutions" - ], + "tags": ["Solutions"], "summary": "Update solution.", "description": "Update a solution with specified name. Supports partial updates, for example only tags can be provided.", "operationId": "Solutions_PatchSolution", @@ -951,17 +841,11 @@ }, "deprecated": false, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { - "tags": [ - "Solutions" - ], + "tags": ["Solutions"], "summary": "Delete the solution", "description": "Delete the solution. Deleting non-existent project is a no-operation.", "operationId": "Solutions_DeleteSolution", @@ -992,19 +876,13 @@ }, "deprecated": false, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/migrateProjects/{migrateProjectName}/solutions": { "get": { - "tags": [ - "Solutions" - ], + "tags": ["Solutions"], "summary": "Gets the list of solutions in the migrate project.", "operationId": "Solutions_EnumerateSolutions", "parameters": [ @@ -1031,19 +909,13 @@ }, "deprecated": false, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/migrateProjects/{migrateProjectName}/solutions/{solutionName}/getConfig": { "post": { - "tags": [ - "Solutions" - ], + "tags": ["Solutions"], "summary": "Gets the config for the solution in the migrate project.", "operationId": "Solutions_GetConfig", "parameters": [ @@ -1073,19 +945,13 @@ }, "deprecated": false, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/migrateProjects/{migrateProjectName}/solutions/{solutionName}/cleanupData": { "post": { - "tags": [ - "Solutions" - ], + "tags": ["Solutions"], "summary": "Cleanup the solution data in the migrate project.", "operationId": "Solutions_CleanupSolutionData", "parameters": [ @@ -1112,12 +978,8 @@ }, "deprecated": false, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/providers/Microsoft.Migrate/operations": { @@ -1137,12 +999,8 @@ "nextLinkName": null }, "x-ms-examples": null, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } } }, @@ -1634,18 +1492,7 @@ "type": "object", "properties": { "typeKind": { - "enum": [ - "None", - "Primitive", - "Entity", - "Complex", - "Collection", - "EntityReference", - "Enum", - "TypeDefinition", - "Untyped", - "Path" - ], + "enum": ["None", "Primitive", "Entity", "Complex", "Collection", "EntityReference", "Enum", "TypeDefinition", "Untyped", "Path"], "type": "string", "readOnly": true } @@ -1767,14 +1614,7 @@ "type": "object", "properties": { "schemaElementKind": { - "enum": [ - "None", - "TypeDefinition", - "Term", - "Action", - "EntityContainer", - "Function" - ], + "enum": ["None", "TypeDefinition", "Term", "Action", "EntityContainer", "Function"], "type": "string", "readOnly": true }, @@ -1824,14 +1664,7 @@ "readOnly": true }, "schemaElementKind": { - "enum": [ - "None", - "TypeDefinition", - "Term", - "Action", - "EntityContainer", - "Function" - ], + "enum": ["None", "TypeDefinition", "Term", "Action", "EntityContainer", "Function"], "type": "string", "readOnly": true }, @@ -1930,12 +1763,7 @@ "type": "object", "properties": { "kind": { - "enum": [ - "Aggregate", - "GroupBy", - "Filter", - "Compute" - ], + "enum": ["Aggregate", "GroupBy", "Filter", "Compute"], "type": "string", "readOnly": true } @@ -2037,14 +1865,7 @@ "readOnly": true }, "schemaElementKind": { - "enum": [ - "None", - "TypeDefinition", - "Term", - "Action", - "EntityContainer", - "Function" - ], + "enum": ["None", "TypeDefinition", "Term", "Action", "EntityContainer", "Function"], "type": "string", "readOnly": true }, @@ -2103,13 +1924,7 @@ "type": "object", "properties": { "containerElementKind": { - "enum": [ - "None", - "EntitySet", - "ActionImport", - "FunctionImport", - "Singleton" - ], + "enum": ["None", "EntitySet", "ActionImport", "FunctionImport", "Singleton"], "type": "string", "readOnly": true }, @@ -2131,10 +1946,7 @@ "readOnly": true }, "onDelete": { - "enum": [ - "None", - "Cascade" - ], + "enum": ["None", "Cascade"], "type": "string", "readOnly": true }, @@ -2147,11 +1959,7 @@ "readOnly": true }, "propertyKind": { - "enum": [ - "None", - "Structural", - "Navigation" - ], + "enum": ["None", "Structural", "Navigation"], "type": "string", "readOnly": true }, @@ -2204,18 +2012,7 @@ "readOnly": true }, "typeKind": { - "enum": [ - "None", - "Primitive", - "Entity", - "Complex", - "Collection", - "EntityReference", - "Enum", - "TypeDefinition", - "Untyped", - "Path" - ], + "enum": ["None", "Primitive", "Entity", "Complex", "Collection", "EntityReference", "Enum", "TypeDefinition", "Untyped", "Path"], "type": "string", "readOnly": true } @@ -2238,11 +2035,7 @@ "type": "object", "properties": { "propertyKind": { - "enum": [ - "None", - "Structural", - "Navigation" - ], + "enum": ["None", "Structural", "Navigation"], "type": "string", "readOnly": true }, @@ -2268,11 +2061,7 @@ "readOnly": true }, "propertyKind": { - "enum": [ - "None", - "Structural", - "Navigation" - ], + "enum": ["None", "Structural", "Navigation"], "type": "string", "readOnly": true }, @@ -2686,25 +2475,13 @@ }, "refreshSummaryState": { "description": "Gets the refresh summary state.", - "enum": [ - "Started", - "InProgress", - "Completed", - "Failed" - ], + "enum": ["Started", "InProgress", "Completed", "Failed"], "type": "string", "readOnly": true }, "provisioningState": { "type": "string", - "enum": [ - "Accepted", - "Creating", - "Deleting", - "Failed", - "Moving", - "Succeeded" - ], + "enum": ["Accepted", "Creating", "Deleting", "Failed", "Moving", "Succeeded"], "description": "Provisioning state of the migrate project.", "x-ms-enum": { "name": "ProvisioningState", @@ -2724,12 +2501,7 @@ }, "refreshSummaryState": { "description": "Gets or sets the state of refresh summary.", - "enum": [ - "Started", - "InProgress", - "Completed", - "Failed" - ], + "enum": ["Started", "InProgress", "Completed", "Failed"], "type": "string" }, "lastSummaryRefreshedTime": { @@ -2797,10 +2569,7 @@ "properties": { "goal": { "description": "Gets or sets the goal for which summary needs to be refreshed.", - "enum": [ - "Servers", - "Databases" - ], + "enum": ["Servers", "Databases"], "type": "string" } } @@ -2859,38 +2628,22 @@ }, "purpose": { "description": "Gets or sets the purpose of the solution.", - "enum": [ - "Discovery", - "Assessment", - "Migration" - ], + "enum": ["Discovery", "Assessment", "Migration"], "type": "string" }, "goal": { "description": "Gets or sets the goal of the solution.", - "enum": [ - "Servers", - "Databases" - ], + "enum": ["Servers", "Databases"], "type": "string" }, "status": { "description": "Gets or sets the current status of the solution.", - "enum": [ - "Inactive", - "Active" - ], + "enum": ["Inactive", "Active"], "type": "string" }, "cleanupState": { "description": "Gets or sets the cleanup state of the solution.", - "enum": [ - "None", - "Started", - "InProgress", - "Completed", - "Failed" - ], + "enum": ["None", "Started", "InProgress", "Completed", "Failed"], "type": "string" }, "summary": { @@ -3174,4 +2927,4 @@ } } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/armResource/security.json b/packages/rulesets/src/native/tests/resources/armResource/security.json index 587998fc6..8e693199d 100644 --- a/packages/rulesets/src/native/tests/resources/armResource/security.json +++ b/packages/rulesets/src/native/tests/resources/armResource/security.json @@ -5,14 +5,10 @@ "description": "API spec for Microsoft.Security (Azure Security Center) resource provider" }, "host": "management.azure.com", - "schemes": [ - "https" - ], + "schemes": ["https"], "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], "securityDefinitions": { @@ -30,9 +26,7 @@ "/{scope}/providers/Microsoft.Security/complianceResults": { "get": { "x-ms-examples": null, - "tags": [ - "Compliance Results" - ], + "tags": ["Compliance Results"], "description": "Security compliance results in the subscription", "operationId": "ComplianceResults_List", "parameters": [ @@ -42,9 +36,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2017-08-01" - ] + "enum": ["2017-08-01"] }, { "$ref": "#/parameters/Scope" @@ -67,20 +59,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/{resourceId}/providers/Microsoft.Security/complianceResults/{complianceResultName}": { "get": { "x-ms-examples": null, - "tags": [ - "Compliance Results" - ], + "tags": ["Compliance Results"], "description": "Security Compliance Result", "operationId": "ComplianceResults_Get", "parameters": [ @@ -90,9 +76,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2017-08-01" - ] + "enum": ["2017-08-01"] }, { "$ref": "#/parameters/ResourceId" @@ -115,20 +99,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings": { "get": { "x-ms-examples": null, - "tags": [ - "Pricings" - ], + "tags": ["Pricings"], "description": "Lists Security Center pricing configurations in the subscription.", "operationId": "Pricings_List", "parameters": [ @@ -138,9 +116,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2018-06-01" - ] + "enum": ["2018-06-01"] }, { "$ref": "#/parameters/SubscriptionId" @@ -160,20 +136,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}": { "get": { "x-ms-examples": null, - "tags": [ - "Pricings" - ], + "tags": ["Pricings"], "description": "Gets a provided Security Center pricing configuration in the subscription.", "operationId": "Pricings_Get", "parameters": [ @@ -183,9 +153,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2018-06-01" - ] + "enum": ["2018-06-01"] }, { "$ref": "#/parameters/SubscriptionId" @@ -208,18 +176,12 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "put": { "x-ms-examples": null, - "tags": [ - "Pricings" - ], + "tags": ["Pricings"], "description": "Updates a provided Security Center pricing configuration in the subscription.", "operationId": "Pricings_Update", "parameters": [ @@ -229,9 +191,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2018-06-01" - ] + "enum": ["2018-06-01"] }, { "$ref": "#/parameters/SubscriptionId" @@ -257,20 +217,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alerts": { "get": { "x-ms-examples": null, - "tags": [ - "Alerts" - ], + "tags": ["Alerts"], "description": "List all the alerts that are associated with the subscription", "operationId": "Alerts_List", "parameters": [ @@ -280,9 +234,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-01-01" - ] + "enum": ["2019-01-01"] }, { "$ref": "#/parameters/SubscriptionId" @@ -317,20 +269,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/alerts": { "get": { "x-ms-examples": null, - "tags": [ - "Alerts" - ], + "tags": ["Alerts"], "description": "List all the alerts that are associated with the resource group", "operationId": "Alerts_ListByResourceGroup", "parameters": [ @@ -340,9 +286,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-01-01" - ] + "enum": ["2019-01-01"] }, { "$ref": "#/parameters/SubscriptionId" @@ -380,20 +324,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts": { "get": { "x-ms-examples": null, - "tags": [ - "Alerts" - ], + "tags": ["Alerts"], "description": "List all the alerts that are associated with the subscription that are stored in a specific location", "operationId": "Alerts_ListSubscriptionLevelAlertsByRegion", "parameters": [ @@ -403,9 +341,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-01-01" - ] + "enum": ["2019-01-01"] }, { "$ref": "#/parameters/SubscriptionId" @@ -443,20 +379,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts": { "get": { "x-ms-examples": null, - "tags": [ - "Alerts" - ], + "tags": ["Alerts"], "description": "List all the alerts that are associated with the resource group that are stored in a specific location", "operationId": "Alerts_ListResourceGroupLevelAlertsByRegion", "parameters": [ @@ -466,9 +396,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-01-01" - ] + "enum": ["2019-01-01"] }, { "$ref": "#/parameters/SubscriptionId" @@ -509,20 +437,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}": { "get": { "x-ms-examples": null, - "tags": [ - "Alerts" - ], + "tags": ["Alerts"], "description": "Get an alert that is associated with a subscription", "operationId": "Alerts_GetSubscriptionLevelAlert", "parameters": [ @@ -532,9 +454,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-01-01" - ] + "enum": ["2019-01-01"] }, { "$ref": "#/parameters/SubscriptionId" @@ -560,20 +480,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}": { "get": { "x-ms-examples": null, - "tags": [ - "Alerts" - ], + "tags": ["Alerts"], "description": "Get an alert that is associated a resource group or a resource in a resource group", "operationId": "Alerts_GetResourceGroupLevelAlerts", "parameters": [ @@ -583,9 +497,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-01-01" - ] + "enum": ["2019-01-01"] }, { "$ref": "#/parameters/SubscriptionId" @@ -614,20 +526,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss": { "post": { "x-ms-examples": null, - "tags": [ - "Alerts" - ], + "tags": ["Alerts"], "description": "Update the alert's state", "operationId": "Alerts_UpdateSubscriptionLevelAlertStateToDismiss", "parameters": [ @@ -637,9 +543,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-01-01" - ] + "enum": ["2019-01-01"] }, { "$ref": "#/parameters/SubscriptionId" @@ -662,20 +566,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/reactivate": { "post": { "x-ms-examples": null, - "tags": [ - "Alerts" - ], + "tags": ["Alerts"], "description": "Update the alert's state", "operationId": "Alerts_UpdateSubscriptionLevelAlertStateToReactivate", "parameters": [ @@ -685,9 +583,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-01-01" - ] + "enum": ["2019-01-01"] }, { "$ref": "#/parameters/SubscriptionId" @@ -710,20 +606,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss": { "post": { "x-ms-examples": null, - "tags": [ - "Alerts" - ], + "tags": ["Alerts"], "description": "Update the alert's state", "operationId": "Alerts_UpdateResourceGroupLevelAlertStateToDismiss", "parameters": [ @@ -733,9 +623,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-01-01" - ] + "enum": ["2019-01-01"] }, { "$ref": "#/parameters/SubscriptionId" @@ -761,20 +649,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/reactivate": { "post": { "x-ms-examples": null, - "tags": [ - "Alerts" - ], + "tags": ["Alerts"], "description": "Update the alert's state", "operationId": "Alerts_UpdateResourceGroupLevelAlertStateToReactivate", "parameters": [ @@ -784,9 +666,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-01-01" - ] + "enum": ["2019-01-01"] }, { "$ref": "#/parameters/SubscriptionId" @@ -812,20 +692,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings": { "get": { "x-ms-examples": null, - "tags": [ - "Settings" - ], + "tags": ["Settings"], "description": "Settings about different configurations in security center", "operationId": "Settings_List", "parameters": [ @@ -835,9 +709,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-01-01" - ] + "enum": ["2019-01-01"] }, { "$ref": "#/parameters/SubscriptionId" @@ -860,20 +732,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}": { "get": { "x-ms-examples": null, - "tags": [ - "Settings" - ], + "tags": ["Settings"], "description": "Settings of different configurations in security center", "operationId": "Settings_Get", "parameters": [ @@ -883,9 +749,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-01-01" - ] + "enum": ["2019-01-01"] }, { "$ref": "#/parameters/SubscriptionId" @@ -908,18 +772,12 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "put": { "x-ms-examples": null, - "tags": [ - "Settings" - ], + "tags": ["Settings"], "description": "updating settings about different configurations in security center", "operationId": "Settings_Update", "parameters": [ @@ -929,9 +787,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-01-01" - ] + "enum": ["2019-01-01"] }, { "$ref": "#/parameters/SubscriptionId" @@ -957,20 +813,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName}": { "get": { "x-ms-examples": null, - "tags": [ - "AdvancedThreatProtection" - ], + "tags": ["AdvancedThreatProtection"], "description": "Gets the Advanced Threat Protection settings for the specified resource.", "operationId": "AdvancedThreatProtection_Get", "parameters": [ @@ -980,9 +830,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-01-01" - ] + "enum": ["2019-01-01"] }, { "$ref": "#/parameters/ResourceId" @@ -1005,18 +853,12 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "put": { "x-ms-examples": null, - "tags": [ - "AdvancedThreatProtection" - ], + "tags": ["AdvancedThreatProtection"], "description": "Creates or updates the Advanced Threat Protection settings on a specified resource.", "operationId": "AdvancedThreatProtection_Create", "parameters": [ @@ -1026,9 +868,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-01-01" - ] + "enum": ["2019-01-01"] }, { "$ref": "#/parameters/ResourceId" @@ -1054,20 +894,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups": { "get": { "x-ms-examples": null, - "tags": [ - "DeviceSecurityGroups" - ], + "tags": ["DeviceSecurityGroups"], "description": "Use this method get the list of device security groups for the specified IoT Hub resource.", "operationId": "DeviceSecurityGroups_List", "parameters": [ @@ -1077,9 +911,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-08-01" - ] + "enum": ["2019-08-01"] }, { "$ref": "#/parameters/ResourceId" @@ -1102,20 +934,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}": { "get": { "x-ms-examples": null, - "tags": [ - "DeviceSecurityGroups" - ], + "tags": ["DeviceSecurityGroups"], "description": "Use this method to get the device security group for the specified IoT Hub resource.", "operationId": "DeviceSecurityGroups_Get", "parameters": [ @@ -1125,9 +951,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-08-01" - ] + "enum": ["2019-08-01"] }, { "$ref": "#/parameters/ResourceId" @@ -1150,18 +974,12 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "put": { "x-ms-examples": null, - "tags": [ - "DeviceSecurityGroups" - ], + "tags": ["DeviceSecurityGroups"], "description": "Use this method to creates or updates the device security group on a specified IoT Hub resource.", "operationId": "DeviceSecurityGroups_CreateOrUpdate", "parameters": [ @@ -1171,9 +989,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-08-01" - ] + "enum": ["2019-08-01"] }, { "$ref": "#/parameters/ResourceId" @@ -1205,18 +1021,12 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { "x-ms-examples": null, - "tags": [ - "DeviceSecurityGroups" - ], + "tags": ["DeviceSecurityGroups"], "description": "User this method to deletes the device security group.", "operationId": "DeviceSecurityGroups_Delete", "parameters": [ @@ -1226,9 +1036,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-08-01" - ] + "enum": ["2019-08-01"] }, { "$ref": "#/parameters/ResourceId" @@ -1251,20 +1059,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotSecuritySolutions": { "get": { "x-ms-examples": null, - "tags": [ - "IoT Security Solution" - ], + "tags": ["IoT Security Solution"], "description": "Use this method to get the list of IoT Security solutions by subscription.", "operationId": "IotSecuritySolution_ListBySubscription", "parameters": [ @@ -1274,9 +1076,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-08-01" - ] + "enum": ["2019-08-01"] }, { "$ref": "#/parameters/SubscriptionId" @@ -1302,20 +1102,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions": { "get": { "x-ms-examples": null, - "tags": [ - "IoT Security Solution" - ], + "tags": ["IoT Security Solution"], "description": "Use this method to get the list IoT Security solutions organized by resource group.", "operationId": "IotSecuritySolution_ListByResourceGroup", "parameters": [ @@ -1325,9 +1119,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-08-01" - ] + "enum": ["2019-08-01"] }, { "$ref": "#/parameters/SubscriptionId" @@ -1356,20 +1148,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}": { "get": { "x-ms-examples": null, - "tags": [ - "IoT Security Solution" - ], + "tags": ["IoT Security Solution"], "description": "User this method to get details of a specific IoT Security solution based on solution name", "operationId": "IotSecuritySolution_Get", "parameters": [ @@ -1379,9 +1165,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-08-01" - ] + "enum": ["2019-08-01"] }, { "$ref": "#/parameters/SubscriptionId" @@ -1407,18 +1191,12 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "put": { "x-ms-examples": null, - "tags": [ - "IoT Security Solution" - ], + "tags": ["IoT Security Solution"], "description": "Use this method to create or update yours IoT Security solution", "operationId": "IotSecuritySolution_CreateOrUpdate", "parameters": [ @@ -1428,9 +1206,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-08-01" - ] + "enum": ["2019-08-01"] }, { "$ref": "#/parameters/SubscriptionId" @@ -1465,18 +1241,12 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "patch": { "x-ms-examples": null, - "tags": [ - "IoT Security Solution" - ], + "tags": ["IoT Security Solution"], "description": "Use this method to update existing IoT Security solution tags or user defined resources. To update other fields use the CreateOrUpdate method.", "operationId": "IotSecuritySolution_Update", "parameters": [ @@ -1486,9 +1256,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-08-01" - ] + "enum": ["2019-08-01"] }, { "$ref": "#/parameters/SubscriptionId" @@ -1517,18 +1285,12 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { "x-ms-examples": null, - "tags": [ - "IoT Security Solution" - ], + "tags": ["IoT Security Solution"], "description": "Use this method to delete yours IoT Security solution", "operationId": "IotSecuritySolution_Delete", "parameters": [ @@ -1538,9 +1300,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-08-01" - ] + "enum": ["2019-08-01"] }, { "$ref": "#/parameters/SubscriptionId" @@ -1566,20 +1326,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels": { "get": { "x-ms-examples": null, - "tags": [ - "IoT Security Solution Analytics" - ], + "tags": ["IoT Security Solution Analytics"], "description": "Use this method to get IoT security Analytics metrics in an array.", "operationId": "IotSecuritySolutionAnalytics_List", "parameters": [ @@ -1589,9 +1343,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-08-01" - ] + "enum": ["2019-08-01"] }, { "$ref": "#/parameters/SubscriptionId" @@ -1617,20 +1369,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default": { "get": { "x-ms-examples": null, - "tags": [ - "IoT Security Solution Analytics" - ], + "tags": ["IoT Security Solution Analytics"], "description": "Use this method to get IoT Security Analytics metrics.", "operationId": "IotSecuritySolutionAnalytics_Get", "parameters": [ @@ -1640,9 +1386,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-08-01" - ] + "enum": ["2019-08-01"] }, { "$ref": "#/parameters/SubscriptionId" @@ -1668,20 +1412,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts": { "get": { "x-ms-examples": null, - "tags": [ - "Aggregated Alert" - ], + "tags": ["Aggregated Alert"], "description": "Use this method to get the aggregated alert list of yours IoT Security solution.", "operationId": "IotSecuritySolutionsAnalyticsAggregatedAlert_List", "parameters": [ @@ -1691,9 +1429,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-08-01" - ] + "enum": ["2019-08-01"] }, { "$ref": "#/parameters/SubscriptionId" @@ -1729,20 +1465,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts/{aggregatedAlertName}": { "get": { "x-ms-examples": null, - "tags": [ - "Aggregated Alert" - ], + "tags": ["Aggregated Alert"], "description": "Use this method to get a single the aggregated alert of yours IoT Security solution. This aggregation is performed by alert name.", "operationId": "IotSecuritySolutionsAnalyticsAggregatedAlert_Get", "parameters": [ @@ -1752,9 +1482,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-08-01" - ] + "enum": ["2019-08-01"] }, { "$ref": "#/parameters/SubscriptionId" @@ -1783,20 +1511,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts/{aggregatedAlertName}/dismiss": { "post": { "x-ms-examples": null, - "tags": [ - "Aggregated Alert" - ], + "tags": ["Aggregated Alert"], "description": "Use this method to dismiss an aggregated IoT Security Solution Alert.", "operationId": "IotSecuritySolutionsAnalyticsAggregatedAlert_Dismiss", "parameters": [ @@ -1806,9 +1528,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-08-01" - ] + "enum": ["2019-08-01"] }, { "$ref": "#/parameters/SubscriptionId" @@ -1834,20 +1554,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedRecommendations/{aggregatedRecommendationName}": { "get": { "x-ms-examples": null, - "tags": [ - "Aggregated Recommendation" - ], + "tags": ["Aggregated Recommendation"], "description": "Use this method to get the aggregated security analytics recommendation of yours IoT Security solution. This aggregation is performed by recommendation name.", "operationId": "IotSecuritySolutionsAnalyticsRecommendation_Get", "parameters": [ @@ -1857,9 +1571,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-08-01" - ] + "enum": ["2019-08-01"] }, { "$ref": "#/parameters/SubscriptionId" @@ -1888,20 +1600,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedRecommendations": { "get": { "x-ms-examples": null, - "tags": [ - "Aggregated Recommendation" - ], + "tags": ["Aggregated Recommendation"], "description": "Use this method to get the list of aggregated security analytics recommendations of yours IoT Security solution.", "operationId": "IotSecuritySolutionsAnalyticsRecommendation_List", "parameters": [ @@ -1911,9 +1617,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-08-01" - ] + "enum": ["2019-08-01"] }, { "$ref": "#/parameters/SubscriptionId" @@ -1949,20 +1653,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotAlertTypes": { "get": { "x-ms-examples": null, - "tags": [ - "IoT Security Alert Types" - ], + "tags": ["IoT Security Alert Types"], "description": "List IoT alert types", "operationId": "IotAlertTypes_List", "parameters": [ @@ -1972,9 +1670,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-08-01" - ] + "enum": ["2019-08-01"] }, { "$ref": "#/parameters/SubscriptionId" @@ -2000,20 +1696,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotAlertTypes/{iotAlertTypeName}": { "get": { "x-ms-examples": null, - "tags": [ - "IoT Security Alert Types" - ], + "tags": ["IoT Security Alert Types"], "operationId": "IotAlertTypes_Get", "description": "Get IoT alert type", "parameters": [ @@ -2023,9 +1713,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-08-01" - ] + "enum": ["2019-08-01"] }, { "$ref": "#/parameters/SubscriptionId" @@ -2058,20 +1746,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotAlerts": { "get": { "x-ms-examples": null, - "tags": [ - "IoT Security Alerts" - ], + "tags": ["IoT Security Alerts"], "description": "List IoT alerts", "operationId": "IotAlerts_List", "parameters": [ @@ -2081,9 +1763,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-08-01" - ] + "enum": ["2019-08-01"] }, { "$ref": "#/parameters/SubscriptionId" @@ -2150,20 +1830,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotAlerts/{iotAlertId}": { "get": { "x-ms-examples": null, - "tags": [ - "IoT Security Alerts" - ], + "tags": ["IoT Security Alerts"], "operationId": "IotAlerts_Get", "description": "Get IoT alert", "parameters": [ @@ -2173,9 +1847,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-08-01" - ] + "enum": ["2019-08-01"] }, { "$ref": "#/parameters/SubscriptionId" @@ -2208,20 +1880,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations": { "get": { "x-ms-examples": null, - "tags": [ - "Locations" - ], + "tags": ["Locations"], "description": "The location of the responsible ASC of the specific subscription (home region). For each subscription there is only one responsible location. The location in the response should be used to read or write other resources in ASC according to their ID.", "operationId": "Locations_List", "parameters": [ @@ -2231,9 +1897,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2015-06-01-preview" - ] + "enum": ["2015-06-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -2256,20 +1920,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}": { "get": { "x-ms-examples": null, - "tags": [ - "Locations" - ], + "tags": ["Locations"], "description": "Details of a specific location", "operationId": "Locations_Get", "parameters": [ @@ -2279,9 +1937,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2015-06-01-preview" - ] + "enum": ["2015-06-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -2304,19 +1960,13 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/providers/Microsoft.Security/operations": { "get": { - "tags": [ - "Operations" - ], + "tags": ["Operations"], "description": "Exposes all available operations for discovery purposes.", "operationId": "Operations_List", "parameters": [ @@ -2326,9 +1976,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2015-06-01-preview" - ] + "enum": ["2015-06-01-preview"] } ], "responses": { @@ -2348,20 +1996,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/tasks": { "get": { "x-ms-examples": null, - "tags": [ - "Tasks" - ], + "tags": ["Tasks"], "description": "Recommended tasks that will help improve the security of the subscription proactively", "operationId": "Tasks_List", "parameters": [ @@ -2371,9 +2013,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2015-06-01-preview" - ] + "enum": ["2015-06-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -2399,20 +2039,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks": { "get": { "x-ms-examples": null, - "tags": [ - "Tasks" - ], + "tags": ["Tasks"], "description": "Recommended tasks that will help improve the security of the subscription proactively", "operationId": "Tasks_ListByHomeRegion", "parameters": [ @@ -2422,9 +2056,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2015-06-01-preview" - ] + "enum": ["2015-06-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -2453,20 +2085,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}": { "get": { "x-ms-examples": null, - "tags": [ - "Tasks" - ], + "tags": ["Tasks"], "description": "Recommended tasks that will help improve the security of the subscription proactively", "operationId": "Tasks_GetSubscriptionLevelTask", "parameters": [ @@ -2476,9 +2102,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2015-06-01-preview" - ] + "enum": ["2015-06-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -2504,20 +2128,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}/{taskUpdateActionType}": { "post": { "x-ms-examples": null, - "tags": [ - "Tasks" - ], + "tags": ["Tasks"], "description": "Recommended tasks that will help improve the security of the subscription proactively", "operationId": "Tasks_UpdateSubscriptionLevelTaskState", "parameters": [ @@ -2527,9 +2145,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2015-06-01-preview" - ] + "enum": ["2015-06-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -2555,20 +2171,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks": { "get": { "x-ms-examples": null, - "tags": [ - "Tasks" - ], + "tags": ["Tasks"], "description": "Recommended tasks that will help improve the security of the subscription proactively", "operationId": "Tasks_ListByResourceGroup", "parameters": [ @@ -2578,9 +2188,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2015-06-01-preview" - ] + "enum": ["2015-06-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -2612,20 +2220,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}": { "get": { "x-ms-examples": null, - "tags": [ - "Tasks" - ], + "tags": ["Tasks"], "description": "Recommended tasks that will help improve the security of the subscription proactively", "operationId": "Tasks_GetResourceGroupLevelTask", "parameters": [ @@ -2635,9 +2237,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2015-06-01-preview" - ] + "enum": ["2015-06-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -2666,20 +2266,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}/{taskUpdateActionType}": { "post": { "x-ms-examples": null, - "tags": [ - "Tasks" - ], + "tags": ["Tasks"], "description": "Recommended tasks that will help improve the security of the subscription proactively", "operationId": "Tasks_UpdateResourceGroupLevelTaskState", "parameters": [ @@ -2689,9 +2283,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2015-06-01-preview" - ] + "enum": ["2015-06-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -2720,20 +2312,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings": { "get": { "x-ms-examples": null, - "tags": [ - "AutoProvisioningSettings" - ], + "tags": ["AutoProvisioningSettings"], "description": "Exposes the auto provisioning settings of the subscriptions", "operationId": "AutoProvisioningSettings_List", "parameters": [ @@ -2743,9 +2329,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2017-08-01-preview" - ] + "enum": ["2017-08-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -2768,20 +2352,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName}": { "get": { "x-ms-examples": null, - "tags": [ - "AutoProvisioningSettings" - ], + "tags": ["AutoProvisioningSettings"], "description": "Details of a specific setting", "operationId": "AutoProvisioningSettings_Get", "parameters": [ @@ -2791,9 +2369,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2017-08-01-preview" - ] + "enum": ["2017-08-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -2816,18 +2392,12 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "put": { "x-ms-examples": null, - "tags": [ - "AutoProvisioningSettings" - ], + "tags": ["AutoProvisioningSettings"], "description": "Details of a specific setting", "operationId": "AutoProvisioningSettings_Create", "parameters": [ @@ -2837,9 +2407,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2017-08-01-preview" - ] + "enum": ["2017-08-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -2865,20 +2433,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/{scope}/providers/Microsoft.Security/compliances": { "get": { "x-ms-examples": null, - "tags": [ - "Compliances" - ], + "tags": ["Compliances"], "description": "The Compliance scores of the specific management group.", "operationId": "Compliances_List", "parameters": [ @@ -2888,9 +2450,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2017-08-01-preview" - ] + "enum": ["2017-08-01-preview"] }, { "$ref": "#/parameters/Scope" @@ -2913,20 +2473,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/{scope}/providers/Microsoft.Security/compliances/{complianceName}": { "get": { "x-ms-examples": null, - "tags": [ - "Compliances" - ], + "tags": ["Compliances"], "description": "Details of a specific Compliance.", "operationId": "Compliances_Get", "parameters": [ @@ -2936,9 +2490,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2017-08-01-preview" - ] + "enum": ["2017-08-01-preview"] }, { "$ref": "#/parameters/Scope" @@ -2961,20 +2513,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}": { "get": { "x-ms-examples": null, - "tags": [ - "InformationProtectionPolicies" - ], + "tags": ["InformationProtectionPolicies"], "description": "Details of the information protection policy.", "operationId": "InformationProtectionPolicies_Get", "parameters": [ @@ -2984,9 +2530,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2017-08-01-preview" - ] + "enum": ["2017-08-01-preview"] }, { "$ref": "#/parameters/Scope" @@ -3009,18 +2553,12 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "put": { "x-ms-examples": null, - "tags": [ - "InformationProtectionPolicies" - ], + "tags": ["InformationProtectionPolicies"], "description": "Details of the information protection policy.", "operationId": "InformationProtectionPolicies_CreateOrUpdate", "parameters": [ @@ -3030,9 +2568,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2017-08-01-preview" - ] + "enum": ["2017-08-01-preview"] }, { "$ref": "#/parameters/Scope" @@ -3064,20 +2600,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/{scope}/providers/Microsoft.Security/informationProtectionPolicies": { "get": { "x-ms-examples": null, - "tags": [ - "InformationProtectionPolicies" - ], + "tags": ["InformationProtectionPolicies"], "description": "Information protection policies of a specific management group.", "operationId": "InformationProtectionPolicies_List", "parameters": [ @@ -3087,9 +2617,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2017-08-01-preview" - ] + "enum": ["2017-08-01-preview"] }, { "$ref": "#/parameters/Scope" @@ -3112,20 +2640,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts": { "get": { "x-ms-examples": null, - "tags": [ - "Security Contacts" - ], + "tags": ["Security Contacts"], "description": "Security contact configurations for the subscription", "operationId": "SecurityContacts_List", "parameters": [ @@ -3135,9 +2657,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2017-08-01-preview" - ] + "enum": ["2017-08-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -3160,20 +2680,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}": { "get": { "x-ms-examples": null, - "tags": [ - "Security Contacts" - ], + "tags": ["Security Contacts"], "description": "Security contact configurations for the subscription", "operationId": "SecurityContacts_Get", "parameters": [ @@ -3183,9 +2697,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2017-08-01-preview" - ] + "enum": ["2017-08-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -3208,18 +2720,12 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "put": { "x-ms-examples": null, - "tags": [ - "Security Contacts" - ], + "tags": ["Security Contacts"], "description": "Security contact configurations for the subscription", "operationId": "SecurityContacts_Create", "parameters": [ @@ -3229,9 +2735,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2017-08-01-preview" - ] + "enum": ["2017-08-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -3257,18 +2761,12 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { "x-ms-examples": null, - "tags": [ - "Security Contacts" - ], + "tags": ["Security Contacts"], "description": "Security contact configurations for the subscription", "operationId": "SecurityContacts_Delete", "parameters": [ @@ -3278,9 +2776,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2017-08-01-preview" - ] + "enum": ["2017-08-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -3300,18 +2796,12 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "patch": { "x-ms-examples": null, - "tags": [ - "Security Contacts" - ], + "tags": ["Security Contacts"], "description": "Security contact configurations for the subscription", "operationId": "SecurityContacts_Update", "parameters": [ @@ -3321,9 +2811,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2017-08-01-preview" - ] + "enum": ["2017-08-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -3349,20 +2837,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings": { "get": { "x-ms-examples": null, - "tags": [ - "Workspace Settings" - ], + "tags": ["Workspace Settings"], "description": "Settings about where we should store your security data and logs. If the result is empty, it means that no custom-workspace configuration was set", "operationId": "WorkspaceSettings_List", "parameters": [ @@ -3372,9 +2854,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2017-08-01-preview" - ] + "enum": ["2017-08-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -3397,20 +2877,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}": { "get": { "x-ms-examples": null, - "tags": [ - "Workspace Settings" - ], + "tags": ["Workspace Settings"], "description": "Settings about where we should store your security data and logs. If the result is empty, it means that no custom-workspace configuration was set", "operationId": "WorkspaceSettings_Get", "parameters": [ @@ -3420,9 +2894,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2017-08-01-preview" - ] + "enum": ["2017-08-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -3445,18 +2917,12 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "put": { "x-ms-examples": null, - "tags": [ - "Workspace Settings" - ], + "tags": ["Workspace Settings"], "description": "creating settings about where we should store your security data and logs", "operationId": "WorkspaceSettings_Create", "parameters": [ @@ -3466,9 +2932,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2017-08-01-preview" - ] + "enum": ["2017-08-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -3494,18 +2958,12 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "patch": { "x-ms-examples": null, - "tags": [ - "Workspace Settings" - ], + "tags": ["Workspace Settings"], "description": "Settings about where we should store your security data and logs", "operationId": "WorkspaceSettings_Update", "parameters": [ @@ -3515,9 +2973,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2017-08-01-preview" - ] + "enum": ["2017-08-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -3543,18 +2999,12 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { "x-ms-examples": null, - "tags": [ - "Workspace Settings" - ], + "tags": ["Workspace Settings"], "description": "Deletes the custom workspace settings for this subscription. new VMs will report to the default workspace", "operationId": "WorkspaceSettings_Delete", "parameters": [ @@ -3564,9 +3014,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2017-08-01-preview" - ] + "enum": ["2017-08-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -3586,20 +3034,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards": { "get": { "x-ms-examples": null, - "tags": [ - "RegulatoryCompliance" - ], + "tags": ["RegulatoryCompliance"], "description": "Supported regulatory compliance standards details and state", "operationId": "RegulatoryComplianceStandards_List", "parameters": [ @@ -3609,9 +3051,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-01-01-preview" - ] + "enum": ["2019-01-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -3637,20 +3077,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}": { "get": { "x-ms-examples": null, - "tags": [ - "RegulatoryCompliance" - ], + "tags": ["RegulatoryCompliance"], "description": "Supported regulatory compliance details state for selected standard", "operationId": "RegulatoryComplianceStandards_Get", "parameters": [ @@ -3660,9 +3094,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-01-01-preview" - ] + "enum": ["2019-01-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -3685,20 +3117,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls": { "get": { "x-ms-examples": null, - "tags": [ - "RegulatoryCompliance" - ], + "tags": ["RegulatoryCompliance"], "description": "All supported regulatory compliance controls details and state for selected standard", "operationId": "RegulatoryComplianceControls_List", "parameters": [ @@ -3708,9 +3134,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-01-01-preview" - ] + "enum": ["2019-01-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -3739,20 +3163,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}": { "get": { "x-ms-examples": null, - "tags": [ - "RegulatoryCompliance" - ], + "tags": ["RegulatoryCompliance"], "description": "Selected regulatory compliance control details and state", "operationId": "RegulatoryComplianceControls_Get", "parameters": [ @@ -3762,9 +3180,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-01-01-preview" - ] + "enum": ["2019-01-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -3790,20 +3206,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}/regulatoryComplianceAssessments": { "get": { "x-ms-examples": null, - "tags": [ - "RegulatoryCompliance" - ], + "tags": ["RegulatoryCompliance"], "description": "Details and state of assessments mapped to selected regulatory compliance control", "operationId": "RegulatoryComplianceAssessments_List", "parameters": [ @@ -3813,9 +3223,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-01-01-preview" - ] + "enum": ["2019-01-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -3847,20 +3255,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}/regulatoryComplianceAssessments/{regulatoryComplianceAssessmentName}": { "get": { "x-ms-examples": null, - "tags": [ - "RegulatoryCompliance" - ], + "tags": ["RegulatoryCompliance"], "description": "Supported regulatory compliance details and state for selected assessment", "operationId": "RegulatoryComplianceAssessments_Get", "parameters": [ @@ -3870,9 +3272,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-01-01-preview" - ] + "enum": ["2019-01-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -3901,20 +3301,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/{scope}/providers/Microsoft.Security/subAssessments": { "get": { "x-ms-examples": null, - "tags": [ - "SubAssessments" - ], + "tags": ["SubAssessments"], "description": "Get security sub-assessments on all your scanned resources inside a subscription scope", "operationId": "SubAssessments_ListAll", "parameters": [ @@ -3924,9 +3318,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-01-01-preview" - ] + "enum": ["2019-01-01-preview"] }, { "$ref": "#/parameters/Scope" @@ -3949,20 +3341,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments": { "get": { "x-ms-examples": null, - "tags": [ - "SubAssessments" - ], + "tags": ["SubAssessments"], "description": "Get security sub-assessments on all your scanned resources inside a scope", "operationId": "SubAssessments_List", "parameters": [ @@ -3972,9 +3358,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-01-01-preview" - ] + "enum": ["2019-01-01-preview"] }, { "$ref": "#/parameters/Scope" @@ -4000,20 +3384,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments/{subAssessmentName}": { "get": { "x-ms-examples": null, - "tags": [ - "SubAssessments" - ], + "tags": ["SubAssessments"], "description": "Get a security sub-assessment on your scanned resource", "operationId": "SubAssessments_Get", "parameters": [ @@ -4023,9 +3401,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-01-01-preview" - ] + "enum": ["2019-01-01-preview"] }, { "$ref": "#/parameters/Scope" @@ -4051,20 +3427,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/automations": { "get": { "x-ms-examples": null, - "tags": [ - "Automations" - ], + "tags": ["Automations"], "description": "Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to get the next page of security automations for the specified subscription.", "operationId": "Automations_List", "parameters": [ @@ -4074,9 +3444,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-01-01-preview" - ] + "enum": ["2019-01-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -4099,20 +3467,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations": { "get": { "x-ms-examples": null, - "tags": [ - "Automations" - ], + "tags": ["Automations"], "description": "Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response to get the next page of security automations for the specified resource group.", "operationId": "Automations_ListByResourceGroup", "parameters": [ @@ -4122,9 +3484,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-01-01-preview" - ] + "enum": ["2019-01-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -4150,20 +3510,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}": { "get": { "x-ms-examples": null, - "tags": [ - "Automations" - ], + "tags": ["Automations"], "description": "Retrieves information about the model of a security automation.", "operationId": "Automations_Get", "parameters": [ @@ -4173,9 +3527,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-01-01-preview" - ] + "enum": ["2019-01-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -4201,18 +3553,12 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "put": { "x-ms-examples": null, - "tags": [ - "Automations" - ], + "tags": ["Automations"], "description": "Creates or updates a security automation. If a security automation is already created and a subsequent request is issued for the same automation id, then it will be updated.", "operationId": "Automations_CreateOrUpdate", "parameters": [ @@ -4222,9 +3568,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-01-01-preview" - ] + "enum": ["2019-01-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -4259,18 +3603,12 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { "x-ms-examples": null, - "tags": [ - "Automations" - ], + "tags": ["Automations"], "operationId": "Automations_Delete", "description": "Deletes a security automation.", "parameters": [ @@ -4280,9 +3618,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-01-01-preview" - ] + "enum": ["2019-01-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -4305,20 +3641,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}/validate": { "post": { "x-ms-examples": null, - "tags": [ - "Automations" - ], + "tags": ["Automations"], "description": "Validates the security automation model before create or update. Any validation errors are returned to the client.", "operationId": "Automations_Validate", "parameters": [ @@ -4328,9 +3658,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-01-01-preview" - ] + "enum": ["2019-01-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -4359,20 +3687,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules": { "get": { "x-ms-examples": null, - "tags": [ - "AlertsSuppressionRules" - ], + "tags": ["AlertsSuppressionRules"], "description": "List of all the dismiss rules for the given subscription", "operationId": "AlertsSuppressionRules_List", "parameters": [ @@ -4382,9 +3704,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-01-01-preview" - ] + "enum": ["2019-01-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -4410,20 +3730,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}": { "get": { "x-ms-examples": null, - "tags": [ - "AlertsSuppressionRules" - ], + "tags": ["AlertsSuppressionRules"], "description": "Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription", "operationId": "AlertsSuppressionRules_Get", "parameters": [ @@ -4433,9 +3747,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-01-01-preview" - ] + "enum": ["2019-01-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -4458,18 +3770,12 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "put": { "x-ms-examples": null, - "tags": [ - "AlertsSuppressionRules" - ], + "tags": ["AlertsSuppressionRules"], "description": "Update existing rule or create new rule if it doesn't exist", "operationId": "AlertsSuppressionRules_Update", "parameters": [ @@ -4479,9 +3785,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-01-01-preview" - ] + "enum": ["2019-01-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -4507,18 +3811,12 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { "x-ms-examples": null, - "tags": [ - "AlertsSuppressionRules" - ], + "tags": ["AlertsSuppressionRules"], "description": "Delete dismiss alert rule for this subscription.", "operationId": "AlertsSuppressionRules_Delete", "parameters": [ @@ -4528,9 +3826,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2019-01-01-preview" - ] + "enum": ["2019-01-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -4550,21 +3846,15 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments": { "get": { "x-ms-examples": null, "description": "Gets a list of server vulnerability assessment onboarding statuses on a given resource.", - "tags": [ - "ServerVulnerabilityAssessments" - ], + "tags": ["ServerVulnerabilityAssessments"], "operationId": "ServerVulnerabilityAssessment_ListByExtendedResource", "parameters": [ { @@ -4600,9 +3890,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] } ], "responses": { @@ -4619,21 +3907,15 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}": { "get": { "x-ms-examples": null, "description": "Gets a server vulnerability assessment onboarding statuses on a given resource.", - "tags": [ - "ServerVulnerabilityAssessments" - ], + "tags": ["ServerVulnerabilityAssessments"], "operationId": "ServerVulnerabilityAssessment_Get", "parameters": [ { @@ -4669,9 +3951,7 @@ "description": "ServerVulnerabilityAssessment status. only a 'default' value is supported.", "required": true, "type": "string", - "enum": [ - "default" - ] + "enum": ["default"] }, { "name": "api-version", @@ -4679,9 +3959,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] } ], "responses": { @@ -4698,19 +3976,13 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "put": { "x-ms-examples": null, "description": "Creating a server vulnerability assessment on a resource, which will onboard a resource for having a vulnerability assessment on it", - "tags": [ - "ServerVulnerabilityAssessment" - ], + "tags": ["ServerVulnerabilityAssessment"], "operationId": "ServerVulnerabilityAssessment_CreateOrUpdate", "parameters": [ { @@ -4746,9 +4018,7 @@ "description": "ServerVulnerabilityAssessment status. only a 'default' value is supported.", "required": true, "type": "string", - "enum": [ - "default" - ] + "enum": ["default"] }, { "name": "api-version", @@ -4756,9 +4026,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] } ], "responses": { @@ -4775,19 +4043,13 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { "x-ms-examples": null, "description": "Removing server vulnerability assessment from a resource.", - "tags": [ - "ServerVulnerabilityAssessment" - ], + "tags": ["ServerVulnerabilityAssessment"], "operationId": "ServerVulnerabilityAssessment_Delete", "parameters": [ { @@ -4823,9 +4085,7 @@ "description": "ServerVulnerabilityAssessment status. only a 'default' value is supported.", "required": true, "type": "string", - "enum": [ - "default" - ] + "enum": ["default"] }, { "name": "api-version", @@ -4833,9 +4093,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] } ], "responses": { @@ -4852,20 +4110,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/providers/Microsoft.Security/assessmentMetadata": { "get": { "x-ms-examples": null, - "tags": [ - "Assessments Metadata" - ], + "tags": ["Assessments Metadata"], "description": "Get metadata information on all assessment types", "operationId": "AssessmentsMetadata_List", "parameters": [ @@ -4875,9 +4127,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] } ], "responses": { @@ -4897,20 +4147,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}": { "get": { "x-ms-examples": null, - "tags": [ - "Assessments Metadata" - ], + "tags": ["Assessments Metadata"], "description": "Get metadata information on an assessment type", "operationId": "AssessmentsMetadata_Get", "parameters": [ @@ -4920,9 +4164,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] }, { "$ref": "#/parameters/AssessmentsMetadataName" @@ -4942,20 +4184,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata": { "get": { "x-ms-examples": null, - "tags": [ - "Assessments Metadata" - ], + "tags": ["Assessments Metadata"], "description": "Get metadata information on all assessment types in a specific subscription", "operationId": "AssessmentsMetadata_ListBySubscription", "parameters": [ @@ -4965,9 +4201,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] }, { "$ref": "#/parameters/SubscriptionId" @@ -4990,20 +4224,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}": { "get": { "x-ms-examples": null, - "tags": [ - "Assessments Metadata" - ], + "tags": ["Assessments Metadata"], "description": "Get metadata information on an assessment type in a specific subscription", "operationId": "AssessmentsMetadata_GetInSubscription", "parameters": [ @@ -5013,9 +4241,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] }, { "$ref": "#/parameters/AssessmentsMetadataName" @@ -5038,18 +4264,12 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "put": { "x-ms-examples": null, - "tags": [ - "Assessments Metadata" - ], + "tags": ["Assessments Metadata"], "description": "Create metadata information on an assessment type in a specific subscription", "operationId": "AssessmentsMetadata_CreateInSubscription", "parameters": [ @@ -5059,9 +4279,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] }, { "$ref": "#/parameters/AssessmentsMetadataName" @@ -5087,18 +4305,12 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { "x-ms-examples": null, - "tags": [ - "Assessments Metadata" - ], + "tags": ["Assessments Metadata"], "description": "Delete metadata information on an assessment type in a specific subscription, will cause the deletion of all the assessments of that type in that subscription", "operationId": "AssessmentsMetadata_DeleteInSubscription", "parameters": [ @@ -5108,9 +4320,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] }, { "$ref": "#/parameters/AssessmentsMetadataName" @@ -5130,20 +4340,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/{scope}/providers/Microsoft.Security/assessments": { "get": { "x-ms-examples": null, - "tags": [ - "Assessments" - ], + "tags": ["Assessments"], "description": "Get security assessments on all your scanned resources inside a scope", "operationId": "Assessments_List", "parameters": [ @@ -5153,9 +4357,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] }, { "$ref": "#/parameters/Scope" @@ -5178,20 +4380,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}": { "get": { "x-ms-examples": null, - "tags": [ - "Assessments" - ], + "tags": ["Assessments"], "description": "Get a security assessment on your scanned resource", "operationId": "Assessments_Get", "parameters": [ @@ -5201,9 +4397,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] }, { "$ref": "#/parameters/ResourceId" @@ -5229,18 +4423,12 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "put": { "x-ms-examples": null, - "tags": [ - "Assessments" - ], + "tags": ["Assessments"], "description": "Create a security assessment on your resource. An assessment metadata that describes this assessment must be predefined with the same name before inserting the assessment result", "operationId": "Assessments_CreateOrUpdate", "parameters": [ @@ -5250,9 +4438,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] }, { "$ref": "#/parameters/ResourceId" @@ -5284,18 +4470,12 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { "x-ms-examples": null, - "tags": [ - "Assessments" - ], + "tags": ["Assessments"], "description": "Delete a security assessment on your resource. An assessment metadata that describes this assessment must be predefined with the same name before inserting the assessment result", "operationId": "Assessments_Delete", "parameters": [ @@ -5305,9 +4485,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] }, { "$ref": "#/parameters/ResourceId" @@ -5330,12 +4508,8 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/applicationWhitelistings": { @@ -5343,12 +4517,8 @@ "description": "Gets a list of application control VM/server groups for the subscription.", "operationId": "AdaptiveApplicationControls_List", "x-ms-examples": null, - "tags": [ - "applicationWhitelistings" - ], - "produces": [ - "application/json" - ], + "tags": ["applicationWhitelistings"], + "produces": ["application/json"], "parameters": [ { "$ref": "#/parameters/SubscriptionId" @@ -5359,9 +4529,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] }, { "$ref": "#/parameters/IncludePathRecommendations" @@ -5384,9 +4552,7 @@ } } }, - "consumes": [ - "application/json" - ] + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}": { @@ -5394,12 +4560,8 @@ "description": "Gets an application control VM/server group.", "operationId": "AdaptiveApplicationControls_Get", "x-ms-examples": null, - "tags": [ - "applicationWhitelistings" - ], - "produces": [ - "application/json" - ], + "tags": ["applicationWhitelistings"], + "produces": ["application/json"], "parameters": [ { "$ref": "#/parameters/SubscriptionId" @@ -5416,9 +4578,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] } ], "responses": { @@ -5435,20 +4595,14 @@ } } }, - "consumes": [ - "application/json" - ] + "consumes": ["application/json"] }, "put": { - "tags": [ - "applicationWhitelistings" - ], + "tags": ["applicationWhitelistings"], "x-ms-examples": null, "description": "Update an application control VM/server group", "operationId": "AdaptiveApplicationControls_Put", - "consumes": [ - "application/json" - ], + "consumes": ["application/json"], "parameters": [ { "$ref": "#/parameters/SubscriptionId" @@ -5465,9 +4619,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] }, { "$ref": "#/parameters/AppWhitelistingGroup" @@ -5487,15 +4639,11 @@ } } }, - "produces": [ - "application/json" - ] + "produces": ["application/json"] }, "delete": { "x-ms-examples": null, - "tags": [ - "applicationWhitelistings" - ], + "tags": ["applicationWhitelistings"], "description": "Delete an application control VM/server group", "operationId": "AdaptiveApplicationControls_Delete", "parameters": [ @@ -5514,9 +4662,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] } ], "responses": { @@ -5536,21 +4682,15 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings": { "get": { "x-ms-examples": null, "description": "Gets a list of Adaptive Network Hardenings resources in scope of an extended resource.", - "tags": [ - "AdaptiveNetworkHardenings" - ], + "tags": ["AdaptiveNetworkHardenings"], "operationId": "AdaptiveNetworkHardenings_ListByExtendedResource", "parameters": [ { @@ -5586,9 +4726,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] } ], "responses": { @@ -5608,20 +4746,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}": { "get": { "x-ms-examples": null, - "tags": [ - "AdaptiveNetworkHardenings" - ], + "tags": ["AdaptiveNetworkHardenings"], "description": "Gets a single Adaptive Network Hardening resource", "operationId": "AdaptiveNetworkHardenings_Get", "parameters": [ @@ -5661,9 +4793,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] } ], "responses": { @@ -5680,21 +4810,15 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}/{adaptiveNetworkHardeningEnforceAction}": { "post": { "x-ms-long-running-operation": true, "x-ms-examples": null, - "tags": [ - "AdaptiveNetworkHardenings" - ], + "tags": ["AdaptiveNetworkHardenings"], "description": "Enforces the given rules on the NSG(s) listed in the request", "operationId": "AdaptiveNetworkHardenings_Enforce", "parameters": [ @@ -5737,9 +4861,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] }, { "$ref": "#/parameters/AdaptiveNetworkHardeningEnforceRequest" @@ -5759,20 +4881,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/allowedConnections": { "get": { "x-ms-examples": null, - "tags": [ - "AllowedConnections" - ], + "tags": ["AllowedConnections"], "description": "Gets the list of all possible traffic between resources for the subscription", "operationId": "AllowedConnections_List", "parameters": [ @@ -5785,9 +4901,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] } ], "responses": { @@ -5807,20 +4921,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/allowedConnections": { "get": { "x-ms-examples": null, - "tags": [ - "AllowedConnections" - ], + "tags": ["AllowedConnections"], "description": "Gets the list of all possible traffic between resources for the subscription and location.", "operationId": "AllowedConnections_ListByHomeRegion", "parameters": [ @@ -5836,9 +4944,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] } ], "responses": { @@ -5858,20 +4964,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/allowedConnections/{connectionType}": { "get": { "x-ms-examples": null, - "tags": [ - "AllowedConnections" - ], + "tags": ["AllowedConnections"], "description": "Gets the list of all possible traffic between resources for the subscription and location, based on connection type.", "operationId": "AllowedConnections_Get", "parameters": [ @@ -5893,9 +4993,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] } ], "responses": { @@ -5912,20 +5010,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/topologies": { "get": { "x-ms-examples": null, - "tags": [ - "Topology" - ], + "tags": ["Topology"], "description": "Gets a list that allows to build a topology view of a subscription.", "operationId": "Topology_List", "parameters": [ @@ -5938,9 +5030,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] } ], "responses": { @@ -5960,20 +5050,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/topologies": { "get": { "x-ms-examples": null, - "tags": [ - "Topology" - ], + "tags": ["Topology"], "description": "Gets a list that allows to build a topology view of a subscription and location.", "operationId": "Topology_ListByHomeRegion", "parameters": [ @@ -5989,9 +5073,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] } ], "responses": { @@ -6011,20 +5093,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/topologies/{topologyResourceName}": { "get": { "x-ms-examples": null, - "tags": [ - "Topology" - ], + "tags": ["Topology"], "description": "Gets a specific topology component.", "operationId": "Topology_Get", "parameters": [ @@ -6046,9 +5122,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] } ], "responses": { @@ -6065,20 +5139,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/jitNetworkAccessPolicies": { "get": { "x-ms-examples": null, - "tags": [ - "JitNetworkAccessPolicies" - ], + "tags": ["JitNetworkAccessPolicies"], "description": "Policies for protecting resources using Just-in-Time access control.", "operationId": "JitNetworkAccessPolicies_List", "parameters": [ @@ -6091,9 +5159,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] } ], "responses": { @@ -6113,20 +5179,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies": { "get": { "x-ms-examples": null, - "tags": [ - "JitNetworkAccessPolicies" - ], + "tags": ["JitNetworkAccessPolicies"], "description": "Policies for protecting resources using Just-in-Time access control for the subscription, location", "operationId": "JitNetworkAccessPolicies_ListByRegion", "parameters": [ @@ -6142,9 +5202,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] } ], "responses": { @@ -6164,20 +5222,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/jitNetworkAccessPolicies": { "get": { "x-ms-examples": null, - "tags": [ - "JitNetworkAccessPolicies" - ], + "tags": ["JitNetworkAccessPolicies"], "description": "Policies for protecting resources using Just-in-Time access control for the subscription, location", "operationId": "JitNetworkAccessPolicies_ListByResourceGroup", "parameters": [ @@ -6193,9 +5245,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] } ], "responses": { @@ -6215,25 +5265,17 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies": { "get": { "x-ms-examples": null, - "tags": [ - "JitNetworkAccessPolicies" - ], + "tags": ["JitNetworkAccessPolicies"], "description": "Policies for protecting resources using Just-in-Time access control for the subscription, location", "operationId": "JitNetworkAccessPolicies_ListByResourceGroupAndRegion", - "produces": [ - "application/json" - ], + "produces": ["application/json"], "parameters": [ { "$ref": "#/parameters/SubscriptionId" @@ -6250,9 +5292,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] } ], "responses": { @@ -6272,17 +5312,13 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "consumes": [ - "application/json" - ] + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}": { "get": { "x-ms-examples": null, - "tags": [ - "JitNetworkAccessPolicies" - ], + "tags": ["JitNetworkAccessPolicies"], "description": "Policies for protecting resources using Just-in-Time access control for the subscription, location", "operationId": "JitNetworkAccessPolicies_Get", "parameters": [ @@ -6304,9 +5340,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] } ], "responses": { @@ -6323,18 +5357,12 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "put": { "x-ms-examples": null, - "tags": [ - "JitNetworkAccessPolicies" - ], + "tags": ["JitNetworkAccessPolicies"], "description": "Create a policy for protecting resources using Just-in-Time access control", "operationId": "JitNetworkAccessPolicies_CreateOrUpdate", "parameters": [ @@ -6356,9 +5384,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] }, { "$ref": "#/parameters/JitNetworkAccessPolicy" @@ -6378,18 +5404,12 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { "x-ms-examples": null, - "tags": [ - "JitNetworkAccessPolicies" - ], + "tags": ["JitNetworkAccessPolicies"], "description": "Delete a Just-in-Time access control policy.", "operationId": "JitNetworkAccessPolicies_Delete", "parameters": [ @@ -6411,9 +5431,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] } ], "responses": { @@ -6430,20 +5448,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}/{jitNetworkAccessPolicyInitiateType}": { "post": { "x-ms-examples": null, - "tags": [ - "JitNetworkAccessPolicies" - ], + "tags": ["JitNetworkAccessPolicies"], "description": "Initiate a JIT access from a specific Just-in-Time policy configuration.", "operationId": "JitNetworkAccessPolicies_Initiate", "parameters": [ @@ -6468,9 +5480,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] }, { "$ref": "#/parameters/JitNetworkAccessPolicyInitiateRequest" @@ -6490,20 +5500,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/discoveredSecuritySolutions": { "get": { "x-ms-examples": null, - "tags": [ - "DiscoveredSecuritySolutions" - ], + "tags": ["DiscoveredSecuritySolutions"], "description": "Gets a list of discovered Security Solutions for the subscription.", "operationId": "DiscoveredSecuritySolutions_List", "parameters": [ @@ -6516,9 +5520,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] } ], "responses": { @@ -6538,20 +5540,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/discoveredSecuritySolutions": { "get": { "x-ms-examples": null, - "tags": [ - "DiscoveredSecuritySolutions" - ], + "tags": ["DiscoveredSecuritySolutions"], "description": "Gets a list of discovered Security Solutions for the subscription and location.", "operationId": "DiscoveredSecuritySolutions_ListByHomeRegion", "parameters": [ @@ -6567,9 +5563,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] } ], "responses": { @@ -6589,20 +5583,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/discoveredSecuritySolutions/{discoveredSecuritySolutionName}": { "get": { "x-ms-examples": null, - "tags": [ - "DiscoveredSecuritySolutions" - ], + "tags": ["DiscoveredSecuritySolutions"], "description": "Gets a specific discovered Security Solution.", "operationId": "DiscoveredSecuritySolutions_Get", "parameters": [ @@ -6624,9 +5612,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] } ], "responses": { @@ -6643,20 +5629,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securitySolutionsReferenceData": { "get": { "x-ms-examples": null, - "tags": [ - "securitySolutionsReferenceData" - ], + "tags": ["securitySolutionsReferenceData"], "description": "Gets a list of all supported Security Solutions for the subscription.", "operationId": "securitySolutionsReferenceData_List", "parameters": [ @@ -6669,9 +5649,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] } ], "responses": { @@ -6688,20 +5666,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/securitySolutionsReferenceData": { "get": { "x-ms-examples": null, - "tags": [ - "SecuritySolutionsReferenceData" - ], + "tags": ["SecuritySolutionsReferenceData"], "description": "Gets list of all supported Security Solutions for subscription and location.", "operationId": "SecuritySolutionsReferenceData_ListByHomeRegion", "parameters": [ @@ -6717,9 +5689,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] } ], "responses": { @@ -6736,21 +5706,15 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/externalSecuritySolutions": { "get": { "x-ms-examples": null, "description": "Gets a list of external security solutions for the subscription.", - "tags": [ - "ExternalSecuritySolutions" - ], + "tags": ["ExternalSecuritySolutions"], "operationId": "ExternalSecuritySolutions_List", "parameters": [ { @@ -6759,9 +5723,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] }, { "$ref": "#/parameters/SubscriptionId" @@ -6784,21 +5746,15 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/ExternalSecuritySolutions": { "get": { "x-ms-examples": null, "description": "Gets a list of external Security Solutions for the subscription and location.", - "tags": [ - "ExternalSecuritySolutions" - ], + "tags": ["ExternalSecuritySolutions"], "operationId": "ExternalSecuritySolutions_ListByHomeRegion", "parameters": [ { @@ -6813,9 +5769,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] } ], "responses": { @@ -6835,21 +5789,15 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/ExternalSecuritySolutions/{externalSecuritySolutionsName}": { "get": { "x-ms-examples": null, "description": "Gets a specific external Security Solution.", - "tags": [ - "ExternalSecuritySolutions" - ], + "tags": ["ExternalSecuritySolutions"], "operationId": "ExternalSecuritySolutions_Get", "parameters": [ { @@ -6870,9 +5818,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] } ], "responses": { @@ -6889,20 +5835,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores": { "get": { "x-ms-examples": null, - "tags": [ - "Secure Score" - ], + "tags": ["Secure Score"], "description": "List secure scores for all your Security Center initiatives within your current scope.", "operationId": "SecureScores_List", "parameters": [ @@ -6912,9 +5852,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01-preview" - ] + "enum": ["2020-01-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -6937,20 +5875,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName}": { "get": { "x-ms-examples": null, - "tags": [ - "Secure Score" - ], + "tags": ["Secure Score"], "description": "Get secure score for a specific Security Center initiative within your current scope. For the ASC Default initiative, use 'ascScore'.", "operationId": "SecureScores_Get", "parameters": [ @@ -6960,9 +5892,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01-preview" - ] + "enum": ["2020-01-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -6985,20 +5915,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName}/secureScoreControls": { "get": { "x-ms-examples": null, - "tags": [ - "Secure Score" - ], + "tags": ["Secure Score"], "description": "Get all security controls for a specific initiative within a scope", "operationId": "SecureScoreControls_ListBySecureScore", "parameters": [ @@ -7008,9 +5932,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01-preview" - ] + "enum": ["2020-01-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -7039,20 +5961,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScoreControls": { "get": { "x-ms-examples": null, - "tags": [ - "Secure Score Controls" - ], + "tags": ["Secure Score Controls"], "description": "Get all security controls within a scope", "operationId": "SecureScoreControls_List", "parameters": [ @@ -7062,9 +5978,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01-preview" - ] + "enum": ["2020-01-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -7090,20 +6004,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/providers/Microsoft.Security/secureScoreControlDefinitions": { "get": { "x-ms-examples": null, - "tags": [ - "Secure Score Control Definitions" - ], + "tags": ["Secure Score Control Definitions"], "description": "List the available security controls, their assessments, and the max score", "operationId": "SecureScoreControlDefinitions_List", "parameters": [ @@ -7113,9 +6021,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01-preview" - ] + "enum": ["2020-01-01-preview"] } ], "responses": { @@ -7135,20 +6041,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScoreControlDefinitions": { "get": { "x-ms-examples": null, - "tags": [ - "Secure Score Control Definitions" - ], + "tags": ["Secure Score Control Definitions"], "description": "For a specified subscription, list the available security controls, their assessments, and the max score", "operationId": "SecureScoreControlDefinitions_ListBySubscription", "parameters": [ @@ -7158,9 +6058,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01-preview" - ] + "enum": ["2020-01-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -7183,20 +6081,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securitySolutions": { "get": { "x-ms-examples": null, - "tags": [ - "SecuritySolutions" - ], + "tags": ["SecuritySolutions"], "description": "Gets a list of Security Solutions for the subscription.", "operationId": "SecuritySolutions_List", "parameters": [ @@ -7209,9 +6101,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] } ], "responses": { @@ -7231,20 +6121,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/securitySolutions/{securitySolutionName}": { "get": { "x-ms-examples": null, - "tags": [ - "SecuritySolutions" - ], + "tags": ["SecuritySolutions"], "description": "Gets a specific Security Solution.", "operationId": "SecuritySolutions_Get", "parameters": [ @@ -7266,9 +6150,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01" - ] + "enum": ["2020-01-01"] } ], "responses": { @@ -7285,20 +6167,14 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors": { "get": { "x-ms-examples": null, - "tags": [ - "Connectors" - ], + "tags": ["Connectors"], "description": "Cloud accounts connectors of a subscription", "operationId": "Connectors_List", "parameters": [ @@ -7308,9 +6184,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01-preview" - ] + "enum": ["2020-01-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -7333,20 +6207,14 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName}": { "get": { "x-ms-examples": null, - "tags": [ - "Connectors" - ], + "tags": ["Connectors"], "description": "Details of a specific cloud account connector", "operationId": "Connectors_Get", "parameters": [ @@ -7356,9 +6224,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01-preview" - ] + "enum": ["2020-01-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -7381,18 +6247,12 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "put": { "x-ms-examples": null, - "tags": [ - "Connectors" - ], + "tags": ["Connectors"], "description": "Create a cloud account connector or update an existing one. Connect to your AWS cloud account using either account credentials or role-based authentication.", "operationId": "Connectors_CreateOrUpdate", "parameters": [ @@ -7402,9 +6262,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01-preview" - ] + "enum": ["2020-01-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -7430,18 +6288,12 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { "x-ms-examples": null, - "tags": [ - "Connectors" - ], + "tags": ["Connectors"], "description": "Delete a cloud account connector from a subscription", "operationId": "Connectors_Delete", "parameters": [ @@ -7451,9 +6303,7 @@ "required": true, "type": "string", "description": "API version for the operation", - "enum": [ - "2020-01-01-preview" - ] + "enum": ["2020-01-01-preview"] }, { "$ref": "#/parameters/SubscriptionId" @@ -7476,21 +6326,15 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } } }, "definitions": { "ComplianceResultList": { "description": "List of compliance results response", - "required": [ - "value" - ], + "required": ["value"], "properties": { "value": { "type": "array", @@ -7530,12 +6374,7 @@ "type": "string", "readOnly": true, "description": "The status of the resource regarding a single assessment", - "enum": [ - "Healthy", - "NotApplicable", - "OffByPolicy", - "NotHealthy" - ], + "enum": ["Healthy", "NotApplicable", "OffByPolicy", "NotHealthy"], "x-ms-enum": { "name": "resourceStatus", "modelAsString": true, @@ -7698,9 +6537,7 @@ }, "PricingList": { "description": "List of pricing configurations response.", - "required": [ - "value" - ], + "required": ["value"], "properties": { "value": { "type": "array", @@ -7733,11 +6570,8 @@ "properties": { "pricingTier": { "type": "string", - "description": "The pricing tier value. Azure Security Center is provided in two pricing tiers: free and standard, with the standard tier available with a trial period. The standard tier offers advanced security capabilities, while the free tier offers basic security features.", - "enum": [ - "Free", - "Standard" - ], + "description": "The pricing tier value. Azure Security Center is provided in two pricing tiers: free and standard, with the standard tier available with a trial period. The standard tier offers advanced security capabilities, while the free tier offers basic security features.", + "enum": ["Free", "Standard"], "x-ms-enum": { "name": "pricingTier", "modelAsString": true, @@ -7760,9 +6594,7 @@ "description": "The duration left for the subscriptions free trial period - in ISO 8601 format (e.g. P3Y6M4DT12H30M5S)." } }, - "required": [ - "pricingTier" - ] + "required": ["pricingTier"] }, "AlertList": { "type": "object", @@ -7850,12 +6682,7 @@ "reportedSeverity": { "readOnly": true, "type": "string", - "enum": [ - "Informational", - "Low", - "Medium", - "High" - ], + "enum": ["Informational", "Low", "Medium", "High"], "x-ms-enum": { "name": "reportedSeverity", "modelAsString": true, @@ -8037,10 +6864,7 @@ "kind": { "type": "string", "description": "the kind of the settings string (DataExportSettings)", - "enum": [ - "DataExportSettings", - "AlertSuppressionSetting" - ], + "enum": ["DataExportSettings", "AlertSuppressionSetting"], "x-ms-enum": { "name": "SettingKind", "modelAsString": true, @@ -8056,9 +6880,7 @@ } }, "discriminator": "kind", - "required": [ - "kind" - ], + "required": ["kind"], "allOf": [ { "$ref": "#/definitions/Resource" @@ -8074,9 +6896,7 @@ "description": "Is the data export setting is enabled" } }, - "required": [ - "enabled" - ] + "required": ["enabled"] }, "AdvancedThreatProtectionProperties": { "properties": { @@ -8199,10 +7019,7 @@ "description": "The type of the custom alert rule." } }, - "required": [ - "isEnabled", - "ruleType" - ] + "required": ["isEnabled", "ruleType"] }, "ListCustomAlertRule": { "type": "object", @@ -8216,10 +7033,7 @@ "valueType": { "type": "string", "description": "The value type of the items in the list.", - "enum": [ - "IpCidr", - "String" - ], + "enum": ["IpCidr", "String"], "readOnly": true, "x-ms-enum": { "name": "valueType", @@ -8255,9 +7069,7 @@ } } }, - "required": [ - "allowlistValues" - ] + "required": ["allowlistValues"] }, "ConnectionToIpNotAllowed": { "type": "object", @@ -8306,9 +7118,7 @@ } } }, - "required": [ - "denylistValues" - ] + "required": ["denylistValues"] }, "ThresholdCustomAlertRule": { "type": "object", @@ -8328,10 +7138,7 @@ "description": "The maximum threshold." } }, - "required": [ - "minThreshold", - "maxThreshold" - ] + "required": ["minThreshold", "maxThreshold"] }, "TimeWindowCustomAlertRule": { "type": "object", @@ -8348,9 +7155,7 @@ "format": "duration" } }, - "required": [ - "timeWindowSize" - ] + "required": ["timeWindowSize"] }, "ActiveConnectionsNotInAllowedRange": { "type": "object", @@ -8526,9 +7331,7 @@ }, "IoTSecuritySolutionsList": { "description": "List of IoT Security solutions.", - "required": [ - "value" - ], + "required": ["value"], "properties": { "value": { "type": "array", @@ -8593,10 +7396,7 @@ }, "status": { "type": "string", - "enum": [ - "Enabled", - "Disabled" - ], + "enum": ["Enabled", "Disabled"], "default": "Enabled", "description": "Status of the IoT Security solution.", "x-ms-enum": { @@ -8607,9 +7407,7 @@ "export": { "type": "array", "items": { - "enum": [ - "RawEvents" - ], + "enum": ["RawEvents"], "type": "string", "x-ms-enum": { "name": "ExportData", @@ -8627,9 +7425,7 @@ "disabledDataSources": { "type": "array", "items": { - "enum": [ - "TwinData" - ], + "enum": ["TwinData"], "type": "string", "x-ms-enum": { "name": "DataSource", @@ -8668,10 +7464,7 @@ "unmaskedIpLoggingStatus": { "description": "Unmasked IP address logging status", "type": "string", - "enum": [ - "Disabled", - "Enabled" - ], + "enum": ["Disabled", "Enabled"], "default": "Disabled", "x-ms-enum": { "name": "UnmaskedIpLoggingStatus", @@ -8689,10 +7482,7 @@ } } }, - "required": [ - "iotHubs", - "displayName" - ] + "required": ["iotHubs", "displayName"] }, "UserDefinedResourcesProperties": { "type": "object", @@ -8713,10 +7503,7 @@ } } }, - "required": [ - "query", - "querySubscriptions" - ] + "required": ["query", "querySubscriptions"] }, "RecommendationConfigurationProperties": { "type": "object", @@ -8820,10 +7607,7 @@ }, "status": { "type": "string", - "enum": [ - "Disabled", - "Enabled" - ], + "enum": ["Disabled", "Enabled"], "default": "Enabled", "description": "Recommendation status. When the recommendation status is disabled recommendations are not generated.", "x-ms-enum": { @@ -8832,10 +7616,7 @@ } } }, - "required": [ - "recommendationType", - "status" - ] + "required": ["recommendationType", "status"] }, "RecommendationConfigurationList": { "type": "array", @@ -8945,9 +7726,7 @@ }, "IoTSecuritySolutionAnalyticsModelList": { "description": "List of Security analytics of your IoT Security solution", - "required": [ - "value" - ], + "required": ["value"], "properties": { "value": { "type": "array", @@ -8965,9 +7744,7 @@ }, "IoTSecurityAggregatedAlertList": { "description": "List of IoT Security solution aggregated alert data.", - "required": [ - "value" - ], + "required": ["value"], "properties": { "value": { "type": "array", @@ -8985,9 +7762,7 @@ }, "IoTSecurityAggregatedRecommendationList": { "description": "List of IoT Security solution aggregated recommendations.", - "required": [ - "value" - ], + "required": ["value"], "properties": { "value": { "type": "array", @@ -9071,12 +7846,7 @@ "reportedSeverity": { "readOnly": true, "type": "string", - "enum": [ - "Informational", - "Low", - "Medium", - "High" - ], + "enum": ["Informational", "Low", "Medium", "High"], "x-ms-enum": { "name": "reportedSeverity", "modelAsString": true, @@ -9213,12 +7983,7 @@ "reportedSeverity": { "readOnly": true, "type": "string", - "enum": [ - "Informational", - "Low", - "Medium", - "High" - ], + "enum": ["Informational", "Low", "Medium", "High"], "x-ms-enum": { "name": "reportedSeverity", "modelAsString": true, @@ -9284,12 +8049,7 @@ "reportedSeverity": { "readOnly": true, "type": "string", - "enum": [ - "Informational", - "Low", - "Medium", - "High" - ], + "enum": ["Informational", "Low", "Medium", "High"], "x-ms-enum": { "name": "reportedSeverity", "modelAsString": true, @@ -9329,12 +8089,7 @@ "reportedSeverity": { "readOnly": true, "type": "string", - "enum": [ - "Informational", - "Low", - "Medium", - "High" - ], + "enum": ["Informational", "Low", "Medium", "High"], "x-ms-enum": { "name": "reportedSeverity", "modelAsString": true, @@ -9406,12 +8161,7 @@ "type": "string", "example": "Medium", "description": "The severity of the alert", - "enum": [ - "Informational", - "Low", - "Medium", - "High" - ], + "enum": ["Informational", "Low", "Medium", "High"], "x-ms-enum": { "name": "alertSeverity", "modelAsString": true, @@ -9839,10 +8589,7 @@ "autoProvision": { "type": "string", "description": "Describes what kind of security agent provisioning action to take", - "enum": [ - "On", - "Off" - ], + "enum": ["On", "Off"], "x-ms-enum": { "name": "autoProvision", "modelAsString": true, @@ -9859,9 +8606,7 @@ } } }, - "required": [ - "autoProvision" - ] + "required": ["autoProvision"] }, "ComplianceList": { "type": "object", @@ -10024,13 +8769,7 @@ "rank": { "type": "string", "description": "The rank of the sensitivity label.", - "enum": [ - "None", - "Low", - "Medium", - "High", - "Critical" - ], + "enum": ["None", "Low", "Medium", "High", "Critical"], "x-ms-enum": { "name": "rank", "modelAsString": false @@ -10158,10 +8897,7 @@ }, "alertNotifications": { "type": "string", - "enum": [ - "On", - "Off" - ], + "enum": ["On", "Off"], "x-ms-enum": { "name": "alertNotifications", "modelAsString": true, @@ -10180,10 +8916,7 @@ }, "alertsToAdmins": { "type": "string", - "enum": [ - "On", - "Off" - ], + "enum": ["On", "Off"], "x-ms-enum": { "name": "alertsToAdmins", "modelAsString": true, @@ -10201,17 +8934,11 @@ "description": "Whether to send security alerts notifications to subscription admins" } }, - "required": [ - "email", - "alertNotifications", - "alertsToAdmins" - ] + "required": ["email", "alertNotifications", "alertsToAdmins"] }, "WorkspaceSettingList": { "description": "List of workspace settings response", - "required": [ - "value" - ], + "required": ["value"], "properties": { "value": { "type": "array", @@ -10256,16 +8983,11 @@ "description": "All the VMs in this scope will send their security data to the mentioned workspace unless overridden by a setting with more specific scope" } }, - "required": [ - "workspaceId", - "scope" - ] + "required": ["workspaceId", "scope"] }, "RegulatoryComplianceStandardList": { "description": "List of regulatory compliance standards response", - "required": [ - "value" - ], + "required": ["value"], "properties": { "value": { "type": "array", @@ -10303,12 +9025,7 @@ "state": { "type": "string", "description": "Aggregative state based on the standard's supported controls states", - "enum": [ - "Passed", - "Failed", - "Skipped", - "Unsupported" - ], + "enum": ["Passed", "Failed", "Skipped", "Unsupported"], "x-ms-enum": { "name": "state", "modelAsString": true, @@ -10356,9 +9073,7 @@ }, "RegulatoryComplianceControlList": { "description": "List of regulatory compliance controls response", - "required": [ - "value" - ], + "required": ["value"], "properties": { "value": { "type": "array", @@ -10402,12 +9117,7 @@ "state": { "type": "string", "description": "Aggregative state based on the control's supported assessments states", - "enum": [ - "Passed", - "Failed", - "Skipped", - "Unsupported" - ], + "enum": ["Passed", "Failed", "Skipped", "Unsupported"], "x-ms-enum": { "name": "state", "modelAsString": true, @@ -10450,9 +9160,7 @@ }, "RegulatoryComplianceAssessmentList": { "description": "List of regulatory compliance assessment response", - "required": [ - "value" - ], + "required": ["value"], "properties": { "value": { "type": "array", @@ -10505,12 +9213,7 @@ "state": { "type": "string", "description": "Aggregative state based on the assessment's scanned resources states", - "enum": [ - "Passed", - "Failed", - "Skipped", - "Unsupported" - ], + "enum": ["Passed", "Failed", "Skipped", "Unsupported"], "x-ms-enum": { "name": "state", "modelAsString": true, @@ -10648,11 +9351,7 @@ "assessedResourceType": { "type": "string", "description": "Sub-assessment resource type", - "enum": [ - "SqlServerVulnerability", - "ContainerRegistryVulnerability", - "ServerVulnerability" - ], + "enum": ["SqlServerVulnerability", "ContainerRegistryVulnerability", "ServerVulnerability"], "x-ms-enum": { "name": "AssessedResourceType", "modelAsString": true, @@ -10670,9 +9369,7 @@ } } }, - "required": [ - "assessedResourceType" - ] + "required": ["assessedResourceType"] }, "SubAssessmentStatus": { "type": "object", @@ -10682,11 +9379,7 @@ "readOnly": true, "type": "string", "description": "Programmatic code for the status of the assessment", - "enum": [ - "Healthy", - "Unhealthy", - "NotApplicable" - ], + "enum": ["Healthy", "Unhealthy", "NotApplicable"], "x-ms-enum": { "name": "SubAssessmentStatusCode", "modelAsString": true, @@ -10719,11 +9412,7 @@ "severity": { "readOnly": true, "type": "string", - "enum": [ - "Low", - "Medium", - "High" - ], + "enum": ["Low", "Medium", "High"], "x-ms-enum": { "name": "severity", "modelAsString": true, @@ -10952,12 +9641,7 @@ "description": "The name of the machine" } }, - "required": [ - "workspaceId", - "vmuuid", - "sourceComputerId", - "machineName" - ] + "required": ["workspaceId", "vmuuid", "sourceComputerId", "machineName"] }, "AzureResourceDetails": { "type": "object", @@ -10984,10 +9668,7 @@ "source": { "type": "string", "description": "The platform where the assessed resource resides", - "enum": [ - "Azure", - "OnPremise" - ], + "enum": ["Azure", "OnPremise"], "x-ms-enum": { "name": "source", "modelAsString": true, @@ -11004,15 +9685,11 @@ } } }, - "required": [ - "source" - ] + "required": ["source"] }, "AutomationList": { "description": "List of security automations response.", - "required": [ - "value" - ], + "required": ["value"], "properties": { "value": { "type": "array", @@ -11086,10 +9763,7 @@ "eventSource": { "type": "string", "description": "A valid event source type.", - "enum": [ - "Assessments", - "Alerts" - ], + "enum": ["Assessments", "Alerts"], "x-ms-enum": { "name": "EventSource", "modelAsString": true, @@ -11130,18 +9804,12 @@ "type": "object", "description": "The action that should be triggered.", "discriminator": "actionType", - "required": [ - "actionType" - ], + "required": ["actionType"], "properties": { "actionType": { "type": "string", "description": "The type of the action that will be triggered by the Automation", - "enum": [ - "LogicApp", - "EventHub", - "Workspace" - ], + "enum": ["LogicApp", "EventHub", "Workspace"], "x-ms-enum": { "name": "ActionType", "modelAsString": true, @@ -11245,12 +9913,7 @@ "propertyType": { "type": "string", "description": "The data type of the compared operands (string, integer, floating point number or a boolean [true/false]]", - "enum": [ - "String", - "Integer", - "Number", - "Boolean" - ], + "enum": ["String", "Integer", "Number", "Boolean"], "x-ms-enum": { "name": "PropertyType", "modelAsString": true, @@ -11354,9 +10017,7 @@ "description": "URI to fetch the next page." } }, - "required": [ - "value" - ] + "required": ["value"] }, "AlertsSuppressionRule": { "type": "object", @@ -11402,11 +10063,7 @@ "x-ms-enum": { "name": "RuleState" }, - "enum": [ - "Enabled", - "Disabled", - "Expired" - ] + "enum": ["Enabled", "Disabled", "Expired"] }, "comment": { "type": "string", @@ -11418,11 +10075,7 @@ "$ref": "#/definitions/SuppressionAlertsScope" } }, - "required": [ - "alertType", - "reason", - "state" - ] + "required": ["alertType", "reason", "state"] }, "ScopeElement": { "type": "object", @@ -11448,9 +10101,7 @@ } } }, - "required": [ - "allOf" - ] + "required": ["allOf"] }, "ServerVulnerabilityAssessmentsList": { "type": "object", @@ -11487,13 +10138,7 @@ "readOnly": true, "type": "string", "description": "The provisioningState of the vulnerability assessment capability on the VM", - "enum": [ - "Succeeded", - "Failed", - "Canceled", - "Provisioning", - "Deprovisioning" - ] + "enum": ["Succeeded", "Failed", "Canceled", "Provisioning", "Deprovisioning"] } } }, @@ -11556,13 +10201,7 @@ "items": { "type": "string", "description": "The category of resource that is at risk when the assessment is unhealthy", - "enum": [ - "Compute", - "Networking", - "Data", - "IdentityAndAccess", - "IoT" - ], + "enum": ["Compute", "Networking", "Data", "IdentityAndAccess", "IoT"], "x-ms-enum": { "name": "category", "modelAsString": true, @@ -11589,11 +10228,7 @@ "severity": { "type": "string", "description": "The severity level of the assessment", - "enum": [ - "Low", - "Medium", - "High" - ], + "enum": ["Low", "Medium", "High"], "x-ms-enum": { "name": "severity", "modelAsString": true, @@ -11613,11 +10248,7 @@ "userImpact": { "type": "string", "description": "The user impact of the assessment", - "enum": [ - "Low", - "Moderate", - "High" - ], + "enum": ["Low", "Moderate", "High"], "x-ms-enum": { "name": "userImpact", "modelAsString": true, @@ -11637,11 +10268,7 @@ "implementationEffort": { "type": "string", "description": "The implementation effort required to remediate this assessment", - "enum": [ - "Low", - "Moderate", - "High" - ], + "enum": ["Low", "Moderate", "High"], "x-ms-enum": { "name": "implementationEffort", "modelAsString": true, @@ -11712,12 +10339,7 @@ "assessmentType": { "type": "string", "description": "BuiltIn if the assessment based on built-in Azure Policy definition, Custom if the assessment based on custom Azure Policy definition", - "enum": [ - "BuiltIn", - "CustomPolicy", - "CustomerManaged", - "VerifiedPartner" - ], + "enum": ["BuiltIn", "CustomPolicy", "CustomerManaged", "VerifiedPartner"], "x-ms-enum": { "name": "assessmentType", "modelAsString": true, @@ -11745,11 +10367,7 @@ "$ref": "#/definitions/SecurityAssessmentMetadataPartnerData" } }, - "required": [ - "displayName", - "severity", - "assessmentType" - ] + "required": ["displayName", "severity", "assessmentType"] }, "SecurityAssessmentMetadataPartnerData": { "type": "object", @@ -11769,10 +10387,7 @@ "x-ms-secret": true } }, - "required": [ - "partnerName", - "secret" - ] + "required": ["partnerName", "secret"] }, "SecurityAssessmentList": { "type": "object", @@ -11840,10 +10455,7 @@ "$ref": "#/definitions/SecurityAssessmentPartnerData" } }, - "required": [ - "resourceDetails", - "status" - ] + "required": ["resourceDetails", "status"] }, "SecurityAssessmentPartnerData": { "type": "object", @@ -11859,10 +10471,7 @@ "x-ms-secret": true } }, - "required": [ - "partnerName", - "secret" - ] + "required": ["partnerName", "secret"] }, "AssessmentLinks": { "type": "object", @@ -11883,11 +10492,7 @@ "code": { "type": "string", "description": "Programmatic code for the status of the assessment", - "enum": [ - "Healthy", - "Unhealthy", - "NotApplicable" - ], + "enum": ["Healthy", "Unhealthy", "NotApplicable"], "x-ms-enum": { "name": "AssessmentStatusCode", "modelAsString": true, @@ -11916,9 +10521,7 @@ "description": "Human readable description of the assessment status" } }, - "required": [ - "code" - ] + "required": ["code"] }, "AppWhitelistingGroups": { "type": "object", @@ -11940,9 +10543,7 @@ "$ref": "#/definitions/AppWhitelistingGroupData" } }, - "required": [ - "properties" - ], + "required": ["properties"], "allOf": [ { "$ref": "#/definitions/Resource" @@ -11989,31 +10590,17 @@ "ConfigurationStatus": { "type": "string", "description": "The configuration status of the VM/server group or machine or rule on the machine", - "enum": [ - "Configured", - "NotConfigured", - "InProgress", - "Failed", - "NoStatus" - ] + "enum": ["Configured", "NotConfigured", "InProgress", "Failed", "NoStatus"] }, "EnforcementMode": { "type": "string", "description": "The application control policy enforcement/protection mode of the VM/server group", - "enum": [ - "Audit", - "Enforce", - "None" - ] + "enum": ["Audit", "Enforce", "None"] }, "EnforcementSupport": { "type": "string", "description": "The VM/server supportability of Enforce feature", - "enum": [ - "Supported", - "NotSupported", - "Unknown" - ] + "enum": ["Supported", "NotSupported", "Unknown"] }, "ProtectionMode": { "type": "object", @@ -12036,33 +10623,17 @@ "RecommendationStatus": { "type": "string", "description": "The recommendation status of the VM/server group or VM/server", - "enum": [ - "Recommended", - "NotRecommended", - "NotAvailable", - "NoStatus" - ] + "enum": ["Recommended", "NotRecommended", "NotAvailable", "NoStatus"] }, "RecommendationAction": { "type": "string", "description": "The recommendation action of the VM/server or rule", - "enum": [ - "Recommended", - "Add", - "Remove" - ] + "enum": ["Recommended", "Add", "Remove"] }, "RecommendationType": { "type": "string", "description": "The type of the rule to be allowed", - "enum": [ - "File", - "FileHash", - "PublisherSignature", - "ProductSignature", - "BinarySignature", - "VersionAndAboveSignature" - ] + "enum": ["File", "FileHash", "PublisherSignature", "ProductSignature", "BinarySignature", "VersionAndAboveSignature"] }, "AppWhitelistingIssue": { "type": "string", @@ -12079,25 +10650,12 @@ "FileType": { "type": "string", "description": "The type of the file (for Linux files - Executable is used)", - "enum": [ - "Exe", - "Dll", - "Msi", - "Script", - "Executable", - "Unknown" - ] + "enum": ["Exe", "Dll", "Msi", "Script", "Executable", "Unknown"] }, "SourceSystem": { "type": "string", "description": "The source type of the VM/server group", - "enum": [ - "Azure_AppLocker", - "Azure_AuditD", - "NonAzure_AppLocker", - "NonAzure_AuditD", - "None" - ] + "enum": ["Azure_AppLocker", "Azure_AuditD", "NonAzure_AppLocker", "NonAzure_AuditD", "None"] }, "AppWhitelistingIssueSummary": { "type": "object", @@ -12262,10 +10820,7 @@ "direction": { "description": "The rule's direction", "type": "string", - "enum": [ - "Inbound", - "Outbound" - ], + "enum": ["Inbound", "Outbound"], "x-ms-enum": { "name": "direction", "modelAsString": true @@ -12280,10 +10835,7 @@ "type": "array", "items": { "type": "string", - "enum": [ - "TCP", - "UDP" - ], + "enum": ["TCP", "UDP"], "x-ms-enum": { "name": "transportProtocol", "modelAsString": true @@ -12388,10 +10940,7 @@ } } }, - "required": [ - "rules", - "networkSecurityGroups" - ] + "required": ["rules", "networkSecurityGroups"] }, "AllowedConnectionsList": { "type": "object", @@ -12647,9 +11196,7 @@ "$ref": "#/definitions/JitNetworkAccessPolicyProperties" } }, - "required": [ - "properties" - ], + "required": ["properties"], "allOf": [ { "$ref": "#/definitions/Resource" @@ -12684,16 +11231,11 @@ "description": "Gets the provisioning state of the Just-in-Time policy." } }, - "required": [ - "virtualMachines" - ] + "required": ["virtualMachines"] }, "JitNetworkAccessPolicyVirtualMachine": { "type": "object", - "required": [ - "id", - "ports" - ], + "required": ["id", "ports"], "properties": { "id": { "type": "string", @@ -12720,11 +11262,7 @@ }, "protocol": { "type": "string", - "enum": [ - "TCP", - "UDP", - "*" - ], + "enum": ["TCP", "UDP", "*"], "x-ms-enum": { "name": "protocol", "modelAsString": true, @@ -12759,11 +11297,7 @@ "description": "Maximum duration requests can be made for. In ISO 8601 duration format. Minimum 5 minutes, maximum 1 day" } }, - "required": [ - "maxRequestAccessDuration", - "number", - "protocol" - ] + "required": ["maxRequestAccessDuration", "number", "protocol"] }, "JitNetworkAccessRequest": { "type": "object", @@ -12788,18 +11322,11 @@ "description": "The justification for making the initiate request" } }, - "required": [ - "requestor", - "startTimeUtc", - "virtualMachines" - ] + "required": ["requestor", "startTimeUtc", "virtualMachines"] }, "JitNetworkAccessRequestVirtualMachine": { "type": "object", - "required": [ - "id", - "ports" - ], + "required": ["id", "ports"], "properties": { "id": { "type": "string", @@ -12840,10 +11367,7 @@ "status": { "type": "string", "description": "The status of the port", - "enum": [ - "Revoked", - "Initiated" - ], + "enum": ["Revoked", "Initiated"], "x-ms-enum": { "name": "status", "modelAsString": true, @@ -12860,11 +11384,7 @@ "statusReason": { "type": "string", "description": "A description of why the `status` has its value", - "enum": [ - "Expired", - "UserRequested", - "NewerRequestInitiated" - ], + "enum": ["Expired", "UserRequested", "NewerRequestInitiated"], "x-ms-enum": { "name": "statusReason", "modelAsString": true, @@ -12886,12 +11406,7 @@ "description": "The port which is mapped to this port's `number` in the Azure Firewall, if applicable" } }, - "required": [ - "endTimeUtc", - "number", - "status", - "statusReason" - ] + "required": ["endTimeUtc", "number", "status", "statusReason"] }, "JitNetworkAccessPolicyInitiateRequest": { "type": "object", @@ -12908,9 +11423,7 @@ "description": "The justification for making the initiate request" } }, - "required": [ - "virtualMachines" - ] + "required": ["virtualMachines"] }, "JitNetworkAccessPolicyInitiateVirtualMachine": { "type": "object", @@ -12927,10 +11440,7 @@ } } }, - "required": [ - "id", - "ports" - ] + "required": ["id", "ports"] }, "JitNetworkAccessPolicyInitiatePort": { "type": "object", @@ -12948,10 +11458,7 @@ "description": "The time to close the request in UTC" } }, - "required": [ - "endTimeUtc", - "number" - ] + "required": ["endTimeUtc", "number"] }, "DiscoveredSecuritySolutionList": { "type": "object", @@ -12977,9 +11484,7 @@ "$ref": "#/definitions/DiscoveredSecuritySolutionProperties" } }, - "required": [ - "properties" - ], + "required": ["properties"], "allOf": [ { "$ref": "#/definitions/Resource" @@ -12995,12 +11500,7 @@ "securityFamily": { "type": "string", "description": "The security family of the discovered solution", - "enum": [ - "Waf", - "Ngfw", - "SaasWaf", - "Va" - ], + "enum": ["Waf", "Ngfw", "SaasWaf", "Va"], "x-ms-enum": { "name": "securityFamily", "modelAsString": true, @@ -13033,12 +11533,7 @@ "description": "The security solutions' image sku" } }, - "required": [ - "securityFamily", - "offer", - "publisher", - "sku" - ] + "required": ["securityFamily", "offer", "publisher", "sku"] }, "securitySolutionsReferenceDataList": { "type": "object", @@ -13059,9 +11554,7 @@ "$ref": "#/definitions/securitySolutionsReferenceDataProperties" } }, - "required": [ - "properties" - ], + "required": ["properties"], "allOf": [ { "$ref": "#/definitions/Resource" @@ -13077,12 +11570,7 @@ "securityFamily": { "type": "string", "description": "The security family of the security solution", - "enum": [ - "Waf", - "Ngfw", - "SaasWaf", - "Va" - ], + "enum": ["Waf", "Ngfw", "SaasWaf", "Va"], "x-ms-enum": { "name": "securityFamily", "modelAsString": true, @@ -13127,15 +11615,7 @@ "description": "The security solutions' template" } }, - "required": [ - "securityFamily", - "alertVendorName", - "packageInfoUrl", - "productName", - "publisher", - "publisherDisplayName", - "template" - ] + "required": ["securityFamily", "alertVendorName", "packageInfoUrl", "productName", "publisher", "publisherDisplayName", "template"] }, "ExternalSecuritySolutionList": { "properties": { @@ -13155,9 +11635,7 @@ "ExternalSecuritySolution": { "type": "object", "description": "Represents a security solution external to Azure Security Center which sends information to an OMS workspace and whose data is displayed by Azure Security Center.", - "required": [ - "kind" - ], + "required": ["kind"], "discriminator": "kind", "properties": {}, "allOf": [ @@ -13224,11 +11702,7 @@ "kind": { "type": "string", "description": "The kind of the external solution", - "enum": [ - "CEF", - "ATA", - "AAD" - ], + "enum": ["CEF", "ATA", "AAD"], "x-ms-enum": { "name": "ExternalSecuritySolutionKind", "modelAsString": true, @@ -13282,11 +11756,7 @@ "connectivityState": { "type": "string", "title": "The connectivity state of the external AAD solution ", - "enum": [ - "Discovered", - "NotLicensed", - "Connected" - ], + "enum": ["Discovered", "NotLicensed", "Connected"], "x-ms-enum": { "name": "AadConnectivityState", "modelAsString": true, @@ -13602,10 +12072,7 @@ "sourceType": { "description": "The type of security control (for example, BuiltIn)", "type": "string", - "enum": [ - "BuiltIn", - "Custom" - ], + "enum": ["BuiltIn", "Custom"], "x-ms-enum": { "name": "controlType", "modelAsString": true, @@ -13681,12 +12148,7 @@ "securityFamily": { "type": "string", "description": "The security family of the security solution", - "enum": [ - "Waf", - "Ngfw", - "SaasWaf", - "Va" - ], + "enum": ["Waf", "Ngfw", "SaasWaf", "Va"], "x-ms-enum": { "name": "securityFamily", "modelAsString": true, @@ -13709,11 +12171,7 @@ "provisioningState": { "type": "string", "description": "The security family provisioning State", - "enum": [ - "Succeeded", - "Failed", - "Updating" - ], + "enum": ["Succeeded", "Failed", "Updating"], "x-ms-enum": { "name": "provisioningState", "modelAsString": true, @@ -13739,12 +12197,7 @@ "description": "The security solutions' status" } }, - "required": [ - "securityFamily", - "provisioningState", - "template", - "protectionStatus" - ] + "required": ["securityFamily", "provisioningState", "template", "protectionStatus"] }, "ConnectorSettingList": { "type": "object", @@ -13804,11 +12257,7 @@ "description": "State of the service principal and its secret", "type": "string", "readOnly": true, - "enum": [ - "Valid", - "Invalid", - "Expired" - ], + "enum": ["Valid", "Invalid", "Expired"], "x-ms-enum": { "name": "hybridComputeProvisioningState", "modelAsString": true, @@ -13831,10 +12280,7 @@ "autoProvision": { "type": "string", "description": "Whether or not to automatically install Azure Arc (hybrid compute) agents on machines", - "enum": [ - "On", - "Off" - ], + "enum": ["On", "Off"], "x-ms-enum": { "name": "autoProvision", "modelAsString": true, @@ -13857,10 +12303,7 @@ "region": { "type": "string", "description": "The location where the meta data of machines will be stored", - "x-ms-mutability": [ - "create", - "read" - ] + "x-ms-mutability": ["create", "read"] }, "proxyServer": { "type": "object", @@ -13873,9 +12316,7 @@ "$ref": "#/definitions/ServicePrincipalProperties" } }, - "required": [ - "autoProvision" - ] + "required": ["autoProvision"] }, "ServicePrincipalProperties": { "type": "object", @@ -13900,12 +12341,7 @@ "description": "State of the multi-cloud connector", "type": "string", "readOnly": true, - "enum": [ - "Valid", - "Invalid", - "Expired", - "IncorrectPolicy" - ], + "enum": ["Valid", "Invalid", "Expired", "IncorrectPolicy"], "x-ms-enum": { "name": "authenticationProvisioningState", "modelAsString": true, @@ -13940,11 +12376,7 @@ "authenticationType": { "description": "Connect to your cloud account, for AWS use either account credentials or role-based authentication. For GCP use account organization credentials.", "type": "string", - "enum": [ - "awsCreds", - "awsAssumeRole", - "gcpCredentials" - ], + "enum": ["awsCreds", "awsAssumeRole", "gcpCredentials"], "x-ms-enum": { "name": "authenticationType", "modelAsString": true, @@ -13965,9 +12397,7 @@ } } }, - "required": [ - "authenticationType" - ] + "required": ["authenticationType"] }, "AwsCredsAuthenticationDetailsProperties": { "type": "object", @@ -13993,10 +12423,7 @@ "description": "Secret key element of the AWS credential object (write only)" } }, - "required": [ - "awsAccessKeyId", - "awsSecretAccessKey" - ] + "required": ["awsAccessKeyId", "awsSecretAccessKey"] }, "AwAssumeRoleAuthenticationDetailsProperties": { "type": "object", @@ -14022,10 +12449,7 @@ "description": "A unique identifier that is required when you assume a role in another account." } }, - "required": [ - "awsAssumeRoleArn", - "awsExternalId" - ] + "required": ["awsAssumeRoleArn", "awsExternalId"] }, "GcpCredentialsDetailsProperties": { "type": "object", @@ -14261,10 +12685,7 @@ "required": true, "type": "string", "description": "Name of setting: (MCAS/WDATP)", - "enum": [ - "MCAS", - "WDATP" - ], + "enum": ["MCAS", "WDATP"], "x-ms-parameter-location": "method" }, "Setting": { @@ -14282,9 +12703,7 @@ "in": "path", "required": true, "type": "string", - "enum": [ - "current" - ], + "enum": ["current"], "description": "Advanced Threat Protection setting name.", "x-ms-parameter-location": "method" }, @@ -14405,13 +12824,7 @@ "in": "path", "required": true, "type": "string", - "enum": [ - "Activate", - "Dismiss", - "Start", - "Resolve", - "Close" - ], + "enum": ["Activate", "Dismiss", "Start", "Resolve", "Close"], "description": "Type of the action to do on the task", "x-ms-parameter-location": "method" }, @@ -14446,10 +12859,7 @@ "in": "path", "required": true, "type": "string", - "enum": [ - "effective", - "custom" - ], + "enum": ["effective", "custom"], "description": "Name of the information protection policy.", "x-ms-parameter-location": "method" }, @@ -14607,10 +13017,7 @@ "type": "string", "description": "OData expand. Optional.", "x-ms-parameter-location": "method", - "enum": [ - "links", - "metadata" - ], + "enum": ["links", "metadata"], "x-ms-enum": { "name": "ExpandEnum", "modelAsString": true, @@ -14650,10 +13057,7 @@ "description": "Include the policy rules", "type": "boolean", "required": false, - "enum": [ - false, - true - ], + "enum": [false, true], "x-ms-parameter-location": "method" }, "Summary": { @@ -14662,10 +13066,7 @@ "description": "Return output in a summarized form", "type": "boolean", "required": false, - "enum": [ - false, - true - ], + "enum": [false, true], "x-ms-parameter-location": "method" }, "AppWhitelistingGroup": { @@ -14691,9 +13092,7 @@ "in": "path", "required": true, "description": "Enforces the given rules on the NSG(s) listed in the request", - "enum": [ - "enforce" - ], + "enum": ["enforce"], "x-ms-parameter-location": "method" }, "AdaptiveNetworkHardeningEnforceRequest": { @@ -14711,10 +13110,7 @@ "in": "path", "description": "The type of allowed connections (Internal, External)", "required": true, - "enum": [ - "Internal", - "External" - ], + "enum": ["Internal", "External"], "x-ms-enum": { "name": "connectionType", "modelAsString": true, @@ -14751,9 +13147,7 @@ "in": "path", "required": true, "description": "Type of the action to do on the Just-in-Time access policy.", - "enum": [ - "initiate" - ], + "enum": ["initiate"], "x-ms-parameter-location": "method" }, "JitNetworkAccessPolicyInitiateRequest": { @@ -14797,9 +13191,7 @@ "type": "string", "description": "OData expand. Optional.", "x-ms-parameter-location": "method", - "enum": [ - "definition" - ], + "enum": ["definition"], "x-ms-enum": { "name": "ExpandControlsEnum", "modelAsString": true, @@ -14846,4 +13238,4 @@ "x-ms-parameter-location": "method" } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/armResource/test_get_properties.json b/packages/rulesets/src/native/tests/resources/armResource/test_get_properties.json index 11fc63459..e009da27e 100644 --- a/packages/rulesets/src/native/tests/resources/armResource/test_get_properties.json +++ b/packages/rulesets/src/native/tests/resources/armResource/test_get_properties.json @@ -72,7 +72,7 @@ "required": ["code", "message"] }, "Display": { - "description": "a ref" + "description": "a ref" }, "Operation": { "description": "Azure Machine Learning Studio REST API operation", @@ -83,9 +83,9 @@ "type": "string" }, "display": { - "$ref":"#/definitions/Display" - } + "$ref": "#/definitions/Display" } + } }, "OperationListResult": { "description": "An array of operations supported by the resource provider.", @@ -136,8 +136,8 @@ "allOf": [ { "properties": { - "p1":{ - "type":"string", + "p1": { + "type": "string", "description": "p1" } } @@ -154,13 +154,13 @@ } ], "properties": { - "p1":{ - "type":"object", - "properties": { - "pp1": { - "type":"string" - } - } + "p1": { + "type": "object", + "properties": { + "pp1": { + "type": "string" + } + } } } } @@ -197,4 +197,4 @@ "x-ms-parameter-location": "method" } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/armResource/trackedResourceCommon.json b/packages/rulesets/src/native/tests/resources/armResource/trackedResourceCommon.json index 9a91f3b43..5f8b127f6 100644 --- a/packages/rulesets/src/native/tests/resources/armResource/trackedResourceCommon.json +++ b/packages/rulesets/src/native/tests/resources/armResource/trackedResourceCommon.json @@ -23,8 +23,7 @@ } } }, - "paths": { - }, + "paths": {}, "definitions": { "Resource": { "description": "The core properties of ARM resources", @@ -107,6 +106,5 @@ } } }, - "parameters": { - } + "parameters": {} } diff --git a/packages/rulesets/src/native/tests/resources/armResource/webservices.json b/packages/rulesets/src/native/tests/resources/armResource/webservices.json index d919008e9..cc689d9bc 100644 --- a/packages/rulesets/src/native/tests/resources/armResource/webservices.json +++ b/packages/rulesets/src/native/tests/resources/armResource/webservices.json @@ -6,14 +6,10 @@ "description": "These APIs allow end users to operate on Azure Machine Learning Workspace resources. They support CRUD operations for Azure Machine Learning Workspaces." }, "host": "management.azure.com", - "schemes": [ - "https" - ], + "schemes": ["https"], "security": [ { - "azure_auth": [ - "user_impersonation" - ] + "azure_auth": ["user_impersonation"] } ], "securityDefinitions": { @@ -30,9 +26,7 @@ "paths": { "/providers/Microsoft.MachineLearning/operations": { "get": { - "tags": [ - "Operation" - ], + "tags": ["Operation"], "description": "Lists all of the available Azure Machine Learning Studio REST API operations.", "operationId": "Operations_List", "parameters": [ @@ -57,19 +51,13 @@ "x-ms-pageable": { "nextLinkName": null }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/workspaces/{workspaceName}": { "get": { - "tags": [ - "Workspaces" - ], + "tags": ["Workspaces"], "description": "Gets the properties of the specified machine learning workspace.", "operationId": "Workspaces_Get", "parameters": [ @@ -101,17 +89,11 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "put": { - "tags": [ - "Workspaces" - ], + "tags": ["Workspaces"], "description": "Creates or updates a workspace with the specified parameters.", "operationId": "Workspaces_CreateOrUpdate", "parameters": [ @@ -152,17 +134,11 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "delete": { - "tags": [ - "Workspaces" - ], + "tags": ["Workspaces"], "description": "Deletes a machine learning workspace.", "operationId": "Workspaces_Delete", "parameters": [ @@ -194,17 +170,11 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] }, "patch": { - "tags": [ - "Workspaces" - ], + "tags": ["Workspaces"], "description": "Updates a machine learning workspace with the specified parameters.", "operationId": "Workspaces_Update", "parameters": [ @@ -245,19 +215,13 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/workspaces/{workspaceName}/resyncStorageKeys": { "post": { - "tags": [ - "Workspaces" - ], + "tags": ["Workspaces"], "description": "Resync storage keys associated with this workspace.", "operationId": "Workspaces_ResyncStorageKeys", "parameters": [ @@ -286,19 +250,13 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/workspaces/{workspaceName}/listWorkspaceKeys": { "post": { - "tags": [ - "Workspaces" - ], + "tags": ["Workspaces"], "description": "List the authorization keys associated with this workspace.", "operationId": "Workspaces_ListWorkspaceKeys", "parameters": [ @@ -330,19 +288,13 @@ } } }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/workspaces": { "get": { - "tags": [ - "Workspaces" - ], + "tags": ["Workspaces"], "description": "Lists all the available machine learning workspaces under the specified resource group.", "operationId": "Workspaces_ListByResourceGroup", "parameters": [ @@ -374,19 +326,13 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } }, "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearning/workspaces": { "get": { - "tags": [ - "Workspaces" - ], + "tags": ["Workspaces"], "description": "Lists all the available machine learning workspaces under the specified subscription.", "operationId": "Workspaces_List", "parameters": [ @@ -415,12 +361,8 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "produces": ["application/json"], + "consumes": ["application/json"] } } }, @@ -437,10 +379,7 @@ "description": "error message" } }, - "required": [ - "code", - "message" - ] + "required": ["code", "message"] }, "Workspace": { "type": "object", @@ -461,10 +400,7 @@ "WorkspaceProperties": { "type": "object", "description": "The properties of a machine learning workspace.", - "required": [ - "userStorageAccountId", - "ownerEmail" - ], + "required": ["userStorageAccountId", "ownerEmail"], "properties": { "userStorageAccountId": { "description": "The fully qualified arm id of the storage account associated with this workspace.", @@ -476,13 +412,7 @@ }, "workspaceType": { "type": "string", - "enum": [ - "Production", - "Free", - "Anonymous", - "PaidStandard", - "PaidPremium" - ], + "enum": ["Production", "Free", "Anonymous", "PaidStandard", "PaidPremium"], "x-ms-enum": { "name": "WorkspaceType", "modelAsString": false @@ -492,15 +422,7 @@ }, "workspaceState": { "type": "string", - "enum": [ - "Deleted", - "Enabled", - "Disabled", - "Migrated", - "Updated", - "Registered", - "Unregistered" - ], + "enum": ["Deleted", "Enabled", "Disabled", "Migrated", "Updated", "Registered", "Unregistered"], "x-ms-enum": { "name": "WorkspaceState", "modelAsString": false @@ -551,15 +473,7 @@ "properties": { "workspaceState": { "type": "string", - "enum": [ - "Deleted", - "Enabled", - "Disabled", - "Migrated", - "Updated", - "Registered", - "Unregistered" - ], + "enum": ["Deleted", "Enabled", "Disabled", "Migrated", "Updated", "Registered", "Unregistered"], "x-ms-enum": { "name": "WorkspaceState", "modelAsString": false @@ -647,9 +561,7 @@ }, "Resource": { "description": "An Azure resource.", - "required": [ - "location" - ], + "required": ["location"], "properties": { "id": { "description": "The resource ID.", @@ -713,4 +625,4 @@ "x-ms-parameter-location": "method" } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/body-top-level-properties.json b/packages/rulesets/src/native/tests/resources/body-top-level-properties.json index 0d102e216..b0b3be516 100644 --- a/packages/rulesets/src/native/tests/resources/body-top-level-properties.json +++ b/packages/rulesets/src/native/tests/resources/body-top-level-properties.json @@ -6,16 +6,10 @@ "version": "2017-02-08" }, "host": "management.azure.com", - "schemes": [ - "https" - ], + "schemes": ["https"], "basePath": "/", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], + "produces": ["application/json"], + "consumes": ["application/json"], "paths": { "/foo": { "put": { @@ -75,10 +69,7 @@ "extraProperty": { "type": "string", "description": "Required. Indicates the type of account.", - "enum": [ - "Storage", - "BlobStorage" - ], + "enum": ["Storage", "BlobStorage"], "x-ms-enum": { "name": "extraProperty", "modelAsString": false @@ -108,10 +99,7 @@ } } }, - "required": [ - "kind", - "location" - ], + "required": ["kind", "location"], "allOf": [ { "$ref": "#/definitions/Resource" @@ -172,4 +160,4 @@ "description": "test api version" } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/common-types/types.json b/packages/rulesets/src/native/tests/resources/common-types/types.json index cf8fdef18..2e3224cba 100644 --- a/packages/rulesets/src/native/tests/resources/common-types/types.json +++ b/packages/rulesets/src/native/tests/resources/common-types/types.json @@ -63,25 +63,16 @@ "additionalProperties": { "type": "string" }, - "x-ms-mutability": [ - "read", - "create", - "update" - ], + "x-ms-mutability": ["read", "create", "update"], "description": "Resource tags." }, "location": { "type": "string", - "x-ms-mutability": [ - "read", - "create" - ], + "x-ms-mutability": ["read", "create"], "description": "The geo-location where the resource lives" } }, - "required": [ - "location" - ], + "required": ["location"], "allOf": [ { "$ref": "#/definitions/Resource" @@ -105,9 +96,7 @@ "id": { "readOnly": true, "type": "string", - "x-ms-mutability": [ - "read" - ], + "x-ms-mutability": ["read"], "description": "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" }, "name": { @@ -118,34 +107,22 @@ "type": { "readOnly": true, "type": "string", - "x-ms-mutability": [ - "read" - ], + "x-ms-mutability": ["read"], "description": "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\"" }, "location": { "type": "string", - "x-ms-mutability": [ - "read", - "create" - ], + "x-ms-mutability": ["read", "create"], "description": "The geo-location where the resource lives" }, "managedBy": { "type": "string", - "x-ms-mutability": [ - "read", - "create", - "update" - ], + "x-ms-mutability": ["read", "create", "update"], "description": "The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource." }, "kind": { "type": "string", - "x-ms-mutability": [ - "read", - "create" - ], + "x-ms-mutability": ["read", "create"], "description": "Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value.", "pattern": "^[-\\w\\._,\\(\\)]+$" }, @@ -159,11 +136,7 @@ "additionalProperties": { "type": "string" }, - "x-ms-mutability": [ - "read", - "create", - "update" - ], + "x-ms-mutability": ["read", "create", "update"], "description": "Resource tags." }, "identity": { @@ -192,12 +165,7 @@ }, "SkuTier": { "type": "string", - "enum": [ - "Free", - "Basic", - "Standard", - "Premium" - ], + "enum": ["Free", "Basic", "Standard", "Premium"], "x-ms-enum": { "name": "SkuTier", "modelAsString": false @@ -229,9 +197,7 @@ "description": "If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted." } }, - "required": [ - "name" - ] + "required": ["name"] }, "Identity": { "description": "Identity for the resource.", @@ -250,9 +216,7 @@ "type": { "type": "string", "description": "The identity type.", - "enum": [ - "SystemAssigned" - ], + "enum": ["SystemAssigned"], "x-ms-enum": { "name": "ResourceIdentityType", "modelAsString": false @@ -285,11 +249,7 @@ } }, "description": "Plan for the resource.", - "required": [ - "name", - "publisher", - "product" - ] + "required": ["name", "publisher", "product"] }, "ErrorDetail": { "description": "The error detail.", @@ -316,10 +276,7 @@ "items": { "$ref": "#/definitions/ErrorDetail" }, - "x-ms-identifiers": [ - "message", - "target" - ], + "x-ms-identifiers": ["message", "target"], "description": "The error details." }, "additionalInfo": { @@ -405,11 +362,7 @@ "description": "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\"", "type": "string", "readOnly": true, - "enum": [ - "user", - "system", - "user,system" - ], + "enum": ["user", "system", "user,system"], "x-ms-enum": { "name": "Origin", "modelAsString": true @@ -419,9 +372,7 @@ "description": "Enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs.", "type": "string", "readOnly": true, - "enum": [ - "Internal" - ], + "enum": ["Internal"], "x-ms-enum": { "name": "ActionType", "modelAsString": true @@ -438,9 +389,7 @@ "items": { "$ref": "#/definitions/Operation" }, - "x-ms-identifiers": [ - "name" - ], + "x-ms-identifiers": ["name"], "description": "List of operations supported by the resource provider", "readOnly": true }, @@ -454,9 +403,7 @@ "OperationStatusResult": { "description": "The current status of an async operation.", "type": "object", - "required": [ - "status" - ], + "required": ["status"], "properties": { "id": { "description": "Fully qualified ID for the async operation.", @@ -521,9 +468,7 @@ "description": "The country or region where the resource is located" } }, - "required": [ - "name" - ] + "required": ["name"] }, "systemData": { "description": "Metadata pertaining to creation and last modification of the resource.", @@ -537,12 +482,7 @@ "createdByType": { "type": "string", "description": "The type of identity that created the resource.", - "enum": [ - "User", - "Application", - "ManagedIdentity", - "Key" - ], + "enum": ["User", "Application", "ManagedIdentity", "Key"], "x-ms-enum": { "name": "createdByType", "modelAsString": true @@ -560,12 +500,7 @@ "lastModifiedByType": { "type": "string", "description": "The type of identity that last modified the resource.", - "enum": [ - "User", - "Application", - "ManagedIdentity", - "Key" - ], + "enum": ["User", "Application", "ManagedIdentity", "Key"], "x-ms-enum": { "name": "createdByType", "modelAsString": true @@ -584,10 +519,7 @@ "properties": { "status": { "description": "Indicates whether or not the encryption is enabled for container registry.", - "enum": [ - "enabled", - "disabled" - ], + "enum": ["enabled", "disabled"], "type": "string", "x-ms-enum": { "name": "EncryptionStatus", @@ -638,10 +570,7 @@ "reason": { "description": "The reason why the given name is not available.", "type": "string", - "enum": [ - "Invalid", - "AlreadyExists" - ], + "enum": ["Invalid", "AlreadyExists"], "x-ms-enum": { "name": "CheckNameAvailabilityReason", "modelAsString": true @@ -700,4 +629,4 @@ "x-ms-parameter-location": "method" } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/ext-resource-validation-with-reference.json b/packages/rulesets/src/native/tests/resources/ext-resource-validation-with-reference.json index 264e8fbf4..9f5a6ca46 100644 --- a/packages/rulesets/src/native/tests/resources/ext-resource-validation-with-reference.json +++ b/packages/rulesets/src/native/tests/resources/ext-resource-validation-with-reference.json @@ -6,22 +6,14 @@ "version": "2014-04-01-preview" }, "host": "management.azure.com", - "schemes": [ - "https" - ], + "schemes": ["https"], "basePath": "/", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], + "produces": ["application/json"], + "consumes": ["application/json"], "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}": { "put": { - "tags": [ - "Redis" - ], + "tags": ["Redis"], "operationId": "Redis_CreateOrUpdate", "x-ms-long-running-operation": true, "parameters": [ @@ -81,4 +73,4 @@ "type": "string" } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/ext-resource-validation.json b/packages/rulesets/src/native/tests/resources/ext-resource-validation.json index 02188c688..5fc67fc77 100644 --- a/packages/rulesets/src/native/tests/resources/ext-resource-validation.json +++ b/packages/rulesets/src/native/tests/resources/ext-resource-validation.json @@ -6,22 +6,14 @@ "version": "2014-04-01-preview" }, "host": "management.azure.com", - "schemes": [ - "https" - ], + "schemes": ["https"], "basePath": "/", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], + "produces": ["application/json"], + "consumes": ["application/json"], "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}": { "put": { - "tags": [ - "Redis" - ], + "tags": ["Redis"], "operationId": "Redis_CreateOrUpdate", "x-ms-long-running-operation": true, "parameters": [ @@ -96,4 +88,4 @@ "type": "string" } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/tests/resources/happyPath/PageableOperation.json b/packages/rulesets/src/native/tests/resources/happyPath/PageableOperation.json index 638962385..eb8070a83 100644 --- a/packages/rulesets/src/native/tests/resources/happyPath/PageableOperation.json +++ b/packages/rulesets/src/native/tests/resources/happyPath/PageableOperation.json @@ -1,66 +1,66 @@ { - "swagger": "2.0", - "info": { - "title": "SwaggerInventoryTests", - "description": "Use this swagger to test the inventory to detect response types with arrays as possible pageable operations", - "version": "2016-10-10" - }, - "host": "management.azure.com", - "paths": { - "/plants": { - "get": { - "description": "Get a list of plants.", - "operationId": "Plants_List", - "x-ms-pageable": { - "nextLinkName": "nextLink" - }, - "parameters": [], - "responses": { - "200": { - "description": "OK.", - "schema": { - "$ref": "#/definitions/PlantsList" - } - } - } + "swagger": "2.0", + "info": { + "title": "SwaggerInventoryTests", + "description": "Use this swagger to test the inventory to detect response types with arrays as possible pageable operations", + "version": "2016-10-10" + }, + "host": "management.azure.com", + "paths": { + "/plants": { + "get": { + "description": "Get a list of plants.", + "operationId": "Plants_List", + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "parameters": [], + "responses": { + "200": { + "description": "OK.", + "schema": { + "$ref": "#/definitions/PlantsList" } + } } - }, - "definitions": { - "PlantsList": { - "type": "object", - "description": "Response to a Pageable operation. This one lists plants", - "readOnly": true, - "properties": { - "value": { - "type": "array", - "description": "List of plants", - "items": { - "$ref": "#/definitions/Plant" - }, - "readOnly": true - }, - "nextLink": { - "type": "string", - "description": "Link to next page of results", - "readOnly": true - } - } + } + } + }, + "definitions": { + "PlantsList": { + "type": "object", + "description": "Response to a Pageable operation. This one lists plants", + "readOnly": true, + "properties": { + "value": { + "type": "array", + "description": "List of plants", + "items": { + "$ref": "#/definitions/Plant" + }, + "readOnly": true }, - "Plant": { - "type": "object", - "description": "A plant", - "properties": { - "name": { - "type": "string", - "description": "The plant's name" - }, - "edible": { - "type": "boolean", - "description": "Is the plant edible?" - } - } + "nextLink": { + "type": "string", + "description": "Link to next page of results", + "readOnly": true } + } }, - "parameters": {} -} \ No newline at end of file + "Plant": { + "type": "object", + "description": "A plant", + "properties": { + "name": { + "type": "string", + "description": "The plant's name" + }, + "edible": { + "type": "boolean", + "description": "Is the plant edible?" + } + } + } + }, + "parameters": {} +} diff --git a/packages/rulesets/src/native/tests/resources/happyPath/XmsEnumWithDuplicateNameAndSameEnties.json b/packages/rulesets/src/native/tests/resources/happyPath/XmsEnumWithDuplicateNameAndSameEnties.json index 88cd12cff..0a6a3b9a6 100644 --- a/packages/rulesets/src/native/tests/resources/happyPath/XmsEnumWithDuplicateNameAndSameEnties.json +++ b/packages/rulesets/src/native/tests/resources/happyPath/XmsEnumWithDuplicateNameAndSameEnties.json @@ -1,98 +1,92 @@ { - "swagger": "2.0", - "info": { - "title": "SwaggerInventoryTests", - "description": "Use this swagger to test the inventory to detect response types with arrays as possible pageable operations", - "version": "2016-10-10" - }, - "host": "management.azure.com", - "paths": { - "/plants": { - "put": { - "description": "Get a list of plants.", - "operationId": "Plants_List", - "x-ms-pageable": { - "nextLinkName": "nextLink" - }, - "parameters": [], - "responses": { - "200": { - "description": "OK.", - "schema": { - "$ref": "#/definitions/PlantsList" - } - } - } + "swagger": "2.0", + "info": { + "title": "SwaggerInventoryTests", + "description": "Use this swagger to test the inventory to detect response types with arrays as possible pageable operations", + "version": "2016-10-10" + }, + "host": "management.azure.com", + "paths": { + "/plants": { + "put": { + "description": "Get a list of plants.", + "operationId": "Plants_List", + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "parameters": [], + "responses": { + "200": { + "description": "OK.", + "schema": { + "$ref": "#/definitions/PlantsList" } + } } - }, - "definitions": { - "PlantsList": { - "type": "object", - "description": "Response to a Pageable operation. This one lists plants", - "readOnly": true, - "properties": { - "value": { - "type": "array", - "description": "List of plants", - "items": { - "$ref": "#/definitions/Plant" - }, - "readOnly": true - }, - "nextLink": { - "type": "string", - "description": "Link to next page of results", - "readOnly": true - } - } + } + } + }, + "definitions": { + "PlantsList": { + "type": "object", + "description": "Response to a Pageable operation. This one lists plants", + "readOnly": true, + "properties": { + "value": { + "type": "array", + "description": "List of plants", + "items": { + "$ref": "#/definitions/Plant" + }, + "readOnly": true }, - "Plant": { - "type": "object", - "description": "A plant", - "properties": { - "name": { - "type": "string", - "description": "The plant's name" - }, - "edible": { - "type": "boolean", - "description": "Is the plant edible?" - } - } + "nextLink": { + "type": "string", + "description": "Link to next page of results", + "readOnly": true + } + } + }, + "Plant": { + "type": "object", + "description": "A plant", + "properties": { + "name": { + "type": "string", + "description": "The plant's name" }, - "ConfigurationStoreProperties": { - "description": "The properties of a configuration store.", - "type": "object", - "properties": { - "provisioningState": { - "description": "The provisioning state of the configuration store.", - "enum": [ - "Success", - "FAILED" - ], - "type": "string", - "readOnly": true, - "x-ms-enum": { - "name": "RespStatus", - "modelAsString": true - } - }, - "status": { - "description": "The state code.", - "enum": [ - "Success", - "FAILED" - ], - "readOnly": true, - "type": "string", - "x-ms-enum": { - "name": "RespStatus", - "modelAsString": true - } - } - } + "edible": { + "type": "boolean", + "description": "Is the plant edible?" } + } }, - "parameters": {} -} \ No newline at end of file + "ConfigurationStoreProperties": { + "description": "The properties of a configuration store.", + "type": "object", + "properties": { + "provisioningState": { + "description": "The provisioning state of the configuration store.", + "enum": ["Success", "FAILED"], + "type": "string", + "readOnly": true, + "x-ms-enum": { + "name": "RespStatus", + "modelAsString": true + } + }, + "status": { + "description": "The state code.", + "enum": ["Success", "FAILED"], + "readOnly": true, + "type": "string", + "x-ms-enum": { + "name": "RespStatus", + "modelAsString": true + } + } + } + } + }, + "parameters": {} +} diff --git a/packages/rulesets/src/native/tests/resources/operations-api-validation.json b/packages/rulesets/src/native/tests/resources/operations-api-validation.json index a24600286..def880e92 100644 --- a/packages/rulesets/src/native/tests/resources/operations-api-validation.json +++ b/packages/rulesets/src/native/tests/resources/operations-api-validation.json @@ -6,18 +6,14 @@ "version": "2014-04-01-preview" }, "host": "management.azure.com", - "schemes": [ - "https" - ], + "schemes": ["https"], "basePath": "/", - "produces": [ "application/json" ], - "consumes": [ "application/json" ], + "produces": ["application/json"], + "consumes": ["application/json"], "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}": { "delete": { - "tags": [ - "Redis" - ], + "tags": ["Redis"], "operationId": "Redis_Delete", "description": "Deletes a Redis cache.", "x-ms-long-running-operation": true, @@ -51,7 +47,6 @@ "description": "" } } - } } }, @@ -86,9 +81,7 @@ "description": "Resource tags" } }, - "required": [ - "location" - ], + "required": ["location"], "x-ms-azure-resource": true } }, diff --git a/packages/rulesets/src/native/tests/resources/resource-manager/Microsoft.Network/network-interface-invalid.json b/packages/rulesets/src/native/tests/resources/resource-manager/Microsoft.Network/network-interface-invalid.json index 6fdd2457c..8a07a664e 100644 --- a/packages/rulesets/src/native/tests/resources/resource-manager/Microsoft.Network/network-interface-invalid.json +++ b/packages/rulesets/src/native/tests/resources/resource-manager/Microsoft.Network/network-interface-invalid.json @@ -1,73 +1,67 @@ { - "swagger": "2.0", - "info": { - "title": "Network interfaces have unallowed types", - "description": "Some documentation.", - "version": "2014-04-01-preview" + "swagger": "2.0", + "info": { + "title": "Network interfaces have unallowed types", + "description": "Some documentation.", + "version": "2014-04-01-preview" + }, + "host": "management.azure.com", + "schemes": ["https"], + "basePath": "/", + "produces": ["application/json"], + "consumes": ["application/json"], + "paths": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/providers/Microsoft.Computer/{applicationGatewayName}": { + "post": { + "operationId": "Noun_Verb1", + "summary": "Foo path", + "description": "Foo operation", + "responses": { + "default": { + "description": "Unexpected error" + } + } + } }, - "host": "management.azure.com", - "schemes": [ - "https" - ], - "basePath": "/", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], - "paths": { - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/providers/Microsoft.Computer/{applicationGatewayName}": { - "post": { - "operationId": "Noun_Verb1", - "summary": "Foo path", - "description": "Foo operation", - "responses": { - "default": { - "description": "Unexpected error" - } - } - } - }, - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders": { - "post": { - "operationId": "Noun_Verb2", - "summary": "Foo path", - "description": "Foo operation", - "responses": { - "default": { - "description": "Unexpected error" - } - } - } - }, - "/foo?overload=true": { - "get": { - "operationId": "Noun_Verb4", - "summary": "Foo path", - "description": "Foo operation", - "responses": { - "default": { - "description": "Unexpected error" - } - } - } + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders": { + "post": { + "operationId": "Noun_Verb2", + "summary": "Foo path", + "description": "Foo operation", + "responses": { + "default": { + "description": "Unexpected error" + } } + } }, - "parameters": { - "SubscriptionIdParameter": { - "name": "subscriptionId", - "in": "path", - "required": true, - "type": "string", - "description": "test subscription id" - }, - "ApiVersion": { - "name": "api-version", - "in": "path", - "required": true, - "type": "string", - "description": "test api version" + "/foo?overload=true": { + "get": { + "operationId": "Noun_Verb4", + "summary": "Foo path", + "description": "Foo operation", + "responses": { + "default": { + "description": "Unexpected error" + } } + } + } + }, + "parameters": { + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "description": "test subscription id" + }, + "ApiVersion": { + "name": "api-version", + "in": "path", + "required": true, + "type": "string", + "description": "test api version" } -} \ No newline at end of file + } +} diff --git a/packages/rulesets/src/native/tests/resources/securitydomain.json b/packages/rulesets/src/native/tests/resources/securitydomain.json index 6f2bb9644..ae7a1b9b1 100644 --- a/packages/rulesets/src/native/tests/resources/securitydomain.json +++ b/packages/rulesets/src/native/tests/resources/securitydomain.json @@ -20,18 +20,12 @@ } ] }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], + "consumes": ["application/json"], + "produces": ["application/json"], "paths": { "/securitydomain/download": { "post": { - "tags": [ - "HSMSecurityDomain" - ], + "tags": ["HSMSecurityDomain"], "operationId": "HSMSecurityDomain_Download", "description": "Retrieves Security domain from HSM enclave", "parameters": [ @@ -71,9 +65,7 @@ }, "/securitydomain/transferkey": { "get": { - "tags": [ - "HSMSecurityDomain" - ], + "tags": ["HSMSecurityDomain"], "parameters": [ { "$ref": "#/parameters/ApiVersionParameter" @@ -104,9 +96,7 @@ }, "/securitydomain/upload": { "post": { - "tags": [ - "HSMSecurityDomain" - ], + "tags": ["HSMSecurityDomain"], "operationId": "HSMSecurityDomain_Upload", "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { @@ -157,9 +147,7 @@ }, "/securitydomain/upload/pending": { "get": { - "tags": [ - "HSMSecurityDomain" - ], + "tags": ["HSMSecurityDomain"], "operationId": "HSMSecurityDomain_UploadPending", "description": "Get Security domain upload operation status", "responses": { @@ -198,9 +186,7 @@ "description": "Three certificates needed from customer" } }, - "required": [ - "certificates" - ] + "required": ["certificates"] }, "SecurityDomainCertificateItem": { "properties": { @@ -209,9 +195,7 @@ "description": "Customer generated certificate containing public key in JWK format" } }, - "required": [ - "value" - ] + "required": ["value"] }, "TransferKey": { "properties": { @@ -219,9 +203,7 @@ "$ref": "#/definitions/SecurityDomainJsonWebKey" } }, - "required": [ - "transfer_key" - ] + "required": ["transfer_key"] }, "SecurityDomainObject": { "properties": { @@ -234,11 +216,7 @@ "properties": { "status": { "description": "operation status", - "enum": [ - "Success", - "InProgress", - "Failed" - ], + "enum": ["Success", "InProgress", "Failed"], "x-ms-enum": { "modelAsString": false, "name": "OperationStatus" @@ -259,10 +237,7 @@ "kty": { "type": "string", "description": "JsonWebKey Key Type (kty), as defined in https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. For security domain this value must be RSA", - "enum": [ - "RSA", - "RSA-HSM" - ], + "enum": ["RSA", "RSA-HSM"], "x-ms-enum": { "name": "JsonWebKeyType", "modelAsString": true @@ -307,15 +282,7 @@ "type": "string" } }, - "required": [ - "kty", - "key_ops", - "kid", - "x5c", - "x5t#S256", - "n", - "e" - ] + "required": ["kty", "key_ops", "kid", "x5c", "x5t#S256", "n", "e"] } }, "parameters": { diff --git a/packages/rulesets/src/native/tests/resources/utilities/exception.json b/packages/rulesets/src/native/tests/resources/utilities/exception.json index 2dbe93ce8..96d3994f1 100644 --- a/packages/rulesets/src/native/tests/resources/utilities/exception.json +++ b/packages/rulesets/src/native/tests/resources/utilities/exception.json @@ -1,377 +1,363 @@ { - "swagger": "2.0", - "info": { - "title": "ApiManagementClient", - "description": "Use these REST APIs for performing operations in Azure API Management deployment.", - "version": "2020-06-01-preview" - }, - "host": "management.azure.com", - "schemes": [ - "https" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "security": [ - { - "azure_auth": [ - "user_impersonation" - ] - } - ], - "securityDefinitions": { - "azure_auth": { - "type": "oauth2", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", - "flow": "implicit", - "description": "Azure Active Directory OAuth2 Flow.", - "scopes": { - "user_impersonation": "impersonate your user account" - } - } - }, - "paths": { - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes": { - "get": { - "tags": [ - "ContentType" - ], - "operationId": "ContentType_ListByService", - "description": "Returns list of content types", - "x-ms-examples": { - "ApiManagementListContentTypes": { - "parameters": { - "resourceGroupName": "rg1", - "serviceName": "apimService1", - "api-version": "2020-06-01-preview", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/contentTypes/page", - "type": "Microsoft.ApiManagement/service/contentTypes", - "name": "page", - "properties": { - "name": "Page", - "description": "A regular page", - "schema": { - "properties": { - "en_us": { - "$ref": "#/definitions/metadata" - } - }, - "additionalProperties": false, - "definitions": { - "metadata": { - "type": "object", - "properties": { - "title": { - "title": "Title", - "description": "Page title. This property gets included in SEO attributes.", - "type": "string", - "indexed": true - }, - "description": { - "title": "Description", - "description": "Page description. This property gets included in SEO attributes.", - "type": "string", - "indexed": true - }, - "keywords": { - "title": "Keywords", - "description": "Page keywords. This property gets included in SEO attributes.", - "type": "string", - "indexed": true - }, - "permalink": { - "title": "Permalink", - "description": "Page permalink, e.g. '/about'.", - "type": "string", - "indexed": true - }, - "documentId": { - "title": "Document ID", - "description": "Reference to page content document.", - "type": "string" + "swagger": "2.0", + "info": { + "title": "ApiManagementClient", + "description": "Use these REST APIs for performing operations in Azure API Management deployment.", + "version": "2020-06-01-preview" + }, + "host": "management.azure.com", + "schemes": ["https"], + "consumes": ["application/json"], + "produces": ["application/json"], + "security": [ + { + "azure_auth": ["user_impersonation"] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow.", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "paths": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes": { + "get": { + "tags": ["ContentType"], + "operationId": "ContentType_ListByService", + "description": "Returns list of content types", + "x-ms-examples": { + "ApiManagementListContentTypes": { + "parameters": { + "resourceGroupName": "rg1", + "serviceName": "apimService1", + "api-version": "2020-06-01-preview", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/contentTypes/page", + "type": "Microsoft.ApiManagement/service/contentTypes", + "name": "page", + "properties": { + "name": "Page", + "description": "A regular page", + "schema": { + "properties": { + "en_us": { + "$ref": "#/definitions/metadata" + } + }, + "additionalProperties": false, + "definitions": { + "metadata": { + "type": "object", + "properties": { + "title": { + "title": "Title", + "description": "Page title. This property gets included in SEO attributes.", + "type": "string", + "indexed": true + }, + "description": { + "title": "Description", + "description": "Page description. This property gets included in SEO attributes.", + "type": "string", + "indexed": true + }, + "keywords": { + "title": "Keywords", + "description": "Page keywords. This property gets included in SEO attributes.", + "type": "string", + "indexed": true + }, + "permalink": { + "title": "Permalink", + "description": "Page permalink, e.g. '/about'.", + "type": "string", + "indexed": true + }, + "documentId": { + "title": "Document ID", + "description": "Reference to page content document.", + "type": "string" + } + }, + "additionalProperties": false, + "required": ["title", "permalink", "documentId"] + } + } + }, + "version": "1.0.0" + } + } + ] } - }, - "additionalProperties": false, - "required": [ - "title", - "permalink", - "documentId" - ] } - } - }, - "version": "1.0.0" - } + } + } + }, + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServiceNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" } - ] + ], + "responses": { + "200": { + "description": "Lists a collection of content type entities.", + "schema": { + "$ref": "#/definitions/ContentTypeCollection" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" } - } } - } + } + }, + "definitions": { + "ErrorFieldContract": { + "properties": { + "code": { + "type": "string", + "description": "Property level error code." + }, + "message": { + "type": "string", + "description": "Human-readable representation of property-level error." + }, + "target": { + "type": "string", + "description": "Property name." + } + }, + "description": "Error Field contract." }, - "parameters": [ - { - "$ref": "#/parameters/ResourceGroupNameParameter" - }, - { - "$ref": "#/parameters/ServiceNameParameter" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" - } - ], - "responses": { - "200": { - "description": "Lists a collection of content type entities.", - "schema": { - "$ref": "#/definitions/ContentTypeCollection" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } + "ErrorResponseBody": { + "properties": { + "code": { + "type": "string", + "description": "Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response." + }, + "message": { + "type": "string", + "description": "Human-readable representation of the error." + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorFieldContract" + }, + "description": "The list of invalid fields send in request, in case of validation error." + } + }, + "description": "Error Body contract." }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - } - }, - "definitions": { - "ErrorFieldContract": { - "properties": { - "code": { - "type": "string", - "description": "Property level error code." + "ErrorResponse": { + "properties": { + "error": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/ErrorResponseBody", + "description": "Properties of the Error Response." + } + }, + "description": "Error Response." }, - "message": { - "type": "string", - "description": "Human-readable representation of property-level error." + "Resource": { + "description": "The Resource definition.", + "x-ms-azure-resource": true, + "properties": { + "id": { + "readOnly": true, + "type": "string", + "description": "Resource ID." + }, + "name": { + "type": "string", + "description": "Resource name.", + "readOnly": true + }, + "type": { + "readOnly": true, + "type": "string", + "description": "Resource type for API Management resource." + } + } }, - "target": { - "type": "string", - "description": "Property name." - } - }, - "description": "Error Field contract." - }, - "ErrorResponseBody": { - "properties": { - "code": { - "type": "string", - "description": "Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response." + "ContentItemContractProperties": { + "properties": {}, + "additionalProperties": { + "type": "object" + } }, - "message": { - "type": "string", - "description": "Human-readable representation of the error." + "ContentItemContract": { + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/ContentItemContractProperties", + "description": "Properties of the content item." + } + }, + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "description": "Content type contract details." }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/ErrorFieldContract" - }, - "description": "The list of invalid fields send in request, in case of validation error." - } - }, - "description": "Error Body contract." - }, - "ErrorResponse": { - "properties": { - "error": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/ErrorResponseBody", - "description": "Properties of the Error Response." - } - }, - "description": "Error Response." - }, - "Resource": { - "description": "The Resource definition.", - "x-ms-azure-resource": true, - "properties": { - "id": { - "readOnly": true, - "type": "string", - "description": "Resource ID." + "ContentItemCollection": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/ContentItemContract" + }, + "description": "Collection of content items.", + "readOnly": true + }, + "nextLink": { + "type": "string", + "description": "Next page link, if any.", + "readOnly": true + } + }, + "description": "Paged list of content items." }, - "name": { - "type": "string", - "description": "Resource name.", - "readOnly": true + "ContentTypeContractProperties": { + "properties": { + "id": { + "type": "string", + "description": "Content type identifier" + }, + "name": { + "type": "string", + "description": "Content type name. Must be 1 to 250 characters long." + }, + "description": { + "type": "string", + "description": "Content type description." + }, + "schema": { + "type": "object", + "description": "Content type schema." + }, + "version": { + "type": "string", + "description": "Content type version." + } + } }, - "type": { - "readOnly": true, - "type": "string", - "description": "Resource type for API Management resource." - } - } - }, - "ContentItemContractProperties": { - "properties": {}, - "additionalProperties": { - "type": "object" - } - }, - "ContentItemContract": { - "properties": { - "properties": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/ContentItemContractProperties", - "description": "Properties of the content item." - } - }, - "allOf": [ - { - "$ref": "#/definitions/Resource" - } - ], - "description": "Content type contract details." - }, - "ContentItemCollection": { - "properties": { - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/ContentItemContract" - }, - "description": "Collection of content items.", - "readOnly": true + "ContentTypeContract": { + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/ContentTypeContractProperties", + "description": "Properties of the content type." + } + }, + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "description": "Content type contract details." }, - "nextLink": { - "type": "string", - "description": "Next page link, if any.", - "readOnly": true + "ContentTypeCollection": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/ContentTypeContract" + }, + "description": "Collection of content types.", + "readOnly": true + }, + "nextLink": { + "type": "string", + "description": "Next page link, if any.", + "readOnly": true + } + }, + "description": "Paged list of content types." } - }, - "description": "Paged list of content items." }, - "ContentTypeContractProperties": { - "properties": { - "id": { - "type": "string", - "description": "Content type identifier" + "parameters": { + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call." }, - "name": { - "type": "string", - "description": "Content type name. Must be 1 to 250 characters long." + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "Version of the API to be used with the client request." }, - "description": { - "type": "string", - "description": "Content type description." + "ContentItemIdParameter": { + "name": "contentItemId", + "in": "path", + "required": true, + "type": "string", + "description": "Content item identifier.", + "minLength": 1, + "maxLength": 80, + "x-ms-parameter-location": "method" }, - "schema": { - "type": "object", - "description": "Content type schema." + "ContentTypeIdParameter": { + "name": "contentTypeId", + "in": "path", + "required": true, + "type": "string", + "description": "Content type identifier.", + "minLength": 1, + "maxLength": 80, + "x-ms-parameter-location": "method" }, - "version": { - "type": "string", - "description": "Content type version." - } - } - }, - "ContentTypeContract": { - "properties": { - "properties": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/ContentTypeContractProperties", - "description": "Properties of the content type." - } - }, - "allOf": [ - { - "$ref": "#/definitions/Resource" - } - ], - "description": "Content type contract details." - }, - "ContentTypeCollection": { - "properties": { - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/ContentTypeContract" - }, - "description": "Collection of content types.", - "readOnly": true + "ServiceNameParameter": { + "name": "serviceName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the API Management service.", + "minLength": 1, + "maxLength": 50, + "pattern": "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$", + "x-ms-parameter-location": "method" }, - "nextLink": { - "type": "string", - "description": "Next page link, if any.", - "readOnly": true + "ResourceGroupNameParameter": { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group.", + "x-ms-parameter-location": "method" } - }, - "description": "Paged list of content types." - } - }, - "parameters": { - "SubscriptionIdParameter": { - "name": "subscriptionId", - "in": "path", - "required": true, - "type": "string", - "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call." - }, - "ApiVersionParameter": { - "name": "api-version", - "in": "query", - "required": true, - "type": "string", - "description": "Version of the API to be used with the client request." - }, - "ContentItemIdParameter": { - "name": "contentItemId", - "in": "path", - "required": true, - "type": "string", - "description": "Content item identifier.", - "minLength": 1, - "maxLength": 80, - "x-ms-parameter-location": "method" - }, - "ContentTypeIdParameter": { - "name": "contentTypeId", - "in": "path", - "required": true, - "type": "string", - "description": "Content type identifier.", - "minLength": 1, - "maxLength": 80, - "x-ms-parameter-location": "method" - }, - "ServiceNameParameter": { - "name": "serviceName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the API Management service.", - "minLength": 1, - "maxLength": 50, - "pattern": "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$", - "x-ms-parameter-location": "method" - }, - "ResourceGroupNameParameter": { - "name": "resourceGroupName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the resource group.", - "x-ms-parameter-location": "method" } - } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/native/utilities/jsonpath.ts b/packages/rulesets/src/native/utilities/jsonpath.ts index a14c94cfb..48d146065 100644 --- a/packages/rulesets/src/native/utilities/jsonpath.ts +++ b/packages/rulesets/src/native/utilities/jsonpath.ts @@ -1,14 +1,12 @@ -import {JSONPath} from "jsonpath-plus" +import { JSONPath } from "jsonpath-plus" export function nodes(obj: any, pathExpression: string) { try { const result = JSONPath({ json: obj, path: pathExpression, resultType: "all" }) - return result.map((v:any) => ({ path: JSONPath.toPathArray(v.path), value: v.value, parent: v.parent })) - } - catch(e) { + return result.map((v: any) => ({ path: JSONPath.toPathArray(v.path), value: v.value, parent: v.parent })) + } catch (e) { return [] } - } export function stringify(path: string[]) { diff --git a/packages/rulesets/src/native/utilities/rules-helper.ts b/packages/rulesets/src/native/utilities/rules-helper.ts index 754e32571..4255ce7cf 100644 --- a/packages/rulesets/src/native/utilities/rules-helper.ts +++ b/packages/rulesets/src/native/utilities/rules-helper.ts @@ -56,7 +56,7 @@ export function getAllResourceProvidersFromPath(path: string): string[] { return Array.from(matchAll(path, resourceProviderRegex), (m: any) => m[1]) } -export function getProviderNamespace(apiPath:string) { +export function getProviderNamespace(apiPath: string) { const matches = getAllResourceProvidersFromPath(apiPath) if (matches.length) { return matches.pop() @@ -64,19 +64,18 @@ export function getProviderNamespace(apiPath:string) { return undefined } -export function getProviderNamespaceFromPath(filePath:string) { +export function getProviderNamespaceFromPath(filePath: string) { if (!filePath) { return undefined } const resourceProviderRegex = new RegExp(/\/(Microsoft\.\w+)\//i, "g") - const match = Array.from(matchAll(filePath.replace(/\\/g,"/"),resourceProviderRegex), (m: any) => m[1]) + const match = Array.from(matchAll(filePath.replace(/\\/g, "/"), resourceProviderRegex), (m: any) => m[1]) if (match) { return match[0] } return undefined } - export function getAllWordsFromPath(path: string): string[] { const wordRegex = new RegExp(/([\w.]+)/, "g") return Array.from(matchAll(path, wordRegex), (m: any) => m[1]) @@ -138,14 +137,14 @@ export function stringify(path: string[]) { return JSONPath.toPathString(pathWithRoot) } -export function getResourceProvider(inventory:ISwaggerInventory) { +export function getResourceProvider(inventory: ISwaggerInventory) { const walker = new SwaggerWalker(inventory) - let result: string[] = [] - walker.warkAll(["$.paths.*"], (path: string[]) => { - const apiPath = path[2] as string - if (result.length === 0) { - result = [...getAllResourceProvidersFromPath(apiPath)] - } - }) - return result.length ? result.pop() || "" : "" -} \ No newline at end of file + let result: string[] = [] + walker.warkAll(["$.paths.*"], (path: string[]) => { + const apiPath = path[2] as string + if (result.length === 0) { + result = [...getAllResourceProvidersFromPath(apiPath)] + } + }) + return result.length ? result.pop() || "" : "" +} diff --git a/packages/rulesets/src/native/utilities/swagger-workspace.ts b/packages/rulesets/src/native/utilities/swagger-workspace.ts index 698f2837a..889ce1f80 100644 --- a/packages/rulesets/src/native/utilities/swagger-workspace.ts +++ b/packages/rulesets/src/native/utilities/swagger-workspace.ts @@ -73,7 +73,7 @@ export namespace Workspace { return undefined } - export function getProperties(schema: EnhancedSchema, inventory: ISwaggerInventory) { + export function getProperties(schema: EnhancedSchema, inventory: ISwaggerInventory) { let source = schema const visited = new Set() while (source.value && source.value.$ref && !visited.has(source.value)) { @@ -83,10 +83,10 @@ export namespace Workspace { if (!source || !source.value) { return [] } - let result:{[key:string]:EnhancedSchema} = {} + let result: { [key: string]: EnhancedSchema } = {} const model = source.value if (model.properties) { - for (const propertyName of Object.keys(model.properties)){ + for (const propertyName of Object.keys(model.properties)) { result[propertyName] = createEnhancedSchema(model.properties[propertyName], source.file) } } @@ -94,7 +94,7 @@ export namespace Workspace { for (const element of model.allOf) { const properties: any = getProperties({ file: source.file, value: element }, inventory) if (properties) { - result = {...properties,...result} + result = { ...properties, ...result } } } } diff --git a/packages/rulesets/src/spectral/az-arm.ts b/packages/rulesets/src/spectral/az-arm.ts index 22f413221..05e630211 100644 --- a/packages/rulesets/src/spectral/az-arm.ts +++ b/packages/rulesets/src/spectral/az-arm.ts @@ -610,6 +610,16 @@ const ruleset: any = { function: httpsSupportedScheme, }, }, + MissingDefaultResponse: { + description: "All operations should have a default (error) response.", + message: "Operation is missing a default response.", + severity: "error", + given: "$.paths.*.*.responses", + then: { + field: "default", + function: truthy, + }, + }, }, } diff --git a/packages/rulesets/src/spectral/az-common.ts b/packages/rulesets/src/spectral/az-common.ts index bad8d1500..691f77393 100644 --- a/packages/rulesets/src/spectral/az-common.ts +++ b/packages/rulesets/src/spectral/az-common.ts @@ -496,7 +496,7 @@ const ruleset: any = { severity: "warn", resolved: false, formats: [oas2], - given: ["$..[?(@object() && @.properties)][?(@object() && @.properties)].properties"], + given: ["$..[?(@object() && @.properties)].properties[?(@object() && @.properties)].properties^"], then: { field: "x-ms-client-flatten", function: truthy, diff --git a/packages/rulesets/src/spectral/functions/Extensions/long-running-operations-options-validator.ts b/packages/rulesets/src/spectral/functions/Extensions/long-running-operations-options-validator.ts index 5b93a0868..779db173c 100644 --- a/packages/rulesets/src/spectral/functions/Extensions/long-running-operations-options-validator.ts +++ b/packages/rulesets/src/spectral/functions/Extensions/long-running-operations-options-validator.ts @@ -2,19 +2,19 @@ export const longRunningOperationsOptionsValidator = (postOp: any, _opts: any, ctx: any) => { if (postOp === null || typeof postOp !== "object") { - return []; + return [] } - const path = ctx.path || []; + const path = ctx.path || [] if (!postOp["x-ms-long-running-operation"]) { - return []; + return [] } - const errors: any = []; - const responses = postOp?.responses; - let schemaAvailable = false; + const errors: any = [] + const responses = postOp?.responses + let schemaAvailable = false for (const responseCode in responses) { if (responseCode[0] === "2" && responses[responseCode]?.schema !== undefined) { - schemaAvailable = true; - break; + schemaAvailable = true + break } } if ( @@ -25,7 +25,7 @@ export const longRunningOperationsOptionsValidator = (postOp: any, _opts: any, c errors.push({ message: `A LRO Post operation with return schema must have "x-ms-long-running-operation-options" extension enabled.`, path: [...path.slice(0, -1)], - }); + }) } - return errors; -}; + return errors +} diff --git a/packages/rulesets/src/spectral/functions/Extensions/long-running-response-status-code.ts b/packages/rulesets/src/spectral/functions/Extensions/long-running-response-status-code.ts index 4157da6e3..b8b61c970 100644 --- a/packages/rulesets/src/spectral/functions/Extensions/long-running-response-status-code.ts +++ b/packages/rulesets/src/spectral/functions/Extensions/long-running-response-status-code.ts @@ -1,42 +1,33 @@ // An x-ms-long-running-operation extension passes this rule if the operation that this extension has a valid response defined. -const longRunningResponseStatusCode = ( - methodOp: any, - _opts: any, - ctx: any, - validResponseCodesList: any -) => { +const longRunningResponseStatusCode = (methodOp: any, _opts: any, ctx: any, validResponseCodesList: any) => { if (methodOp === null || typeof methodOp !== "object") { - return []; + return [] } - const path = ctx.path || []; - const errors: any = []; - const method = Object.keys(methodOp)[0]; + const path = ctx.path || [] + const errors: any = [] + const method = Object.keys(methodOp)[0] if (!["delete", "put", "patch", "post"].includes(method)) { - return []; + return [] } - const operationId = methodOp?.[method]?.operationId || ""; + const operationId = methodOp?.[method]?.operationId || "" if (!methodOp?.[method]?.["x-ms-long-running-operation"]) { - return []; + return [] } if (methodOp?.[method]?.responses) { - const responseCodes = Object.keys(methodOp?.[method]?.responses); - const validResponseCodes = validResponseCodesList[method]; - const validResponseCodeString = validResponseCodes.join(" or "); - for (const responseCode of responseCodes) { - if ( - (responseCodes.length === 1 && !validResponseCodes.includes(responseCode)) || - (responseCode !== "default" && !validResponseCodes.includes(responseCode)) - ) { - errors.push({ - message: `A '${method}' operation '${operationId}' with x-ms-long-running-operation extension must have a valid terminal success status code ${validResponseCodeString}.`, - path: [...path, method], - }); - } + const responseCodes = Object.keys(methodOp?.[method]?.responses) + const validResponseCodes = validResponseCodesList[method] + const validResponseCodeString = validResponseCodes.join(" or ") + const withTerminalCode = validResponseCodes.some((code: string) => responseCodes.includes(code)) + if (!withTerminalCode) { + errors.push({ + message: `A '${method}' operation '${operationId}' with x-ms-long-running-operation extension must have a valid terminal success status code ${validResponseCodeString}.`, + path: [...path, method], + }) } } - return errors; -}; + return errors +} export const longRunningResponseStatusCodeArm = (methodOp: any, _opts: any, ctx: any) => { const validResponseCodesList: any = { @@ -44,9 +35,9 @@ export const longRunningResponseStatusCodeArm = (methodOp: any, _opts: any, ctx: post: ["200", "201", "202", "204"], put: ["200", "201"], patch: ["200", "201", "202"], - }; - return longRunningResponseStatusCode(methodOp, _opts, ctx, validResponseCodesList); -}; + } + return longRunningResponseStatusCode(methodOp, _opts, ctx, validResponseCodesList) +} export const longRunningResponseStatusCodeDataPlane = (methodOp: any, _opts: any, ctx: any) => { const validResponseCodesList: any = { @@ -54,6 +45,6 @@ export const longRunningResponseStatusCodeDataPlane = (methodOp: any, _opts: any post: ["200", "201", "202", "204"], put: ["200", "201", "202"], patch: ["200", "201", "202"], - }; - return longRunningResponseStatusCode(methodOp, _opts, ctx, validResponseCodesList); -}; + } + return longRunningResponseStatusCode(methodOp, _opts, ctx, validResponseCodesList) +} diff --git a/packages/rulesets/src/spectral/functions/Extensions/mutability-with-read-only.ts b/packages/rulesets/src/spectral/functions/Extensions/mutability-with-read-only.ts index 45f425d41..1e6d6d7f7 100644 --- a/packages/rulesets/src/spectral/functions/Extensions/mutability-with-read-only.ts +++ b/packages/rulesets/src/spectral/functions/Extensions/mutability-with-read-only.ts @@ -2,35 +2,31 @@ export const mutabilityWithReadOnly = (prop: any, _opts: any, ctx: any) => { if (prop === null || typeof prop !== "object") { - return []; + return [] } - if ( - prop.readOnly === undefined || - prop["x-ms-mutability"] === undefined || - prop["x-ms-mutability"].length === 0 - ) { - return []; + if (prop.readOnly === undefined || prop["x-ms-mutability"] === undefined || prop["x-ms-mutability"].length === 0) { + return [] } - const path = ctx.path || []; - const errors: any = []; - let hasErrors = false; - let invalidValues = ""; + const path = ctx.path || [] + const errors: any = [] + let hasErrors = false + let invalidValues = "" if (prop.readOnly === true) { if (prop["x-ms-mutability"].length !== 1 || prop["x-ms-mutability"][0] !== "read") { - hasErrors = true; - invalidValues = prop["x-ms-mutability"].join(", "); + hasErrors = true + invalidValues = prop["x-ms-mutability"].join(", ") } } else { if (prop["x-ms-mutability"].length === 1 && prop["x-ms-mutability"][0] === "read") { - hasErrors = true; - invalidValues = "read"; + hasErrors = true + invalidValues = "read" } } if (hasErrors) { errors.push({ message: `When property is modeled as "readOnly": true then x-ms-mutability extension can only have "read" value. When property is modeled as "readOnly": false then applying x-ms-mutability extension with only "read" value is not allowed. Extension contains invalid values: '${invalidValues}'.`, path: [...path], - }); + }) } - return errors; -}; + return errors +} diff --git a/packages/rulesets/src/spectral/functions/Extensions/next-link-property-must-exist.ts b/packages/rulesets/src/spectral/functions/Extensions/next-link-property-must-exist.ts index c8bbd49b9..9321a4934 100644 --- a/packages/rulesets/src/spectral/functions/Extensions/next-link-property-must-exist.ts +++ b/packages/rulesets/src/spectral/functions/Extensions/next-link-property-must-exist.ts @@ -1,29 +1,26 @@ // An x-ms-pageable extension passes this rule if the value for nextLinkName refers to a string property // that exists on the schema for the 200 response of the parent operation. -import { getProperties } from "../utils"; +import { getProperties } from "../utils" export const nextLinkPropertyMustExist = (opt: any, _opts: any, ctx: any) => { if (opt === null || typeof opt !== "object") { - return []; + return [] } if (opt["x-ms-pageable"] === undefined) { - return []; + return [] } - const path = ctx.path || []; - const errors: any = []; - const nextLinkName = opt["x-ms-pageable"]?.nextLinkName || null; - const responseSchemaProperties = getProperties(opt?.responses?.["200"]?.schema); + const path = ctx.path || [] + const errors: any = [] + const nextLinkName = opt["x-ms-pageable"]?.nextLinkName || null + const responseSchemaProperties = getProperties(opt?.responses?.["200"]?.schema) if (nextLinkName !== null && nextLinkName !== "") { - if ( - Object.keys(responseSchemaProperties).length === 0 || - !Object.keys(responseSchemaProperties).includes(nextLinkName) - ) { + if (Object.keys(responseSchemaProperties).length === 0 || !Object.keys(responseSchemaProperties).includes(nextLinkName)) { errors.push({ message: `The property '${nextLinkName}' specified by nextLinkName does not exist in the 200 response schema. Please, specify the name of the property that provides the nextLink. If the model does not have the nextLink property then specify null.`, path: [...path], - }); + }) } } - return errors; -}; + return errors +} diff --git a/packages/rulesets/src/spectral/functions/Extensions/xms-client-name.ts b/packages/rulesets/src/spectral/functions/Extensions/xms-client-name.ts index aa4d3bd4f..f8779f696 100644 --- a/packages/rulesets/src/spectral/functions/Extensions/xms-client-name.ts +++ b/packages/rulesets/src/spectral/functions/Extensions/xms-client-name.ts @@ -2,27 +2,27 @@ export const xmsClientName = (opt: any, _opts: any, ctx: any) => { if (opt === null || typeof opt !== "object") { - return []; + return [] } if (opt["x-ms-client-name"] === undefined) { - return []; + return [] } - const path = ctx.path || []; - const errors: any = []; + const path = ctx.path || [] + const errors: any = [] if (path.includes("parameters")) { if (opt["x-ms-client-name"] === opt.name) { errors.push({ message: `Value of 'x-ms-client-name' cannot be the same as '${opt.name}' Property/Model.`, path: [...path], - }); + }) } } else { if (opt["x-ms-client-name"] === path.slice(-1)[0]) { errors.push({ message: `Value of 'x-ms-client-name' cannot be the same as '${path.slice(-1)[0]}' Property/Model.`, path: [...path], - }); + }) } } - return errors; -}; + return errors +} diff --git a/packages/rulesets/src/spectral/functions/Extensions/xms-paths-must-overload-paths.ts b/packages/rulesets/src/spectral/functions/Extensions/xms-paths-must-overload-paths.ts index bdf1bbbf6..e7e7a5eff 100644 --- a/packages/rulesets/src/spectral/functions/Extensions/xms-paths-must-overload-paths.ts +++ b/packages/rulesets/src/spectral/functions/Extensions/xms-paths-must-overload-paths.ts @@ -2,19 +2,19 @@ export const xmsPathsMustOverloadPaths = (xmsPaths: any, _opts: any, ctx: any) => { if (xmsPaths === null || typeof xmsPaths !== "object") { - return []; + return [] } - const path = ctx.path || []; - const errors: any = []; - const swagger = ctx?.documentInventory?.resolved; + const path = ctx.path || [] + const errors: any = [] + const swagger = ctx?.documentInventory?.resolved for (const xmsPath in xmsPaths) { - const pathName = xmsPath.split("?")[0]; + const pathName = xmsPath.split("?")[0] if (!Object.keys(swagger.paths).includes(pathName)) { errors.push({ message: `Paths in x-ms-paths must overload a normal path in the paths section, i.e. a path in the x-ms-paths must either be same as a path in the paths section or a path in the paths sections followed by additional parameters.`, path: [...path, xmsPath], - }); + }) } } - return errors; -}; + return errors +} diff --git a/packages/rulesets/src/spectral/functions/avoid-msdn-references.ts b/packages/rulesets/src/spectral/functions/avoid-msdn-references.ts index af2757cee..dcfe033a0 100644 --- a/packages/rulesets/src/spectral/functions/avoid-msdn-references.ts +++ b/packages/rulesets/src/spectral/functions/avoid-msdn-references.ts @@ -1,22 +1,22 @@ //The documentation is being generated from the OpenAPI(swagger) and published at "docs.microsoft.com". //From that perspective, documentation team would like to avoid having links to the "msdn.microsoft.com" in the OpenAPI(swagger) and SDK documentations. //For better generated code quality, remove all references to "msdn.microsoft.com". -const avoidMsdnReferences = (swaggerObj:any, _opts:any, paths:any) => { +const avoidMsdnReferences = (swaggerObj: any, _opts: any, paths: any) => { if (swaggerObj === null) { - return []; + return [] } - if (typeof swaggerObj === "string" && !swaggerObj.includes("https://msdn.microsoft.com")) - return []; + if (typeof swaggerObj === "string" && !swaggerObj.includes("https://msdn.microsoft.com")) return [] if (typeof swaggerObj === "object") { - const docUrl: string = swaggerObj.url; - if (docUrl === undefined || !docUrl.startsWith("https://msdn.microsoft.com")) - return []; + const docUrl: string = swaggerObj.url + if (docUrl === undefined || !docUrl.startsWith("https://msdn.microsoft.com")) return [] } - const path = paths.path || []; - return [{ - message: 'For better generated code quality, remove all references to "msdn.microsoft.com".', - path, - }]; -}; + const path = paths.path || [] + return [ + { + message: 'For better generated code quality, remove all references to "msdn.microsoft.com".', + path, + }, + ] +} export default avoidMsdnReferences diff --git a/packages/rulesets/src/spectral/functions/camel-case.ts b/packages/rulesets/src/spectral/functions/camel-case.ts index 0d6a1ac3d..7b6f91600 100644 --- a/packages/rulesets/src/spectral/functions/camel-case.ts +++ b/packages/rulesets/src/spectral/functions/camel-case.ts @@ -6,17 +6,17 @@ export function camelCase(propertyName: string, options: any, { path }: { path: if (!propertyName) { return [] as IFunctionResult[] } - const errors:IFunctionResult[] = [] + const errors: IFunctionResult[] = [] const camelCaseReg = /^[a-z0-9$-]+([A-Z]{1,3}[a-z0-9$-]+)+$|^[a-z0-9$-]+$|^[a-z0-9$-]+([A-Z]{1,3}[a-z0-9$-]+)*[A-Z]{1,3}$/ if (!camelCaseReg.test(propertyName)) { errors.push({ - message:"", - path + message: "", + path, }) } return errors } -export default camelCase \ No newline at end of file +export default camelCase diff --git a/packages/rulesets/src/spectral/functions/collection-object-properties-naming.ts b/packages/rulesets/src/spectral/functions/collection-object-properties-naming.ts index 9c15ec3df..3a08bfd26 100644 --- a/packages/rulesets/src/spectral/functions/collection-object-properties-naming.ts +++ b/packages/rulesets/src/spectral/functions/collection-object-properties-naming.ts @@ -14,14 +14,13 @@ const collectionObjectPropertiesNaming = (op: any, _opts: any, paths: any) => { const regex = /.+_List([^_]*)$/ if (op && regex.test(op.operationId) && isPageableOperation(op)) { const schema = op.responses?.["200"]?.schema - const valueSchema = getProperty(schema,"value") + const valueSchema = getProperty(schema, "value") if (schema && !(valueSchema && valueSchema.type === "array")) { errors.push({ - message:`Collection object returned by list operation '${op.operationId}' with 'x-ms-pageable' extension, has no property named 'value'.`, - path: path.concat(['responses',"200","schema"]) + message: `Collection object returned by list operation '${op.operationId}' with 'x-ms-pageable' extension, has no property named 'value'.`, + path: path.concat(["responses", "200", "schema"]), }) } - } return errors } diff --git a/packages/rulesets/src/spectral/functions/consistent-response-body.ts b/packages/rulesets/src/spectral/functions/consistent-response-body.ts index 7e99b2e19..cef56fac9 100644 --- a/packages/rulesets/src/spectral/functions/consistent-response-body.ts +++ b/packages/rulesets/src/spectral/functions/consistent-response-body.ts @@ -3,30 +3,30 @@ // pathItem should be a [path item object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#pathItemObject). // This function assumes it is running on a resolved doc. -const consistentresponsebody = (pathItem:any, _opts:any, paths:any) => { - if (pathItem === null || typeof pathItem !== 'object') { - return []; +const consistentresponsebody = (pathItem: any, _opts: any, paths: any) => { + if (pathItem === null || typeof pathItem !== "object") { + return [] } - const path = paths.path || []; + const path = paths.path || [] - const errors:any = []; + const errors: any = [] // resource schema is create operation response schema - const createResponseSchema = ((op:any) => op?.responses?.['201']?.schema); - const resourceSchema = createResponseSchema(pathItem.put) || createResponseSchema(pathItem.patch); + const createResponseSchema = (op: any) => op?.responses?.["201"]?.schema + const resourceSchema = createResponseSchema(pathItem.put) || createResponseSchema(pathItem.patch) if (resourceSchema) { - ['put', 'get', 'patch'].forEach((method) => { - const responseSchema = pathItem[method]?.responses?.['200']?.schema; + ;["put", "get", "patch"].forEach((method) => { + const responseSchema = pathItem[method]?.responses?.["200"]?.schema if (responseSchema && responseSchema !== resourceSchema) { errors.push({ - message: 'Response body schema does not match create response body schema.', - path: [...path, method, 'responses', '200', 'schema'], - }); + message: "Response body schema does not match create response body schema.", + path: [...path, method, "responses", "200", "schema"], + }) } - }); + }) } - return errors; -}; + return errors +} -export default consistentresponsebody \ No newline at end of file +export default consistentresponsebody diff --git a/packages/rulesets/src/spectral/functions/delete-204-response.ts b/packages/rulesets/src/spectral/functions/delete-204-response.ts index 84ce78a5e..42a50bea0 100644 --- a/packages/rulesets/src/spectral/functions/delete-204-response.ts +++ b/packages/rulesets/src/spectral/functions/delete-204-response.ts @@ -2,21 +2,23 @@ // - except when it has a 202 response. // given is responses of a delete operation -const delete204Response = (deleteResponses:any, _opts:any, paths:any) => { +const delete204Response = (deleteResponses: any, _opts: any, paths: any) => { // operation should be a get or post operation - if (deleteResponses === null || typeof deleteResponses !== 'object') { - return []; + if (deleteResponses === null || typeof deleteResponses !== "object") { + return [] } - const path = paths.path || []; + const path = paths.path || [] - if (!deleteResponses['204'] && !deleteResponses['202']) { - return [{ - message: 'A delete operation should have a 204 response.', - path, - }]; + if (!deleteResponses["204"] && !deleteResponses["202"]) { + return [ + { + message: "A delete operation should have a 204 response.", + path, + }, + ] } - return []; -}; + return [] +} export default delete204Response diff --git a/packages/rulesets/src/spectral/functions/delete-in-operation-name.ts b/packages/rulesets/src/spectral/functions/delete-in-operation-name.ts index 66a02407c..6ec0cc0c1 100644 --- a/packages/rulesets/src/spectral/functions/delete-in-operation-name.ts +++ b/packages/rulesets/src/spectral/functions/delete-in-operation-name.ts @@ -5,18 +5,18 @@ export const deleteInOperationName = (operationId: any, _opts: any, ctx: any) => { if (operationId === "" || typeof operationId !== "string") { - return []; + return [] } if (!operationId.includes("_")) { - return []; + return [] } - const path = ctx.path || []; - const errors: any = []; + const path = ctx.path || [] + const errors: any = [] if (!operationId.match(/^(\w+)_(Delete)/) && !operationId.match(/^(Delete)/)) { errors.push({ message: `'DELETE' operation '${operationId}' should use method name 'Delete'. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.`, path: [...path], - }); + }) } - return errors; -}; + return errors +} diff --git a/packages/rulesets/src/spectral/functions/descriptive-description-required.ts b/packages/rulesets/src/spectral/functions/descriptive-description-required.ts index 65a5d6f29..b765cfe83 100644 --- a/packages/rulesets/src/spectral/functions/descriptive-description-required.ts +++ b/packages/rulesets/src/spectral/functions/descriptive-description-required.ts @@ -1,16 +1,19 @@ //The value of the 'description' property must be descriptive. It cannot be spaces or empty description. -const descriptiveDescriptionRequired = (swaggerObj:any, _opts:any, paths:any) => { +const descriptiveDescriptionRequired = (swaggerObj: any, _opts: any, paths: any) => { if (swaggerObj === null || typeof swaggerObj !== "string") { - return []; + return [] } if (swaggerObj.trim().length != 0) { - return []; + return [] } - const path = paths.path || []; - return [{ - message: 'The value provided for description is not descriptive enough. Accurate and descriptive description is essential for maintaining reference documentation.', - path, - }]; -}; + const path = paths.path || [] + return [ + { + message: + "The value provided for description is not descriptive enough. Accurate and descriptive description is essential for maintaining reference documentation.", + path, + }, + ] +} export default descriptiveDescriptionRequired diff --git a/packages/rulesets/src/spectral/functions/enum-insteadof-boolean.ts b/packages/rulesets/src/spectral/functions/enum-insteadof-boolean.ts index 7cce2af30..f087db3cd 100644 --- a/packages/rulesets/src/spectral/functions/enum-insteadof-boolean.ts +++ b/packages/rulesets/src/spectral/functions/enum-insteadof-boolean.ts @@ -1,15 +1,17 @@ //To check if a filtered module is null. -const enumInsteadOfBoolean = (swaggerObj:any, _opts:any, paths:any) => { +const enumInsteadOfBoolean = (swaggerObj: any, _opts: any, paths: any) => { if (swaggerObj === null) { - return []; + return [] } - const path = paths.path || []; + const path = paths.path || [] - return [{ - message: 'Booleans properties are not descriptive in all cases and can make them to use, evaluate whether is makes sense to keep the property as boolean or turn it into an enum.', - path, - }]; - -}; + return [ + { + message: + "Booleans properties are not descriptive in all cases and can make them to use, evaluate whether is makes sense to keep the property as boolean or turn it into an enum.", + path, + }, + ] +} export default enumInsteadOfBoolean diff --git a/packages/rulesets/src/spectral/functions/error-response.ts b/packages/rulesets/src/spectral/functions/error-response.ts index eb0903574..cba6f457a 100644 --- a/packages/rulesets/src/spectral/functions/error-response.ts +++ b/packages/rulesets/src/spectral/functions/error-response.ts @@ -9,184 +9,180 @@ * - All 4xx or 5xx responses contain x-ms-error-response: true */ -function isArraySchema(schema:any) { - return schema.type === 'array' || !!schema.items; +function isArraySchema(schema: any) { + return schema.type === "array" || !!schema.items } -function isObjectSchema(schema:any) { +function isObjectSchema(schema: any) { // When schema contains $ref, that means it is recursive - return schema.type === 'object' || !!schema.properties || schema.$ref; + return schema.type === "object" || !!schema.properties || schema.$ref } // Validate that the schema conforms to Microsoft API Guidelines // https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses -function validateErrorResponseSchema(errorResponseSchema:any, pathToSchema:any) { - const errors = []; +function validateErrorResponseSchema(errorResponseSchema: any, pathToSchema: any) { + const errors = [] // The error response MUST be a single JSON object. if (!errorResponseSchema.properties) { errors.push({ - message: 'Error response schema must be an object schema.', + message: "Error response schema must be an object schema.", path: pathToSchema, - }); - return errors; + }) + return errors } // This object MUST have a name/value pair named "error." The value MUST be a JSON object. if (!errorResponseSchema.properties.error || !errorResponseSchema.properties.error.properties) { errors.push({ - message: 'Error response schema should contain an object property named `error`.', - path: [...pathToSchema, 'properties', 'error'], - }); - return errors; + message: "Error response schema should contain an object property named `error`.", + path: [...pathToSchema, "properties", "error"], + }) + return errors } // The `error` object should be required (always present) - if (!errorResponseSchema.required?.includes?.('error')) { + if (!errorResponseSchema.required?.includes?.("error")) { errors.push({ - message: 'The `error` property in the error response schema should be required.', - path: [...pathToSchema, 'required'], - }); + message: "The `error` property in the error response schema should be required.", + path: [...pathToSchema, "required"], + }) } - const errorSchema = errorResponseSchema.properties.error; - const pathToErrorSchema = [...pathToSchema, 'properties', 'error']; + const errorSchema = errorResponseSchema.properties.error + const pathToErrorSchema = [...pathToSchema, "properties", "error"] // Spectral message dedup will drop all but first message with the same path, so we need // combine messages when they would wind up with the same path. - const hasCode = !!errorSchema.properties.code; - const hasMessage = !!errorSchema.properties.message; + const hasCode = !!errorSchema.properties.code + const hasMessage = !!errorSchema.properties.message if (!hasCode && hasMessage) { errors.push({ - message: 'Error schema should contain `code` property.', - path: [...pathToErrorSchema, 'properties'], - }); + message: "Error schema should contain `code` property.", + path: [...pathToErrorSchema, "properties"], + }) } else if (hasCode && !hasMessage) { errors.push({ - message: 'Error schema should contain `message` property.', - path: [...pathToErrorSchema, 'properties'], - }); + message: "Error schema should contain `message` property.", + path: [...pathToErrorSchema, "properties"], + }) } else if (!hasCode && !hasMessage) { errors.push({ - message: 'Error schema should contain `code` and `message` properties.', - path: [...pathToErrorSchema, 'properties'], - }); + message: "Error schema should contain `code` and `message` properties.", + path: [...pathToErrorSchema, "properties"], + }) } - if (hasCode && errorSchema.properties.code.type !== 'string') { + if (hasCode && errorSchema.properties.code.type !== "string") { errors.push({ - message: 'The `code` property of error schema should be type `string`.', - path: [...pathToErrorSchema, 'properties', 'code', 'type'], - }); + message: "The `code` property of error schema should be type `string`.", + path: [...pathToErrorSchema, "properties", "code", "type"], + }) } - if (hasMessage && errorSchema.properties.message.type !== 'string') { + if (hasMessage && errorSchema.properties.message.type !== "string") { errors.push({ - message: 'The `message` property of error schema should be type `string`.', - path: [...pathToErrorSchema, 'properties', 'message', 'type'], - }); + message: "The `message` property of error schema should be type `string`.", + path: [...pathToErrorSchema, "properties", "message", "type"], + }) } // Check if schema defines `code` and `message` as required - if (['code', 'message'].every((prop) => !errorSchema.required?.includes?.(prop))) { + if (["code", "message"].every((prop) => !errorSchema.required?.includes?.(prop))) { // Either there is no required or it is missing both properties, so report both missing errors.push({ - message: 'Error schema should define `code` and `message` properties as required.', - path: [...pathToErrorSchema, 'required'], - }); - } else if (!errorSchema.required.includes('code')) { + message: "Error schema should define `code` and `message` properties as required.", + path: [...pathToErrorSchema, "required"], + }) + } else if (!errorSchema.required.includes("code")) { errors.push({ - message: 'Error schema should define `code` property as required.', - path: [...pathToErrorSchema, 'required'], - }); - } else if (!errorSchema.required.includes('message')) { + message: "Error schema should define `code` property as required.", + path: [...pathToErrorSchema, "required"], + }) + } else if (!errorSchema.required.includes("message")) { errors.push({ - message: 'Error schema should define `message` property as required.', - path: [...pathToErrorSchema, 'required'], - }); + message: "Error schema should define `message` property as required.", + path: [...pathToErrorSchema, "required"], + }) } // The value for the "target" name/value pair is ... the name of the property in error - if (!!errorSchema.properties.target && errorSchema.properties.target.type !== 'string') { + if (!!errorSchema.properties.target && errorSchema.properties.target.type !== "string") { errors.push({ - message: 'The `target` property of the error schema should be type `string`.', - path: [...pathToErrorSchema, 'properties', 'target'], - }); + message: "The `target` property of the error schema should be type `string`.", + path: [...pathToErrorSchema, "properties", "target"], + }) } // The value for the "details" name/value pair MUST be an array of JSON objects if (!!errorSchema.properties.details && !isArraySchema(errorSchema.properties.details)) { errors.push({ - message: 'The `details` property of the error schema should be an array.', - path: [...pathToErrorSchema, 'properties', 'details'], - }); + message: "The `details` property of the error schema should be an array.", + path: [...pathToErrorSchema, "properties", "details"], + }) } // The value for the "innererror" name/value pair MUST be an object if (!!errorSchema.properties.innererror && !isObjectSchema(errorSchema.properties.innererror)) { errors.push({ - message: 'The `innererror` property of the error schema should be an object.', - path: [...pathToErrorSchema, 'properties', 'innererror'], - }); + message: "The `innererror` property of the error schema should be an object.", + path: [...pathToErrorSchema, "properties", "innererror"], + }) } - return errors; + return errors } -function validateErrorResponse(errorResponse:any, responsePath:any) { - const errors = []; +function validateErrorResponse(errorResponse: any, responsePath: any) { + const errors = [] // The error response schema should conform to Microsoft API Guidelines if (!errorResponse.schema) { errors.push({ - message: 'Error response should have a schema.', + message: "Error response should have a schema.", path: responsePath, - }); + }) } else { - errors.push( - ...validateErrorResponseSchema(errorResponse.schema, [...responsePath, 'schema']), - ); + errors.push(...validateErrorResponseSchema(errorResponse.schema, [...responsePath, "schema"])) } // The error response should contain a x-ms-error-code header - if (!errorResponse.headers || !errorResponse.headers['x-ms-error-code']) { + if (!errorResponse.headers || !errorResponse.headers["x-ms-error-code"]) { errors.push({ - message: 'Error response should contain a x-ms-error-code header.', - path: !errorResponse.headers ? responsePath : [...responsePath, 'headers'], - }); + message: "Error response should contain a x-ms-error-code header.", + path: !errorResponse.headers ? responsePath : [...responsePath, "headers"], + }) } - return errors; + return errors } -function errorResponse(responses:any, _opts:any, paths:any) { - const errors = []; - const path = paths.path || []; +function errorResponse(responses: any, _opts: any, paths: any) { + const errors = [] + const path = paths.path || [] // Note: az-default-response rule will flag missing default response if (responses.default) { - errors.push( - ...validateErrorResponse(responses.default, [...path, 'default']), - ); + errors.push(...validateErrorResponse(responses.default, [...path, "default"])) } - Object.keys(responses).filter((code) => code.match(/[45]\d\d/)).forEach((code) => { - errors.push( - ...validateErrorResponse(responses[code], [...path, code]), - ); - - // The error response should contain x-ms-error-response: true - if (!(responses[code]['x-ms-error-response'])) { - errors.push({ - message: 'Error response should contain x-ms-error-response.', - path: [...path, code], - }); - } - }); - - return errors; + Object.keys(responses) + .filter((code) => code.match(/[45]\d\d/)) + .forEach((code) => { + errors.push(...validateErrorResponse(responses[code], [...path, code])) + + // The error response should contain x-ms-error-response: true + if (!responses[code]["x-ms-error-response"]) { + errors.push({ + message: "Error response should contain x-ms-error-response.", + path: [...path, code], + }) + } + }) + + return errors } export default errorResponse diff --git a/packages/rulesets/src/spectral/functions/get-in-operation-name.ts b/packages/rulesets/src/spectral/functions/get-in-operation-name.ts index afb4d2aad..8fb5b367b 100644 --- a/packages/rulesets/src/spectral/functions/get-in-operation-name.ts +++ b/packages/rulesets/src/spectral/functions/get-in-operation-name.ts @@ -5,15 +5,15 @@ export const getInOperationName = (operationId: any, _opts: any, ctx: any) => { if (operationId === "" || typeof operationId !== "string") { - return []; + return [] } - const path = ctx.path || []; - const errors: any = []; + const path = ctx.path || [] + const errors: any = [] if (!operationId.match(/^(\w+)_(Get|List)/) && !operationId.match(/^(Get|List)/)) { errors.push({ message: `'GET' operation '${operationId}' should use method name 'Get' or Method name start with 'List'. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.`, path: [...path], - }); + }) } - return errors; -}; + return errors +} diff --git a/packages/rulesets/src/spectral/functions/has-api-version-parameter.ts b/packages/rulesets/src/spectral/functions/has-api-version-parameter.ts index 61768dc11..27b3f6b16 100644 --- a/packages/rulesets/src/spectral/functions/has-api-version-parameter.ts +++ b/packages/rulesets/src/spectral/functions/has-api-version-parameter.ts @@ -1,4 +1,4 @@ -function checkApiVersion(param:any) { +function checkApiVersion(param: any) { if (param.in !== "query") { return false } @@ -9,44 +9,44 @@ const apiVersionName = "api-version" // Check a operation to ensure it has a api-version parameter. -const hasApiVersionParameter = (apiPath:any, opts:any, paths:any) => { - if (apiPath === null || typeof apiPath !== 'object') { - return []; +const hasApiVersionParameter = (apiPath: any, opts: any, paths: any) => { + if (apiPath === null || typeof apiPath !== "object") { + return [] } // opts must contain the name of the parameterand the http methods to check for. - if (opts === null || typeof opts !== 'object' || !opts.methods) { - return []; + if (opts === null || typeof opts !== "object" || !opts.methods) { + return [] } - const path = paths.path || []; + const path = paths.path || [] if (apiPath.parameters) { - if (apiPath.parameters.some((p:any) => p.name === apiVersionName && checkApiVersion(p))) { + if (apiPath.parameters.some((p: any) => p.name === apiVersionName && checkApiVersion(p))) { return [] } } const messages = [] for (const method of Object.keys(apiPath)) { if ((opts.methods as string[]).includes(method)) { - const param = apiPath[method]?.parameters?.filter((p:any) => p.name === apiVersionName ) + const param = apiPath[method]?.parameters?.filter((p: any) => p.name === apiVersionName) if (!param || param.length === 0) { messages.push({ message: `Operation should include an 'api-version' parameter.`, - path:[...path, method] + path: [...path, method], }) - continue; + continue } if (!checkApiVersion(param[0])) { - messages.push({ + messages.push({ message: `Operation 'api-version' parameter should be a query parameter.`, - path:[...path, method] + path: [...path, method], }) } } } - return messages; -}; + return messages +} -export default hasApiVersionParameter \ No newline at end of file +export default hasApiVersionParameter diff --git a/packages/rulesets/src/spectral/functions/has-header.ts b/packages/rulesets/src/spectral/functions/has-header.ts index 2393505dd..2b2153d20 100644 --- a/packages/rulesets/src/spectral/functions/has-header.ts +++ b/packages/rulesets/src/spectral/functions/has-header.ts @@ -1,31 +1,30 @@ // Check a response to ensure it has a specific header. // Comparison must be done case-insensitively since that is the HTTP rule. -const hasHeader = (response:any, opts:any, paths:any) => { - if (response === null || typeof response !== 'object') { - return []; +const hasHeader = (response: any, opts: any, paths: any) => { + if (response === null || typeof response !== "object") { + return [] } // opts must contain the name of the header to check for - if (opts === null || typeof opts !== 'object' || !opts.name) { - return []; + if (opts === null || typeof opts !== "object" || !opts.name) { + return [] } - const path = paths.path || []; + const path = paths.path || [] - const hasHeader = Object.keys(response.headers || {}) - .some((name) => name.toLowerCase() === opts.name.toLowerCase()); + const hasHeader = Object.keys(response.headers || {}).some((name) => name.toLowerCase() === opts.name.toLowerCase()) if (!hasHeader) { return [ { message: `Response should include an "${opts.name}" response header.`, - path: [...path, 'headers'], + path: [...path, "headers"], }, - ]; + ] } - return []; -}; + return [] +} -export default hasHeader \ No newline at end of file +export default hasHeader diff --git a/packages/rulesets/src/spectral/functions/https-supported-scheme.ts b/packages/rulesets/src/spectral/functions/https-supported-scheme.ts index f2b174df0..7db33feb8 100644 --- a/packages/rulesets/src/spectral/functions/https-supported-scheme.ts +++ b/packages/rulesets/src/spectral/functions/https-supported-scheme.ts @@ -1,15 +1,15 @@ //Verifies whether specification supports HTTPS scheme or not. -const httpsSupportedScheme = (scheme:any, _opts:any, paths:any) => { - if(scheme == null || typeof scheme !== "object") - return []; - const schemeArray: string[] = scheme; - if(schemeArray[0] === "https" && schemeArray.length === 1) - return []; - const path = paths.path || []; - return [{ - message: 'Azure Resource Management only supports HTTPS scheme.', - path, - }]; -}; +const httpsSupportedScheme = (scheme: any, _opts: any, paths: any) => { + if (scheme == null || typeof scheme !== "object") return [] + const schemeArray: string[] = scheme + if (schemeArray[0] === "https" && schemeArray.length === 1) return [] + const path = paths.path || [] + return [ + { + message: "Azure Resource Management only supports HTTPS scheme.", + path, + }, + ] +} export default httpsSupportedScheme diff --git a/packages/rulesets/src/spectral/functions/list-in-operation-name.ts b/packages/rulesets/src/spectral/functions/list-in-operation-name.ts index 64de92648..ea09aad12 100644 --- a/packages/rulesets/src/spectral/functions/list-in-operation-name.ts +++ b/packages/rulesets/src/spectral/functions/list-in-operation-name.ts @@ -1,44 +1,47 @@ // Verifies whether value for `operationId` is named as per ARM guidelines when response contains array of items. -const listInOperationName = (swaggerObj:any, _opts:any, paths:any) => { +const listInOperationName = (swaggerObj: any, _opts: any, paths: any) => { if (swaggerObj === null && typeof swaggerObj !== "object") { - return []; + return [] } - const listRegex = /^((\w+_List\w*)|List)$/; - const path = paths.path; - if (swaggerObj["x-ms-pageable"] !== undefined) - { - if(!listRegex.test(swaggerObj.operationId)) { - return [{ - message: 'Since operation \'${swaggerObj.operationId}\' response has model definition \'x-ms-pageable\', it should be of the form \\"*_list*\\". Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.', - path : [...path, path[path.length - 1] , 'operationId'], - }]; - } - else { - return []; + const listRegex = /^((\w+_List\w*)|List)$/ + const path = paths.path + if (swaggerObj["x-ms-pageable"] !== undefined) { + if (!listRegex.test(swaggerObj.operationId)) { + return [ + { + message: + "Since operation '${swaggerObj.operationId}' response has model definition 'x-ms-pageable', it should be of the form \\\"*_list*\\\". Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.", + path: [...path, path[path.length - 1], "operationId"], + }, + ] + } else { + return [] } } - if(swaggerObj.responses === undefined) - return []; - const responseList = swaggerObj.responses; - let gotArray = false; + if (swaggerObj.responses === undefined) return [] + const responseList = swaggerObj.responses + let gotArray = false Object.values(responseList).some((response: any) => { - if(response.schema) { - if(response.schema.properties?.value?.type === "array") - { - if(!listRegex.test(swaggerObj['operationId'])){ - gotArray = true; - return true; + if (response.schema) { + // for paging model, it should contain a 'value' property, may contain a nextLink property. + if (response.schema.properties?.value?.type === "array" && Object.keys(response.schema.properties).length <= 2) { + if (!listRegex.test(swaggerObj["operationId"])) { + gotArray = true + return true } } } - return false; - }); - if(gotArray) - return [{ - message: 'Since operation `${swaggerObj.operationId}` response has model definition \'array\', it should be of the form "_\\_list_".', - path : [...path, path[path.length - 1], 'operationId'], - }]; - return []; -}; + return false + }) + if (gotArray) + return [ + { + message: + "Since operation `${swaggerObj.operationId}` response has model definition 'array', it should be of the form \"_\\_list_\".", + path: [...path, path[path.length - 1], "operationId"], + }, + ] + return [] +} export default listInOperationName diff --git a/packages/rulesets/src/spectral/functions/location-must-have-xms-mutability.ts b/packages/rulesets/src/spectral/functions/location-must-have-xms-mutability.ts index c8dbc3f4c..67bc0e88a 100644 --- a/packages/rulesets/src/spectral/functions/location-must-have-xms-mutability.ts +++ b/packages/rulesets/src/spectral/functions/location-must-have-xms-mutability.ts @@ -1,17 +1,17 @@ //A tracked resource's location property must have the x-ms-mutability properties set as read, create. -const locationMustHaveXmsMutability = (scheme:any, _opts:any, paths:any) => { - if(scheme == null || typeof scheme !== "object") - return []; - if(scheme["x-ms-mutability"] !== undefined && Array.isArray(scheme["x-ms-mutability"])) { - const schemeArray: string[] = scheme["x-ms-mutability"]; - if(schemeArray.includes("create") && schemeArray.includes("read")) - return []; - } - const path = paths.path || []; - return [{ - message: 'Property \'location\' must have \'\\"x-ms-mutability\\":[\\"read\\", \\"create\\"]\' extension defined.', - path, - }]; -}; +const locationMustHaveXmsMutability = (scheme: any, _opts: any, paths: any) => { + if (scheme == null || typeof scheme !== "object") return [] + if (scheme["x-ms-mutability"] !== undefined && Array.isArray(scheme["x-ms-mutability"])) { + const schemeArray: string[] = scheme["x-ms-mutability"] + if (schemeArray.includes("create") && schemeArray.includes("read")) return [] + } + const path = paths.path || [] + return [ + { + message: 'Property \'location\' must have \'\\"x-ms-mutability\\":[\\"read\\", \\"create\\"]\' extension defined.', + path, + }, + ] +} export default locationMustHaveXmsMutability diff --git a/packages/rulesets/src/spectral/functions/lro-status-codes-return-type-schema.ts b/packages/rulesets/src/spectral/functions/lro-status-codes-return-type-schema.ts index 84d501125..3a0bb576e 100644 --- a/packages/rulesets/src/spectral/functions/lro-status-codes-return-type-schema.ts +++ b/packages/rulesets/src/spectral/functions/lro-status-codes-return-type-schema.ts @@ -2,27 +2,24 @@ export const lroStatusCodesReturnTypeSchema = (putOp: any, _opts: any, ctx: any) => { if (putOp === null || typeof putOp !== "object") { - return []; + return [] } - const path = ctx.path || []; + const path = ctx.path || [] if (!putOp["x-ms-long-running-operation"]) { - return []; + return [] } - const errors: any = []; - const operationId = putOp["operationId"] || ""; - const responseCodes = ["200", "201"]; + const errors: any = [] + const operationId = putOp["operationId"] || "" + const responseCodes = ["200", "201"] for (const responseCode of responseCodes) { if (putOp?.responses && putOp?.responses[responseCode]) { - if ( - !putOp?.responses[responseCode].schema || - Object.keys(putOp?.responses[responseCode].schema).length === 0 - ) { + if (!putOp?.responses[responseCode].schema || Object.keys(putOp?.responses[responseCode].schema).length === 0) { errors.push({ message: `200/201 Responses of long running operations must have a schema definition for return type. OperationId: '${operationId}', Response code: '${responseCode}'`, path: [...path, "responses", `${responseCode}`], - }); + }) } } } - return errors; -}; + return errors +} diff --git a/packages/rulesets/src/spectral/functions/name-property-definition-in-parameter.ts b/packages/rulesets/src/spectral/functions/name-property-definition-in-parameter.ts index 04328e71e..774b42817 100644 --- a/packages/rulesets/src/spectral/functions/name-property-definition-in-parameter.ts +++ b/packages/rulesets/src/spectral/functions/name-property-definition-in-parameter.ts @@ -2,25 +2,25 @@ export const namePropertyDefinitionInParameter = (parameters: any, _opts: any, ctx: any) => { if (parameters === null || typeof parameters !== "object") { - return []; + return [] } - const path = ctx.path || []; - const errors: any = []; - const propsParameters = Object.getOwnPropertyNames(parameters); + const path = ctx.path || [] + const errors: any = [] + const propsParameters = Object.getOwnPropertyNames(parameters) if (propsParameters.length === 0) { - return []; + return [] } for (const propsParameter of propsParameters) { if (propsParameter === "length") { - continue; + continue } - const parameter = parameters[propsParameter]; + const parameter = parameters[propsParameter] if (!parameter.name || parameter.name === "") { errors.push({ message: `Parameter Must have the "name" property defined with non-empty string as its value`, path: [...path], - }); + }) } } - return errors; -}; + return errors +} diff --git a/packages/rulesets/src/spectral/functions/one-underscore-in-operation-id.ts b/packages/rulesets/src/spectral/functions/one-underscore-in-operation-id.ts index c65e71103..dd1b02bbf 100644 --- a/packages/rulesets/src/spectral/functions/one-underscore-in-operation-id.ts +++ b/packages/rulesets/src/spectral/functions/one-underscore-in-operation-id.ts @@ -2,18 +2,18 @@ export const operationIdSingleUnderscore = (operationId: any, _opts: any, ctx: any) => { if (operationId === "" || typeof operationId !== "string") { - return []; + return [] } if (!operationId.includes("_")) { - return []; + return [] } - const path = ctx.path || []; - const errors: any = []; + const path = ctx.path || [] + const errors: any = [] if (operationId.match(/_/g)!.length > 1) { errors.push({ message: `Only 1 underscore is permitted in the operation id, following Noun_Verb conventions`, path: [...path], - }); + }) } - return errors; -}; + return errors +} diff --git a/packages/rulesets/src/spectral/functions/operation-id-noun-conflicting-model-names.ts b/packages/rulesets/src/spectral/functions/operation-id-noun-conflicting-model-names.ts index f4d50819a..ef5351087 100644 --- a/packages/rulesets/src/spectral/functions/operation-id-noun-conflicting-model-names.ts +++ b/packages/rulesets/src/spectral/functions/operation-id-noun-conflicting-model-names.ts @@ -2,21 +2,21 @@ export const operationIdNounConflictingModelNames = (operationId: any, _opts: any, ctx: any) => { if (operationId === "" || typeof operationId !== "string") { - return []; + return [] } if (!operationId.includes("_")) { - return []; + return [] } - const path = ctx.path || []; - const errors: any = []; - const nounPartOfOperationId = operationId.split("_")[0]; - const swagger = ctx?.documentInventory?.resolved; - const definitionsList = swagger.definitions ? Object.keys(swagger.definitions) : []; + const path = ctx.path || [] + const errors: any = [] + const nounPartOfOperationId = operationId.split("_")[0] + const swagger = ctx?.documentInventory?.resolved + const definitionsList = swagger.definitions ? Object.keys(swagger.definitions) : [] if (definitionsList.includes(nounPartOfOperationId)) { errors.push({ message: `OperationId has a noun that conflicts with one of the model names in definitions section. The model name will be disambiguated to '${nounPartOfOperationId}Model'. Consider using the plural form of '${nounPartOfOperationId}' to avoid this. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.`, path: [...path], - }); + }) } - return errors; -}; + return errors +} diff --git a/packages/rulesets/src/spectral/functions/operation-id-noun-verb.ts b/packages/rulesets/src/spectral/functions/operation-id-noun-verb.ts index eb0c9e1ec..4a5c6360d 100644 --- a/packages/rulesets/src/spectral/functions/operation-id-noun-verb.ts +++ b/packages/rulesets/src/spectral/functions/operation-id-noun-verb.ts @@ -7,24 +7,21 @@ export const operationIdNounVerb = (operationId: any, _opts: any, ctx: any) => { if (operationId === "" || typeof operationId !== "string") { - return []; + return [] } if (!operationId.includes("_")) { - return []; + return [] } - const path = ctx.path || []; - const errors: any = []; - const nounPartOfOperationId = operationId.split("_")[0]; - const nounSearchPattern = - nounPartOfOperationId.slice(-1) === "s" - ? `${nounPartOfOperationId}?` - : `${nounPartOfOperationId}`; - const verbPartOfOperationId = operationId.split("_")[1]; + const path = ctx.path || [] + const errors: any = [] + const nounPartOfOperationId = operationId.split("_")[0] + const nounSearchPattern = nounPartOfOperationId.slice(-1) === "s" ? `${nounPartOfOperationId}?` : `${nounPartOfOperationId}` + const verbPartOfOperationId = operationId.split("_")[1] if (verbPartOfOperationId.match(nounSearchPattern)) { errors.push({ message: `Per the Noun_Verb convention for Operation Ids, the noun '${nounPartOfOperationId}' should not appear after the underscore. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.`, path: [...path], - }); + }) } - return errors; -}; + return errors +} diff --git a/packages/rulesets/src/spectral/functions/operation-id.ts b/packages/rulesets/src/spectral/functions/operation-id.ts index 39542180f..288bf46dc 100644 --- a/packages/rulesets/src/spectral/functions/operation-id.ts +++ b/packages/rulesets/src/spectral/functions/operation-id.ts @@ -6,73 +6,73 @@ // - patch operation should have "update" in the operationId verb [R1007] // - delete operations should have "delete" in the "verb" component of the operationId [R1009] -const operationId = (operation:any, _opts:any, paths:any) => { +const operationId = (operation: any, _opts: any, paths: any) => { // targetVal should be an operation - if (operation === null || typeof operation !== 'object') { - return []; + if (operation === null || typeof operation !== "object") { + return [] } - const path = paths.path || []; + const path = paths.path || [] - const errors:any[] = []; + const errors: any[] = [] if (!operation.operationId) { // Missing operationId is caught elsewhere, so just return - return errors; + return errors } - const m = operation.operationId.match(/[A-Za-z0-9]+_([A-Za-z0-9]+)/); + const m = operation.operationId.match(/[A-Za-z0-9]+_([A-Za-z0-9]+)/) if (!m) { errors.push({ message: 'OperationId should be of the form "Noun_Verb"', - path: [...path, 'operationId'], - }); + path: [...path, "operationId"], + }) } - const verb = m ? m[1] : operation.operationId; - const method = path[path.length - 1]; + const verb = m ? m[1] : operation.operationId + const method = path[path.length - 1] - const isCreate = ['put', 'patch'].includes(method) && operation.responses?.['201']; - const isUpdate = ['put', 'patch'].includes(method) && operation.responses?.['200']; + const isCreate = ["put", "patch"].includes(method) && operation.responses?.["201"] + const isUpdate = ["put", "patch"].includes(method) && operation.responses?.["200"] if (isCreate && isUpdate) { if (!verb.match(/create/i) || !verb.match(/update/i)) { errors.push({ message: `OperationId for ${method} method should contain both "Create" and "Update"`, - path: [...path, 'operationId'], - }); + path: [...path, "operationId"], + }) } } else { - const isList = method === 'get' && operation['x-ms-pageable']; + const isList = method === "get" && operation["x-ms-pageable"] const patterns = { get: isList ? /list/i : /(get|list)/i, put: isCreate ? /create/i : /(create|update)/i, patch: /update/i, delete: /delete/i, - }; + } const frags = { get: isList ? '"List"' : '"Get" or "list"', put: isCreate ? '"Create"' : '"Create" or "Update"', patch: '"Update"', delete: '"Delete"', - }; + } if (patterns[method] && !verb.match(patterns[method])) { // Customize message for list operation if (isList) { errors.push({ message: 'OperationId for get method on a collection should contain "List"', - path: [...path, 'operationId'], - }); + path: [...path, "operationId"], + }) } else { errors.push({ message: `OperationId for ${method} method should contain ${frags[method]}`, - path: [...path, 'operationId'], - }); + path: [...path, "operationId"], + }) } } } - return errors; -}; + return errors +} export default operationId diff --git a/packages/rulesets/src/spectral/functions/pagination-response.ts b/packages/rulesets/src/spectral/functions/pagination-response.ts index ed1f5c4f4..089ed37ab 100644 --- a/packages/rulesets/src/spectral/functions/pagination-response.ts +++ b/packages/rulesets/src/spectral/functions/pagination-response.ts @@ -3,90 +3,90 @@ // - The response should contain a top-level `value` property of type array and required // - The response should contain a top-level `nextLink` property of type string and optional [R4012] -// -const paginationResponse = (operation:any, _opts:any, paths:any) => { +// +const paginationResponse = (operation: any, _opts: any, paths: any) => { // operation should be a get or post operation - if (operation === null || typeof operation !== 'object') { - return []; + if (operation === null || typeof operation !== "object") { + return [] } - const path = paths.path || []; + const path = paths.path || [] // responses is required property of an operation in OpenAPI 2.0, so if // isn't present this will be flagged elsewhere -- just return; - if (!operation.responses || typeof operation.responses !== 'object') { - return []; + if (!operation.responses || typeof operation.responses !== "object") { + return [] } // Find success response code - const resp = Object.keys(operation.responses) - .find((code) => code.startsWith('2')); + const resp = Object.keys(operation.responses).find((code) => code.startsWith("2")) // No success response will be flagged elsewhere, just return if (!resp) { - return []; + return [] } // Get the schema of the success response - const responseSchema = operation.responses[resp].schema || {}; + const responseSchema = operation.responses[resp].schema || {} - const errors = []; + const errors = [] - if (operation['x-ms-pageable']) { + if (operation["x-ms-pageable"]) { // Check value property - if (responseSchema.properties && 'value' in responseSchema.properties) { - if (responseSchema.properties.value.type !== 'array') { + if (responseSchema.properties && "value" in responseSchema.properties) { + if (responseSchema.properties.value.type !== "array") { errors.push({ - message: '`value` property in pageable response should be type: array', - path: [...path, 'responses', resp, 'schema', 'properties', 'value', 'type'], - }); + message: "`value` property in pageable response should be type: array", + path: [...path, "responses", resp, "schema", "properties", "value", "type"], + }) } - if (!(responseSchema.required?.includes('value'))) { + if (!responseSchema.required?.includes("value")) { errors.push({ - message: '`value` property in pageable response should be required', - path: [...path, 'responses', resp, 'schema', 'required'], - }); + message: "`value` property in pageable response should be required", + path: [...path, "responses", resp, "schema", "required"], + }) } - } else if (!responseSchema.allOf) { // skip error for missing value -- it might be in allOf + } else if (!responseSchema.allOf) { + // skip error for missing value -- it might be in allOf errors.push({ - message: 'Response body schema of pageable response should contain top-level array property `value`', - path: [...path, 'responses', resp, 'schema', 'properties'], - }); + message: "Response body schema of pageable response should contain top-level array property `value`", + path: [...path, "responses", resp, "schema", "properties"], + }) } // Check nextLink property - const nextLinkName = operation['x-ms-pageable'].nextLinkName || 'nextLink'; + const nextLinkName = operation["x-ms-pageable"].nextLinkName || "nextLink" if (responseSchema.properties && nextLinkName in responseSchema.properties) { - if (responseSchema.properties[nextLinkName].type !== 'string') { + if (responseSchema.properties[nextLinkName].type !== "string") { errors.push({ message: `\`${nextLinkName}\` property in pageable response should be type: string`, - path: [...path, 'responses', resp, 'schema', 'properties', nextLinkName, 'type'], - }); + path: [...path, "responses", resp, "schema", "properties", nextLinkName, "type"], + }) } if (responseSchema.required?.includes(nextLinkName)) { errors.push({ message: `\`${nextLinkName}\` property in pageable response should be optional.`, - path: [...path, 'responses', resp, 'schema', 'required'], - }); + path: [...path, "responses", resp, "schema", "required"], + }) } - } else if (!responseSchema.allOf) { // skip error for missing nextLink -- it might be in allOf + } else if (!responseSchema.allOf) { + // skip error for missing nextLink -- it might be in allOf errors.push({ message: `Response body schema of pageable response should contain top-level property \`${nextLinkName}\``, - path: [...path, 'responses', resp, 'schema', 'properties'], - }); + path: [...path, "responses", resp, "schema", "properties"], + }) } } else { - const responseHasArray = Object.values(responseSchema.properties || {}) - .some((prop:any) => prop?.type === 'array'); + const responseHasArray = Object.values(responseSchema.properties || {}).some((prop: any) => prop?.type === "array") // Why 3? [value, nextLink, count] if (responseHasArray && Object.keys(responseSchema.properties).length <= 3) { errors.push({ - message: 'Operation might be pageable. Consider adding the x-ms-pageable extension.', + message: "Operation might be pageable. Consider adding the x-ms-pageable extension.", path, - }); + }) } } - return errors; -}; + return errors +} -export default paginationResponse \ No newline at end of file +export default paginationResponse diff --git a/packages/rulesets/src/spectral/functions/param-names-unique.ts b/packages/rulesets/src/spectral/functions/param-names-unique.ts index cad0d8855..50aa4d670 100644 --- a/packages/rulesets/src/spectral/functions/param-names-unique.ts +++ b/packages/rulesets/src/spectral/functions/param-names-unique.ts @@ -3,79 +3,80 @@ // Return the "canonical" casing for a string. // Currently just lowercase but should be extended to convert kebab/camel/snake/Pascal. -function canonical(name:any) { - return typeof (name) === 'string' ? name.toLowerCase() : name; +function canonical(name: any) { + return typeof name === "string" ? name.toLowerCase() : name } // Accept an array and return a list of unique duplicate entries in canonical form. // This function is intended to work on strings but is resilient to non-strings. -function dupIgnoreCase(arr:any) { +function dupIgnoreCase(arr: any) { if (!Array.isArray(arr)) { - return []; + return [] } - const isDup = (value:any, index:number, self:any) => self.indexOf(value) !== index; + const isDup = (value: any, index: number, self: any) => self.indexOf(value) !== index - return [...new Set(arr.map((v) => canonical(v)).filter(isDup))]; + return [...new Set(arr.map((v) => canonical(v)).filter(isDup))] } // targetVal should be a [path item object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#pathItemObject). // The code assumes it is running on a resolved doc -const paramNamesUnique = (pathItem:any, _opts:any, paths:any) => { - if (pathItem === null || typeof pathItem !== 'object') { - return []; +const paramNamesUnique = (pathItem: any, _opts: any, paths: any) => { + if (pathItem === null || typeof pathItem !== "object") { + return [] } - const path = paths.path || []; + const path = paths.path || [] - const errors:any[] = []; + const errors: any[] = [] - const pathParams = pathItem.parameters ? pathItem.parameters.map((p:any) => p.name) : []; + const pathParams = pathItem.parameters ? pathItem.parameters.map((p: any) => p.name) : [] // Check path params for dups - const pathDups = dupIgnoreCase(pathParams); + const pathDups = dupIgnoreCase(pathParams) // Report all dups pathDups.forEach((dup) => { // get the index of all names that match dup - const dupKeys = [...pathParams.keys()].filter((k) => canonical(pathParams[k]) === dup); + const dupKeys = [...pathParams.keys()].filter((k) => canonical(pathParams[k]) === dup) // Refer back to the first one - const first = `parameters.${dupKeys[0]}`; + const first = `parameters.${dupKeys[0]}` // Report errors for all the others dupKeys.slice(1).forEach((key) => { errors.push({ message: `Duplicate parameter name (ignoring case) with ${first}.`, - path: [...path, 'parameters', key, 'name'], - }); - }); - }); - - ['get', 'post', 'put', 'patch', 'delete', 'options', 'head'].forEach((method) => { + path: [...path, "parameters", key, "name"], + }) + }) + }) + ;["get", "post", "put", "patch", "delete", "options", "head"].forEach((method) => { // If this method exists and it has parameters, check them if (pathItem[method] && Array.isArray(pathItem[method].parameters)) { - const allParams = [...pathParams, ...pathItem[method].parameters.map((p:any) => p.name)]; + const allParams = [...pathParams, ...pathItem[method].parameters.map((p: any) => p.name)] // Check method params for dups -- including path params - const dups = dupIgnoreCase(allParams); + const dups = dupIgnoreCase(allParams) // Report all dups dups.forEach((dup) => { // get the index of all names that match dup - const dupKeys = [...allParams.keys()].filter((k) => canonical(allParams[k]) === dup); + const dupKeys = [...allParams.keys()].filter((k) => canonical(allParams[k]) === dup) // Refer back to the first one - could be path or method - const first = dupKeys[0] < pathParams.length ? `parameters.${dupKeys[0]}` - : `${method}.parameters.${dupKeys[0] - pathParams.length}`; + const first = dupKeys[0] < pathParams.length ? `parameters.${dupKeys[0]}` : `${method}.parameters.${dupKeys[0] - pathParams.length}` // Report errors for any others that are method parameters - dupKeys.slice(1).filter((k) => k >= pathParams.length).forEach((key) => { - errors.push({ - message: `Duplicate parameter name (ignoring case) with ${first}.`, - path: [...path, method, 'parameters', key - pathParams.length, 'name'], - }); - }); - }); + dupKeys + .slice(1) + .filter((k) => k >= pathParams.length) + .forEach((key) => { + errors.push({ + message: `Duplicate parameter name (ignoring case) with ${first}.`, + path: [...path, method, "parameters", key - pathParams.length, "name"], + }) + }) + }) } - }); + }) - return errors; -}; + return errors +} -export default paramNamesUnique \ No newline at end of file +export default paramNamesUnique diff --git a/packages/rulesets/src/spectral/functions/param-names.ts b/packages/rulesets/src/spectral/functions/param-names.ts index 866465059..328f6cfac 100644 --- a/packages/rulesets/src/spectral/functions/param-names.ts +++ b/packages/rulesets/src/spectral/functions/param-names.ts @@ -2,46 +2,46 @@ // - path and query parameters must be camel case // - header parameters must be kebab-case -export const paramNames = (targetVal:any, _opts:any, paths:any) => { - if (targetVal === null || typeof targetVal !== 'object') { - return []; +export const paramNames = (targetVal: any, _opts: any, paths: any) => { + if (targetVal === null || typeof targetVal !== "object") { + return [] } - const path = paths.path || []; + const path = paths.path || [] // These errors will be caught elsewhere, so silently ignore here if (!targetVal.in || !targetVal.name) { - return []; + return [] } if (targetVal.name.match(/^[$@]/)) { return [ { message: `Parameter name "${targetVal.name}" should not begin with '$' or '@'.`, - path: [...path, 'name'], + path: [...path, "name"], }, - ]; + ] } - if (['path', 'query'].includes(targetVal.in) && targetVal.name !== 'api-version') { + if (["path", "query"].includes(targetVal.in) && targetVal.name !== "api-version") { if (!targetVal.name.match(/^[a-z][a-z0-9]*([A-Z][a-z0-9]+)*$/)) { return [ { message: `Parameter name "${targetVal.name}" should be camel case.`, - path: [...path, 'name'], + path: [...path, "name"], }, - ]; + ] } - } else if (targetVal.in === 'header') { + } else if (targetVal.in === "header") { if (!targetVal.name.match(/^[A-Za-z][a-z0-9]*(-[A-Za-z][a-z0-9]*)*$/)) { return [ { message: `header parameter name "${targetVal.name}" should be kebab case.`, - path: [...path, 'name'], + path: [...path, "name"], }, - ]; + ] } } - return []; -}; + return [] +} -export default paramNames \ No newline at end of file +export default paramNames diff --git a/packages/rulesets/src/spectral/functions/param-order.ts b/packages/rulesets/src/spectral/functions/param-order.ts index 1d23d1692..7646b6bc4 100644 --- a/packages/rulesets/src/spectral/functions/param-order.ts +++ b/packages/rulesets/src/spectral/functions/param-order.ts @@ -4,28 +4,28 @@ // NOTE: Missing path parameters will be flagged by the Spectral path-params rule // `given` is the paths object -export const paramOrder = (paths:any) => { - if (paths === null || typeof paths !== 'object') { - return []; +export const paramOrder = (paths: any) => { + if (paths === null || typeof paths !== "object") { + return [] } - const inPath = (p:any) => p.in === 'path'; - const paramName = (p:any) => p.name; - const methods = ['get', 'post', 'put', 'patch', 'delete', 'options', 'head']; + const inPath = (p: any) => p.in === "path" + const paramName = (p: any) => p.name + const methods = ["get", "post", "put", "patch", "delete", "options", "head"] - const errors = []; + const errors = [] // eslint-disable-next-line no-restricted-syntax for (const pathKey of Object.keys(paths)) { // find all the path parameters in pathKey - const paramsInPath = pathKey.match(/[^{}]+(?=})/g) ?? []; + const paramsInPath = pathKey.match(/[^{}]+(?=})/g) ?? [] if (paramsInPath.length > 0) { - const pathItem = paths[pathKey]; - const pathItemPathParams = pathItem.parameters?.filter(inPath).map(paramName) ?? []; + const pathItem = paths[pathKey] + const pathItemPathParams = pathItem.parameters?.filter(inPath).map(paramName) ?? [] // find the first index where in-consistency observed or offset till no in-consistency // observed to validate further - const indx = pathItemPathParams.findIndex((v:any, i:number) => v !== paramsInPath[i]); + const indx = pathItemPathParams.findIndex((v: any, i: number) => v !== paramsInPath[i]) // If path params exists and are not in expected order then raise the error if (indx >= 0 && indx < paramsInPath.length) { // NOTE: we do not include `indx` in the path because if the parameter is a ref then @@ -33,26 +33,29 @@ export const paramOrder = (paths:any) => { // improper ordering errors.push({ message: `Path parameter "${paramsInPath[indx]}" should appear before "${pathItemPathParams[indx]}".`, - path: ['paths', pathKey, 'parameters'], // no index in path - }); - } else { // this will be a case when few path params are defined in respective methods - const offset = pathItemPathParams.length; - methods.filter((m) => pathItem[m]).forEach((method) => { - const opPathParams = pathItem[method].parameters?.filter(inPath).map(paramName) ?? []; - - const indx2 = opPathParams.findIndex((v:any, i:number) => v !== paramsInPath[offset + i]); - if (indx2 >= 0 && (offset + indx2) < paramsInPath.length) { - errors.push({ - message: `Path parameter "${paramsInPath[offset + indx2]}" should appear before "${opPathParams[indx2]}".`, - path: ['paths', pathKey, method, 'parameters'], // no index in path - }); - } - }); + path: ["paths", pathKey, "parameters"], // no index in path + }) + } else { + // this will be a case when few path params are defined in respective methods + const offset = pathItemPathParams.length + methods + .filter((m) => pathItem[m]) + .forEach((method) => { + const opPathParams = pathItem[method].parameters?.filter(inPath).map(paramName) ?? [] + + const indx2 = opPathParams.findIndex((v: any, i: number) => v !== paramsInPath[offset + i]) + if (indx2 >= 0 && offset + indx2 < paramsInPath.length) { + errors.push({ + message: `Path parameter "${paramsInPath[offset + indx2]}" should appear before "${opPathParams[indx2]}".`, + path: ["paths", pathKey, method, "parameters"], // no index in path + }) + } + }) } } } - return errors; -}; + return errors +} -export default paramOrder \ No newline at end of file +export default paramOrder diff --git a/packages/rulesets/src/spectral/functions/parameter-not-defined-in-global-parameters.ts b/packages/rulesets/src/spectral/functions/parameter-not-defined-in-global-parameters.ts index cf77e6123..a8ffd3ca2 100644 --- a/packages/rulesets/src/spectral/functions/parameter-not-defined-in-global-parameters.ts +++ b/packages/rulesets/src/spectral/functions/parameter-not-defined-in-global-parameters.ts @@ -36,8 +36,6 @@ export const parameterNotDefinedInGlobalParameters = (parameters: any, _opts: an if (!globalParametersList.includes("api-version") && !parameters.some((p) => p.$ref && commonTypeApiVersionReg.test(p.$ref))) { pushToError(errors, "api-version", path) } - } else { - pushToError(errors, "api-version", path) } return errors diff --git a/packages/rulesets/src/spectral/functions/patch-body-parameters.ts b/packages/rulesets/src/spectral/functions/patch-body-parameters.ts index 4452eb6a1..9494a5ee6 100644 --- a/packages/rulesets/src/spectral/functions/patch-body-parameters.ts +++ b/packages/rulesets/src/spectral/functions/patch-body-parameters.ts @@ -1,38 +1,37 @@ -import { getProperties, getRequiredProperties } from "./utils"; +import { getProperties, getRequiredProperties } from "./utils" //This rule appears if in the patch body parameters have properties which is marked as required or x-ms-mutibility:["create"] or have default -const pathBodyParameters = (parameters:any, _opts:any, paths:any) => { +const pathBodyParameters = (parameters: any, _opts: any, paths: any) => { if (parameters === null || parameters.schema === undefined || parameters.in !== "body") { - return []; + return [] } - const path = paths.path || []; + const path = paths.path || [] - const properties: object = getProperties(parameters.schema); + const properties: object = getProperties(parameters.schema) const requiredProperties = getRequiredProperties(parameters.schema) const errors = [] - for (const prop of Object.keys(properties)) - { + for (const prop of Object.keys(properties)) { if (properties[prop].default) { errors.push({ message: `Properties of a PATCH request body must not have default value, property:${prop}.`, - path: [...path,"schema"] + path: [...path, "schema"], }) } if (requiredProperties.includes(prop)) { errors.push({ message: `Properties of a PATCH request body must not be required, property:${prop}.`, - path: [...path,"schema"] + path: [...path, "schema"], }) } - const xmsMutability = properties[prop]['x-ms-mutability'] + const xmsMutability = properties[prop]["x-ms-mutability"] if (xmsMutability && xmsMutability.length === 1 && xmsMutability[0] === "create") { errors.push({ message: `Properties of a PATCH request body must not be x-ms-mutability: ["create"], property:${prop}.`, - path: [...path,"schema"] + path: [...path, "schema"], }) } } return errors -}; +} export default pathBodyParameters diff --git a/packages/rulesets/src/spectral/functions/patch-content-type.ts b/packages/rulesets/src/spectral/functions/patch-content-type.ts index a7970be58..bbd3e3dea 100644 --- a/packages/rulesets/src/spectral/functions/patch-content-type.ts +++ b/packages/rulesets/src/spectral/functions/patch-content-type.ts @@ -1,62 +1,62 @@ -const MERGE_PATCH = 'application/merge-patch+json'; +const MERGE_PATCH = "application/merge-patch+json" // Verify that all patch operations and only patch operations consume merge-patch. -function checkOperationConsumes(targetVal:any) { - const { paths } = targetVal; - const errors : any[] = []; - if (paths && typeof paths === 'object') { +function checkOperationConsumes(targetVal: any) { + const { paths } = targetVal + const errors: any[] = [] + if (paths && typeof paths === "object") { Object.keys(paths).forEach((path) => { - ['post', 'put'].forEach((method) => { + ;["post", "put"].forEach((method) => { if (paths[path][method]) { - const { consumes } = paths[path][method]; + const { consumes } = paths[path][method] if (consumes?.includes(MERGE_PATCH)) { errors.push({ message: `A ${method} operation should not consume 'application/merge-patch+json' content type.`, - path: ['paths', path, method, 'consumes'], - }); + path: ["paths", path, method, "consumes"], + }) } } - }); + }) if (paths[path].patch) { - const { consumes } = paths[path].patch; + const { consumes } = paths[path].patch if (!consumes || !consumes.includes(MERGE_PATCH)) { errors.push({ message: "A patch operation should consume 'application/merge-patch+json' content type.", - path: ['paths', path, 'patch', ...(consumes ? ['consumes'] : [])], - }); + path: ["paths", path, "patch", ...(consumes ? ["consumes"] : [])], + }) } else if (consumes.length > 1) { errors.push({ message: "A patch operation should only consume 'application/merge-patch+json' content type.", - path: ['paths', path, 'patch', 'consumes'], - }); + path: ["paths", path, "patch", "consumes"], + }) } } - }); + }) } - return errors; + return errors } // Check API definition to ensure that all patch operations and only patch operations // are defined with content-type = application/merge-patch+json // @param targetVal - the entire API document -export const patchContentYype = (targetVal:any) => { - if (targetVal === null || typeof targetVal !== 'object') { - return []; +export const patchContentYype = (targetVal: any) => { + if (targetVal === null || typeof targetVal !== "object") { + return [] } - const errors = []; + const errors = [] if (targetVal.consumes?.includes(MERGE_PATCH)) { errors.push({ - message: 'Global consumes should not specify `application/merge-patch+json` content type.', - path: ['consumes'], - }); + message: "Global consumes should not specify `application/merge-patch+json` content type.", + path: ["consumes"], + }) } - errors.push(...checkOperationConsumes(targetVal)); + errors.push(...checkOperationConsumes(targetVal)) - return errors; -}; + return errors +} export default patchContentYype diff --git a/packages/rulesets/src/spectral/functions/patch-in-operation-name.ts b/packages/rulesets/src/spectral/functions/patch-in-operation-name.ts index 3fcbb4052..bd1b80fe9 100644 --- a/packages/rulesets/src/spectral/functions/patch-in-operation-name.ts +++ b/packages/rulesets/src/spectral/functions/patch-in-operation-name.ts @@ -5,18 +5,18 @@ export const patchInOperationName = (operationId: any, _opts: any, ctx: any) => { if (operationId === "" || typeof operationId !== "string") { - return []; + return [] } if (!operationId.includes("_")) { - return []; + return [] } - const path = ctx.path || []; - const errors: any = []; + const path = ctx.path || [] + const errors: any = [] if (!operationId.match(/^(\w+)_(Update)/) && !operationId.match(/^(Update)/)) { errors.push({ message: `'PATCH' operation '${operationId}' should use method name 'Update'. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.`, path: [...path], - }); + }) } - return errors; -}; + return errors +} diff --git a/packages/rulesets/src/spectral/functions/path-param-names.ts b/packages/rulesets/src/spectral/functions/path-param-names.ts index 3f78cf241..5aff24a84 100644 --- a/packages/rulesets/src/spectral/functions/path-param-names.ts +++ b/packages/rulesets/src/spectral/functions/path-param-names.ts @@ -1,15 +1,15 @@ // Check that path parameter names are consistent across all paths. // `given` is the paths object -export const pathParamNames = (paths:any) => { - if (paths === null || typeof paths !== 'object') { - return []; +export const pathParamNames = (paths: any) => { + if (paths === null || typeof paths !== "object") { + return [] } - const errors:any[] = []; + const errors: any[] = [] // Dict to accumulate the parameter name associated with a path segment - const paramNameForSegment = {}; + const paramNameForSegment = {} // Identify inconsistent names by iterating over all paths and building up a // dictionary that maps a static path segment to the path parameter that @@ -19,28 +19,28 @@ export const pathParamNames = (paths:any) => { // eslint-disable-next-line no-restricted-syntax for (const pathKey of Object.keys(paths)) { - const parts = pathKey.split('/').slice(1); + const parts = pathKey.split("/").slice(1) parts.slice(1).forEach((v, i) => { - if (v.includes('}')) { - const param = v.match(/[^{}]+(?=})/)?.[0]; + if (v.includes("}")) { + const param = v.match(/[^{}]+(?=})/)?.[0] // Get the preceding path segment - const p = parts[i]; + const p = parts[i] if (paramNameForSegment[p]) { if (paramNameForSegment[p] !== param) { errors.push({ message: `Inconsistent path parameter names "${param}" and "${paramNameForSegment[p]}".`, - path: ['paths', pathKey], - }); + path: ["paths", pathKey], + }) } } else { - paramNameForSegment[p] = param; + paramNameForSegment[p] = param } } - }); + }) } - return errors; -}; + return errors +} export default pathParamNames diff --git a/packages/rulesets/src/spectral/functions/path-param-schema.ts b/packages/rulesets/src/spectral/functions/path-param-schema.ts index f88975124..e3afbf50c 100644 --- a/packages/rulesets/src/spectral/functions/path-param-schema.ts +++ b/packages/rulesets/src/spectral/functions/path-param-schema.ts @@ -1,58 +1,58 @@ -const URL_MAX_LENGTH = 2083; +const URL_MAX_LENGTH = 2083 // `given` is a (resolved) parameter entry at the path or operation level -export const pathParamSchema = (param:any, _opts:any, paths: any) => { - if (param === null || typeof param !== 'object') { - return []; +export const pathParamSchema = (param: any, _opts: any, paths: any) => { + if (param === null || typeof param !== "object") { + return [] } - const path = paths.path || []; + const path = paths.path || [] // These errors will be caught elsewhere, so silently ignore here if (!param.in || !param.name) { - return []; + return [] } - const errors = []; + const errors = [] // If the parameter contains a schema, then this must be oas3 - const isOas3 = !!param.schema; + const isOas3 = !!param.schema - const schema = isOas3 ? param.schema : param; + const schema = isOas3 ? param.schema : param if (isOas3) { - path.push('schema'); + path.push("schema") } - if (schema.type !== 'string') { + if (schema.type !== "string") { errors.push({ - message: 'Path parameter should be defined as type: string.', - path: [...path, 'type'], - }); + message: "Path parameter should be defined as type: string.", + path: [...path, "type"], + }) } if (!schema.maxLength && !schema.pattern) { errors.push({ - message: 'Path parameter should specify a maximum length (maxLength) and characters allowed (pattern).', + message: "Path parameter should specify a maximum length (maxLength) and characters allowed (pattern).", path, - }); + }) } else if (!schema.maxLength) { errors.push({ - message: 'Path parameter should specify a maximum length (maxLength).', + message: "Path parameter should specify a maximum length (maxLength).", path, - }); + }) } else if (schema.maxLength && schema.maxLength >= URL_MAX_LENGTH) { errors.push({ message: `Path parameter maximum length should be less than ${URL_MAX_LENGTH}`, path, - }); + }) } else if (!schema.pattern) { errors.push({ - message: 'Path parameter should specify characters allowed (pattern).', + message: "Path parameter should specify characters allowed (pattern).", path, - }); + }) } - return errors; -}; + return errors +} export default pathParamSchema diff --git a/packages/rulesets/src/spectral/functions/path-segment-casing.ts b/packages/rulesets/src/spectral/functions/path-segment-casing.ts index 2d8d9dae0..6fe52931a 100644 --- a/packages/rulesets/src/spectral/functions/path-segment-casing.ts +++ b/packages/rulesets/src/spectral/functions/path-segment-casing.ts @@ -1,32 +1,32 @@ -// _opts has a property 'segments' as string[] to specify the segment names to check for -export const pathSegmentCasing = (apiPaths:any, _opts:any, paths: any) => { - if (apiPaths === null || typeof apiPaths !== 'object') { - return []; +// _opts has a property 'segments' as string[] to specify the segment names to check for +export const pathSegmentCasing = (apiPaths: any, _opts: any, paths: any) => { + if (apiPaths === null || typeof apiPaths !== "object") { + return [] } if (!_opts || !_opts.segments || !Array.isArray(_opts.segments)) { return [] } const segments = _opts.segments - const path = paths.path || []; + const path = paths.path || [] - const errors:any[] = []; + const errors: any[] = [] for (const apiPath of Object.keys(apiPaths)) { - segments.forEach((seg:string) => { - const idx = apiPath.toLowerCase().indexOf( "/" + seg.toLowerCase()) + segments.forEach((seg: string) => { + const idx = apiPath.toLowerCase().indexOf("/" + seg.toLowerCase()) if (idx !== -1) { - const originalSegment = apiPath.substring(idx + 1,idx + seg.length + 1) - if (originalSegment !== seg){ + const originalSegment = apiPath.substring(idx + 1, idx + seg.length + 1) + if (originalSegment !== seg) { errors.push({ message: `The path segment ${originalSegment} should be ${seg}.`, - path: [...path,apiPath] + path: [...path, apiPath], }) } } }) } - return errors; -}; + return errors +} export default pathSegmentCasing diff --git a/packages/rulesets/src/spectral/functions/put-get-patch-schema.ts b/packages/rulesets/src/spectral/functions/put-get-patch-schema.ts index a3a02c017..2a463a4c9 100644 --- a/packages/rulesets/src/spectral/functions/put-get-patch-schema.ts +++ b/packages/rulesets/src/spectral/functions/put-get-patch-schema.ts @@ -1,32 +1,32 @@ // Check a sku model to ensure it must have a name property. It can also have 'tier', 'size', 'family', 'capacity' as optional properties. -import { RulesetFunctionContext } from "@stoplight/spectral-core"; -import { getReturnedType } from "./utils"; +import { RulesetFunctionContext } from "@stoplight/spectral-core" +import { getReturnedType } from "./utils" -const putGetPatchScehma: any = (pathItem:any, opts:any, ctx:RulesetFunctionContext) => { - if (pathItem === null || typeof pathItem !== 'object') { - return []; +const putGetPatchScehma: any = (pathItem: any, opts: any, ctx: RulesetFunctionContext) => { + if (pathItem === null || typeof pathItem !== "object") { + return [] } - const neededHttpVerbs = ["put","get","patch"] + const neededHttpVerbs = ["put", "get", "patch"] - const path = ctx.path || []; + const path = ctx.path || [] const errors = [] - const models = new Set() - - for (const verb of neededHttpVerbs ) { - if (pathItem[verb]){ + const models = new Set() + + for (const verb of neededHttpVerbs) { + if (pathItem[verb]) { models.add(getReturnedType(pathItem[verb])) } if (models.size > 1) { errors.push({ - message:"", - path + message: "", + path, }) break } } - return errors; -}; + return errors +} -export default putGetPatchScehma \ No newline at end of file +export default putGetPatchScehma diff --git a/packages/rulesets/src/spectral/functions/put-in-operation-name.ts b/packages/rulesets/src/spectral/functions/put-in-operation-name.ts index 30b784c59..d00e1741b 100644 --- a/packages/rulesets/src/spectral/functions/put-in-operation-name.ts +++ b/packages/rulesets/src/spectral/functions/put-in-operation-name.ts @@ -5,18 +5,18 @@ export const putInOperationName = (operationId: any, _opts: any, ctx: any) => { if (operationId === "" || typeof operationId !== "string") { - return []; + return [] } if (!operationId.includes("_")) { - return []; + return [] } - const path = ctx.path || []; - const errors: any = []; + const path = ctx.path || [] + const errors: any = [] if (!operationId.match(/^(\w+)_(Create)/) && !operationId.match(/^(Create)/)) { errors.push({ message: `'PUT' operation '${operationId}' should use method name 'Create'. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.`, path: [...path], - }); + }) } - return errors; -}; + return errors +} diff --git a/packages/rulesets/src/spectral/functions/put-request-response-scheme.ts b/packages/rulesets/src/spectral/functions/put-request-response-scheme.ts index 939e4869a..17a8a9056 100644 --- a/packages/rulesets/src/spectral/functions/put-request-response-scheme.ts +++ b/packages/rulesets/src/spectral/functions/put-request-response-scheme.ts @@ -1,39 +1,37 @@ // Verifies if a PUT operation request and response schemas match. -import { isSchemaEqual } from "./utils"; +import { isSchemaEqual } from "./utils" export const putRequestResponseScheme = (putOp: any, _opts: any, ctx: any) => { if (putOp === null || typeof putOp !== "object") { - return []; + return [] } - const path = ctx.path || []; - const errors: any = []; + const path = ctx.path || [] + const errors: any = [] if (!putOp.parameters) { - return []; + return [] } - let reqBodySchema: object = {}; - let reqBodySchemaPath = ""; + let reqBodySchema: object = {} + let reqBodySchemaPath = "" for (let i = 0; i < putOp.parameters.length; i++) { - const parameter = putOp.parameters[i]; + const parameter = putOp.parameters[i] if (parameter.in === "body") { - reqBodySchemaPath = `parameters[${i}].schema`; - reqBodySchema = parameter.schema ? parameter.schema : {}; - break; + reqBodySchemaPath = `parameters[${i}].schema` + reqBodySchema = parameter.schema ? parameter.schema : {} + break } } if (Object.keys(reqBodySchema).length === 0) { - return []; + return [] } - const responseCode = putOp.responses["200"] ? "200" : "201"; - const respModelPath = `responses[${responseCode}].schema`; - const respModel = putOp.responses[responseCode]?.schema - ? putOp.responses[responseCode].schema - : {}; + const responseCode = putOp.responses["200"] ? "200" : "201" + const respModelPath = `responses[${responseCode}].schema` + const respModel = putOp.responses[responseCode]?.schema ? putOp.responses[responseCode].schema : {} if (!isSchemaEqual(reqBodySchema, respModel)) { errors.push({ message: `A PUT operation request body schema should be the same as its 200 response schema, to allow reusing the same entity between GET and PUT. If the schema of the PUT request body is a superset of the GET response body, make sure you have a PATCH operation to make the resource updatable. Operation: '${putOp.operationId}' Request Model: '${reqBodySchemaPath}' Response Model: '${respModelPath}'`, path: [...path], - }); + }) } - return errors; -}; + return errors +} diff --git a/packages/rulesets/src/spectral/functions/required-read-only-properties.ts b/packages/rulesets/src/spectral/functions/required-read-only-properties.ts index 8277a74c4..1964f5e32 100644 --- a/packages/rulesets/src/spectral/functions/required-read-only-properties.ts +++ b/packages/rulesets/src/spectral/functions/required-read-only-properties.ts @@ -2,28 +2,25 @@ export const requiredReadOnlyProperties = (definition: any, _opts: any, ctx: any) => { if (definition === null || typeof definition !== "object") { - return []; + return [] } - if ( - !Array.isArray(definition.required) || - (Array.isArray(definition.required) && definition.required.length === 0) - ) { - return []; + if (!Array.isArray(definition.required) || (Array.isArray(definition.required) && definition.required.length === 0)) { + return [] } if (!definition.properties) { - return []; + return [] } - const path = ctx.path || []; - const errors: any = []; - const required = definition.required; - const properties = definition.properties; + const path = ctx.path || [] + const errors: any = [] + const required = definition.required + const properties = definition.properties for (const property in properties) { if (properties[property].readOnly === true && required.includes(property)) { errors.push({ message: `Property '${property}' is a required property. It should not be marked as 'readonly'`, path: [...path], - }); + }) } } - return errors; -}; + return errors +} diff --git a/packages/rulesets/src/spectral/functions/security-definitions-structure.ts b/packages/rulesets/src/spectral/functions/security-definitions-structure.ts index a431ce080..5e4cae993 100644 --- a/packages/rulesets/src/spectral/functions/security-definitions-structure.ts +++ b/packages/rulesets/src/spectral/functions/security-definitions-structure.ts @@ -2,28 +2,27 @@ export const securityDefinitionsStructure = (swagger: any, _opts: any) => { if (swagger === "" || typeof swagger !== "object") { - return []; + return [] } if (!Object.keys(swagger).includes("securityDefinitions")) { - return []; + return [] } - const errors: any = []; - const securityDefinition = swagger.securityDefinitions; - let likeModule = false; + const errors: any = [] + const securityDefinition = swagger.securityDefinitions + let likeModule = false if ( securityDefinition?.azure_auth?.type === "oauth2" && - securityDefinition?.azure_auth?.authorizationUrl === - "https://login.microsoftonline.com/common/oauth2/authorize" && + securityDefinition?.azure_auth?.authorizationUrl === "https://login.microsoftonline.com/common/oauth2/authorize" && securityDefinition?.azure_auth?.flow === "implicit" && securityDefinition?.azure_auth?.description && securityDefinition?.azure_auth?.scopes?.user_impersonation ) { - likeModule = true; + likeModule = true } if (!likeModule) { errors.push({ message: `Every OpenAPI(swagger) spec/configuration must have a security definitions section and it must adhere to the following structure: https://github.com/Azure/azure-openapi-validator/blob/main/docs/security-definitions-structure-validation.md`, - }); + }) } - return errors; -}; + return errors +} diff --git a/packages/rulesets/src/spectral/functions/sku-validation.ts b/packages/rulesets/src/spectral/functions/sku-validation.ts index f172d0810..14c053a46 100644 --- a/packages/rulesets/src/spectral/functions/sku-validation.ts +++ b/packages/rulesets/src/spectral/functions/sku-validation.ts @@ -1,40 +1,40 @@ // Check a sku model to ensure it must have a name property. It can also have 'tier', 'size', 'family', 'capacity' as optional properties. -import { getProperties } from "./utils"; +import { getProperties } from "./utils" -const skuValidation = (skuSchema:any, opts:any, paths:any) => { - if (skuSchema === null || typeof skuSchema !== 'object') { - return []; +const skuValidation = (skuSchema: any, opts: any, paths: any) => { + if (skuSchema === null || typeof skuSchema !== "object") { + return [] } - const path = paths.path || []; + const path = paths.path || [] const errors = [] const propertiesRegEx = /^(NAME|TIER|SIZE|FAMILY|CAPACITY)$/i const properties = getProperties(skuSchema) const message = { - message: `A Sku model must have 'name' property. It can also have 'tier', 'size', 'family', 'capacity' as optional properties.`, - path, - } + message: `A Sku model must have 'name' property. It can also have 'tier', 'size', 'family', 'capacity' as optional properties.`, + path, + } if (!properties) { errors.push(message) return errors } - if (!Object.keys(properties).includes('name')) { + if (!Object.keys(properties).includes("name")) { errors.push(message) return errors } for (const prop of Object.entries(properties)) { if (!propertiesRegEx.test(prop[0])) { errors.push(message) - break; + break } - if (prop[0].toLowerCase() === "name"){ - if ((prop[1] as any ).type !== "string") { + if (prop[0].toLowerCase() === "name") { + if ((prop[1] as any).type !== "string") { errors.push(message) } } } - return errors; -}; + return errors +} -export default skuValidation \ No newline at end of file +export default skuValidation diff --git a/packages/rulesets/src/spectral/functions/utils.ts b/packages/rulesets/src/spectral/functions/utils.ts index 8e4756da6..6b9903c98 100644 --- a/packages/rulesets/src/spectral/functions/utils.ts +++ b/packages/rulesets/src/spectral/functions/utils.ts @@ -152,25 +152,25 @@ export function isXmsResource(schema: any) { export function isSchemaEqual(a: any, b: any): boolean { if (a && b) { - const propsA = Object.getOwnPropertyNames(a); - const propsB = Object.getOwnPropertyNames(b); + const propsA = Object.getOwnPropertyNames(a) + const propsB = Object.getOwnPropertyNames(b) if (propsA.length === propsB.length) { for (let i = 0; i < propsA.length; i++) { - const propsAName = propsA[i]; - const [propA, propB] = [a[propsAName], b[propsAName]]; + const propsAName = propsA[i] + const [propA, propB] = [a[propsAName], b[propsAName]] if (typeof propA === "object") { if (!isSchemaEqual(propA, propB)) { - return false; + return false } else if (i === propsA.length - 1) { - return true; + return true } } else if (propA !== propB) { - return false; + return false } else if (propA === propB && i === propsA.length - 1) { - return true; + return true } } } } - return false; + return false } diff --git a/packages/rulesets/src/spectral/functions/version-policy.ts b/packages/rulesets/src/spectral/functions/version-policy.ts index c3e700dc0..b263d5da9 100644 --- a/packages/rulesets/src/spectral/functions/version-policy.ts +++ b/packages/rulesets/src/spectral/functions/version-policy.ts @@ -2,114 +2,114 @@ // - DO NOT include a version segment in the base_url or path // Return the first segment of a path that matches the pattern 'v\d+' or 'v\d+.\d+ -function getVersion(path:string) { - const url = new URL(path, 'https://foo.bar'); - const segments = url.pathname.split('/'); - return segments.find((segment) => segment.match(/v[0-9]+(.[0-9]+)?/)); +function getVersion(path: string) { + const url = new URL(path, "https://foo.bar") + const segments = url.pathname.split("/") + return segments.find((segment) => segment.match(/v[0-9]+(.[0-9]+)?/)) } -function checkPaths(targetVal:any) { - const oas2 = targetVal.swagger; +function checkPaths(targetVal: any) { + const oas2 = targetVal.swagger if (oas2) { - const basePath = targetVal.basePath || ''; - const version = getVersion(basePath); + const basePath = targetVal.basePath || "" + const version = getVersion(basePath) if (version) { return [ { message: `Version segment "${version}" in basePath violates Azure versioning policy.`, - path: ['basePath'], + path: ["basePath"], }, - ]; + ] } } // We did not find a major version in basePath, so now check the paths - const { paths } = targetVal; - const errors :any[]= []; - if (paths && typeof paths === 'object') { + const { paths } = targetVal + const errors: any[] = [] + if (paths && typeof paths === "object") { Object.keys(paths).forEach((path) => { - const version = getVersion(path); + const version = getVersion(path) if (version) { errors.push({ message: `Version segment "${version}" in path violates Azure versioning policy.`, - path: ['paths', path], - }); + path: ["paths", path], + }) } - }); + }) } - return errors; + return errors } -function findVersionParam(params:unknown) { - const isApiVersion = (elem:any) => elem.name === 'api-version' && elem.in === 'query'; +function findVersionParam(params: unknown) { + const isApiVersion = (elem: any) => elem.name === "api-version" && elem.in === "query" if (params && Array.isArray(params)) { - return params.filter(isApiVersion).shift(); + return params.filter(isApiVersion).shift() } - return undefined; + return undefined } // Verify version parameter has certain characteristics: // - it is required -function validateVersionParam(param:any, path:any) { - const errors = []; +function validateVersionParam(param: any, path: any) { + const errors = [] if (!param.required) { errors.push({ message: '"api-version" should be a required parameter', path, - }); + }) } - return errors; + return errors } // Verify that every operation defines a query param called `api-version` -function checkVersionParam(targetVal:any) { - const { paths } = targetVal; - const errors :any[]= []; - if (paths && typeof paths === 'object') { +function checkVersionParam(targetVal: any) { + const { paths } = targetVal + const errors: any[] = [] + if (paths && typeof paths === "object") { Object.keys(paths).forEach((path) => { // Parameters can be defined at the path level. if (paths[path].parameters && Array.isArray(paths[path].parameters)) { - const versionParam = findVersionParam(paths[path].parameters); + const versionParam = findVersionParam(paths[path].parameters) if (versionParam) { - const index = paths[path].parameters.indexOf(versionParam); - errors.push(...validateVersionParam(versionParam, ['paths', path, 'parameters', index.toString()])); - return; + const index = paths[path].parameters.indexOf(versionParam) + errors.push(...validateVersionParam(versionParam, ["paths", path, "parameters", index.toString()])) + return } } - ['get', 'post', 'put', 'patch', 'delete'].forEach((method) => { + ;["get", "post", "put", "patch", "delete"].forEach((method) => { if (paths[path][method]) { - const versionParam = findVersionParam(paths[path][method].parameters); + const versionParam = findVersionParam(paths[path][method].parameters) if (versionParam) { - const index = paths[path][method].parameters.indexOf(versionParam); - errors.push(...validateVersionParam(versionParam, ['paths', path, method, 'parameters', index])); + const index = paths[path][method].parameters.indexOf(versionParam) + errors.push(...validateVersionParam(versionParam, ["paths", path, method, "parameters", index])) } else { errors.push({ message: 'Operation does not define an "api-version" query parameter.', - path: ['paths', path, method, 'parameters'], - }); + path: ["paths", path, method, "parameters"], + }) } } - }); - }); + }) + }) } - return errors; + return errors } // Check API definition to ensure conformance to Azure versioning guidelines. // @param targetVal - the entire API document -export const versionPolicy = (targetVal:any) => { - if (targetVal === null || typeof targetVal !== 'object') { - return []; +export const versionPolicy = (targetVal: any) => { + if (targetVal === null || typeof targetVal !== "object") { + return [] } - const errors = checkPaths(targetVal); - errors.push(...checkVersionParam(targetVal)); + const errors = checkPaths(targetVal) + errors.push(...checkVersionParam(targetVal)) - return errors; -}; + return errors +} -export default versionPolicy \ No newline at end of file +export default versionPolicy diff --git a/packages/rulesets/src/spectral/functions/with-xms-resource.ts b/packages/rulesets/src/spectral/functions/with-xms-resource.ts index f45428c8a..467b10452 100644 --- a/packages/rulesets/src/spectral/functions/with-xms-resource.ts +++ b/packages/rulesets/src/spectral/functions/with-xms-resource.ts @@ -1,18 +1,16 @@ import { getReturnedSchema, isXmsResource } from "./utils" - -export const withXmsResource = (putOperation: any, _opts: any, ctx: any) => { - +export const withXmsResource = (putOperation: any, _opts: any, ctx: any) => { const errors = [] const path = ctx.path - const returnSchema = getReturnedSchema(putOperation) + const returnSchema = getReturnedSchema(putOperation) if (returnSchema && !isXmsResource(returnSchema)) { errors.push({ message: `The 200 response model for an ARM PUT operation must have x-ms-azure-resource extension set to true in its hierarchy.Operation: ${putOperation.operationId}`, - path + path, }) } return errors } -export default withXmsResource \ No newline at end of file +export default withXmsResource diff --git a/packages/rulesets/src/spectral/functions/xms-client-name-parameter.ts b/packages/rulesets/src/spectral/functions/xms-client-name-parameter.ts index 0cbda7637..7b59db68f 100644 --- a/packages/rulesets/src/spectral/functions/xms-client-name-parameter.ts +++ b/packages/rulesets/src/spectral/functions/xms-client-name-parameter.ts @@ -1,20 +1,19 @@ // The `x-ms-client-name` extension is used to change the name of a parameter or property in the generated code. // By using the 'x-ms-client-name' extension, a name can be defined for use specifically in code generation, separately from the name on the wire. // It can be used for query parameters and header parameters, as well as properties of schemas. This name is case sensitive. -const xmsClientNameParameter = (swaggerObj:any, _opts:any, paths:any) => { - if (swaggerObj === null) { - return []; - } - if (swaggerObj.name !== swaggerObj['x-ms-client-name']) - return []; - const path = paths.path || []; - path.push('x-ms-client-name') - return [ - { - message: `Value of 'x-ms-client-name' cannot be the same as ${swaggerObj.name} Property/Model.`, - path: path - }, - ]; -}; +const xmsClientNameParameter = (swaggerObj: any, _opts: any, paths: any) => { + if (swaggerObj === null) { + return [] + } + if (swaggerObj.name !== swaggerObj["x-ms-client-name"]) return [] + const path = paths.path || [] + path.push("x-ms-client-name") + return [ + { + message: `Value of 'x-ms-client-name' cannot be the same as ${swaggerObj.name} Property/Model.`, + path: path, + }, + ] +} export default xmsClientNameParameter diff --git a/packages/rulesets/src/spectral/functions/xms-client-name-property.ts b/packages/rulesets/src/spectral/functions/xms-client-name-property.ts index 39591f56c..6ea97ea0d 100644 --- a/packages/rulesets/src/spectral/functions/xms-client-name-property.ts +++ b/packages/rulesets/src/spectral/functions/xms-client-name-property.ts @@ -1,22 +1,20 @@ // The `x-ms-client-name` extension is used to change the name of a parameter or property in the generated code. // By using the 'x-ms-client-name' extension, a name can be defined for use specifically in code generation, separately from the name on the wire. // It can be used for query parameters and header parameters, as well as properties of schemas. This name is case sensitive. -const xmsClientNameProperty = (swaggerObj:any, _opts:any, paths:any) => { - if (swaggerObj === null || typeof swaggerObj !== "string") { - return []; - } - const path = paths.path || []; - if (!path || path.length <= 2) - return []; - const name: string = path[path.length - 2] - if (swaggerObj !== name) - return []; - return [ - { - message: `Value of 'x-ms-client-name' cannot be the same as ${name} Property/Model.`, - path: path - }, - ]; -}; +const xmsClientNameProperty = (swaggerObj: any, _opts: any, paths: any) => { + if (swaggerObj === null || typeof swaggerObj !== "string") { + return [] + } + const path = paths.path || [] + if (!path || path.length <= 2) return [] + const name: string = path[path.length - 2] + if (swaggerObj !== name) return [] + return [ + { + message: `Value of 'x-ms-client-name' cannot be the same as ${name} Property/Model.`, + path: path, + }, + ] +} export default xmsClientNameProperty diff --git a/packages/rulesets/src/spectral/test/additional-properties-object.test.ts b/packages/rulesets/src/spectral/test/additional-properties-object.test.ts index a4f561330..3cfc56bb5 100644 --- a/packages/rulesets/src/spectral/test/additional-properties-object.test.ts +++ b/packages/rulesets/src/spectral/test/additional-properties-object.test.ts @@ -1,94 +1,94 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('AdditionalPropertiesObject'); - return linter; -}); + linter = await linterForRule("AdditionalPropertiesObject") + return linter +}) -test('AdditionalPropertiesObject should find errors', () => { +test("AdditionalPropertiesObject should find errors", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", definitions: { This: { - description: 'This', - type: 'object', + description: "This", + type: "object", additionalProperties: { - type: 'object', + type: "object", }, }, That: { - description: 'That', - type: 'object', + description: "That", + type: "object", properties: { params: { additionalProperties: { - type: 'object', + type: "object", }, }, }, }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(2); - expect(results[0].path.join('.')).toBe('definitions.This.additionalProperties'); - expect(results[1].path.join('.')).toBe('definitions.That.properties.params.additionalProperties'); - }); -}); + expect(results.length).toBe(2) + expect(results[0].path.join(".")).toBe("definitions.This.additionalProperties") + expect(results[1].path.join(".")).toBe("definitions.That.properties.params.additionalProperties") + }) +}) -test('AdditionalPropertiesObject should find no errors', () => { +test("AdditionalPropertiesObject should find no errors", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", definitions: { This: { - description: 'This', - type: 'object', + description: "This", + type: "object", additionalProperties: { - type: 'object', + type: "object", properties: { prop1: { - type: 'string', + type: "string", }, }, }, }, That: { - description: 'That', - type: 'object', + description: "That", + type: "object", properties: { params: { additionalProperties: { - type: 'string', + type: "string", }, }, }, }, ThaOther: { - description: 'ThaOther', - type: 'object', + description: "ThaOther", + type: "object", properties: { otherMap: { additionalProperties: { - $ref: '#/definitions/Other', + $ref: "#/definitions/Other", }, }, }, }, Other: { - description: 'Other object', - type: 'object', + description: "Other object", + type: "object", properties: { aProp: { - type: 'string', + type: "string", }, }, }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/api-version-parameter.test.ts b/packages/rulesets/src/spectral/test/api-version-parameter.test.ts index c6f479898..718deaee0 100644 --- a/packages/rulesets/src/spectral/test/api-version-parameter.test.ts +++ b/packages/rulesets/src/spectral/test/api-version-parameter.test.ts @@ -1,144 +1,142 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('ApiVersionParameterRequired'); - return linter; -}); + linter = await linterForRule("ApiVersionParameterRequired") + return linter +}) -test('ApiVersionParameterRequired should find errors when missing api-version', () => { +test("ApiVersionParameterRequired should find errors when missing api-version", () => { // Test parameter ordering at path item level and operation level. const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/test1/{p1}/foo/{p2}': { + "/test1/{p1}/foo/{p2}": { parameters: [ { - name: 'p2', - in: 'path', - type: 'string', + name: "p2", + in: "path", + type: "string", }, { - name: 'p1', - in: 'path', - type: 'string', + name: "p1", + in: "path", + type: "string", }, ], - get: { - }, + get: {}, }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(1); - expect(results[0].path.join('.')).toBe('paths./test1/{p1}/foo/{p2}.get'); - }); -}); + expect(results.length).toBe(1) + expect(results[0].path.join(".")).toBe("paths./test1/{p1}/foo/{p2}.get") + }) +}) -test('ApiVersionParameterRequired should find errors when api-version is not in query', () => { +test("ApiVersionParameterRequired should find errors when api-version is not in query", () => { // Test parameter ordering at path item level and operation level. const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/test1/{p1}/foo/{p2}': { + "/test1/{p1}/foo/{p2}": { parameters: [ { - name: 'p2', - in: 'path', - type: 'string', + name: "p2", + in: "path", + type: "string", }, { - name: 'p1', - in: 'path', - type: 'string', + name: "p1", + in: "path", + type: "string", }, ], get: { parameters: [ { - name: 'api-version', - in: 'header', - type: 'string', + name: "api-version", + in: "header", + type: "string", }, ], }, }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(1); - expect(results[0].path.join('.')).toBe('paths./test1/{p1}/foo/{p2}.get'); - expect(results[0].message).toBe("Operation 'api-version' parameter should be a query parameter."); - }); -}); + expect(results.length).toBe(1) + expect(results[0].path.join(".")).toBe("paths./test1/{p1}/foo/{p2}.get") + expect(results[0].message).toBe("Operation 'api-version' parameter should be a query parameter.") + }) +}) -test('ApiVersionParameterRequired should find no errors when api-version is in path level parameters', () => { +test("ApiVersionParameterRequired should find no errors when api-version is in path level parameters", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/test1/{p1}/foo/{p2}': { + "/test1/{p1}/foo/{p2}": { parameters: [ { - name: 'p1', - in: 'path', - type: 'string', + name: "p1", + in: "path", + type: "string", }, { - name: 'api-version', - in: 'query', - type: 'string', + name: "api-version", + in: "query", + type: "string", }, ], get: { parameters: [ { - name: 'p3', - in: 'query', - type: 'string', + name: "p3", + in: "query", + type: "string", }, ], }, }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) -test('ApiVersionParameterRequired should find no errors when api-version is in operation parameters', () => { +test("ApiVersionParameterRequired should find no errors when api-version is in operation parameters", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/test1/{p1}/foo/{p2}': { + "/test1/{p1}/foo/{p2}": { parameters: [ { - name: 'p1', - in: 'path', - type: 'string', + name: "p1", + in: "path", + type: "string", }, - ], get: { parameters: [ { - name: 'p3', - in: 'query', - type: 'string', + name: "p3", + in: "query", + type: "string", }, { - name: 'api-version', - in: 'query', - type: 'string', - }, + name: "api-version", + in: "query", + type: "string", + }, ], }, }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/arm-path-validation.test.ts b/packages/rulesets/src/spectral/test/arm-path-validation.test.ts index cb001af47..23b92bb23 100644 --- a/packages/rulesets/src/spectral/test/arm-path-validation.test.ts +++ b/packages/rulesets/src/spectral/test/arm-path-validation.test.ts @@ -202,15 +202,16 @@ test("PathForNestedResource should find no errors", () => { const oasDoc = { swagger: "2.0", paths: { - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentTemplates/{templateId}": { - put: { - tags: ["SampleTag"], - operationId: "Foo_CreateOrUpdate", - description: "Test Description", - parameters: [], - responses: {}, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentTemplates/{templateId}": + { + put: { + tags: ["SampleTag"], + operationId: "Foo_CreateOrUpdate", + description: "Test Description", + parameters: [], + responses: {}, + }, }, - }, }, } return linters.PathForNestedResource.run(oasDoc).then((results) => { diff --git a/packages/rulesets/src/spectral/test/avoid-anonymous-parameter.test.ts b/packages/rulesets/src/spectral/test/avoid-anonymous-parameter.test.ts index da48a6fdd..c91cd2e30 100644 --- a/packages/rulesets/src/spectral/test/avoid-anonymous-parameter.test.ts +++ b/packages/rulesets/src/spectral/test/avoid-anonymous-parameter.test.ts @@ -1,71 +1,64 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('AvoidAnonymousParameter'); - return linter; -}); + linter = await linterForRule("AvoidAnonymousParameter") + return linter +}) -test('AvoidAnonymousParameter should find errors', () => { +test("AvoidAnonymousParameter should find errors", () => { const myOpenApiDocument = { swagger: "2.0", info: { title: "Consumes has an unsupported MIME type", description: "Some documentation.", - version: "2014-04-01-preview" + version: "2014-04-01-preview", }, host: "management.azure.com", - schemes: [ - "https" - ], + schemes: ["https"], basePath: "/", - produces: [ - "application/json" - ], + produces: ["application/json"], paths: { - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}": { - patch: { - tags: [ - "RecordSets" - ], - operationId: "RecordSets_Update", - description: "Updates a record set within a DNS zone.", - parameters: [ - { - name: "zoneName", - in: "path", - required: true, - type: "string", - schema: { - type: "string", - description: "error", - properties: { - prop1: { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}": + { + patch: { + tags: ["RecordSets"], + operationId: "RecordSets_Update", + description: "Updates a record set within a DNS zone.", + parameters: [ + { + name: "zoneName", + in: "path", + required: true, + type: "string", + schema: { type: "string", - description: "property 1" - } - } - }, - description: "The name of the DNS zone (without a terminating dot)." + description: "error", + properties: { + prop1: { + type: "string", + description: "property 1", + }, + }, + }, + description: "The name of the DNS zone (without a terminating dot).", + }, + { + name: "parameters", + in: "body", + required: true, + schema: { + $ref: "#/parameters/test", + }, + description: "Parameters supplied to the Update operation.", + }, + ], }, - { - name: "parameters", - in: "body", - required: true, - schema: { - "$ref": "#/parameters/test" - }, - description: "Parameters supplied to the Update operation." - } - ] - } - } + }, }, - consumes: [ - "application/json" - ], + consumes: ["application/json"], parameters: { test: { name: "PetCreateOrUpdateParameter", @@ -77,74 +70,67 @@ test('AvoidAnonymousParameter should find errors', () => { properties: { prop1: { type: "string", - description: "property 1" - } - } - } + description: "property 1", + }, + }, + }, }, SubscriptionIdParameter: { name: "subscriptionId", in: "path", required: true, type: "string", - description: "test subscription id" + description: "test subscription id", }, ApiVersion: { name: "api-version", in: "path", required: true, type: "string", - description: "test api version" - } - } - }; + description: "test api version", + }, + }, + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - }); -}); + expect(results.length).toBe(1) + }) +}) -test('AvoidAnonymousParameter should find no errors', () => { +test("AvoidAnonymousParameter should find no errors", () => { const myOpenApiDocument = { swagger: "2.0", info: { title: "Consumes has an unsupported MIME type", description: "Some documentation.", - version: "2014-04-01-preview" + version: "2014-04-01-preview", }, host: "management.azure.com", - schemes: [ - "https" - ], + schemes: ["https"], basePath: "/", - produces: [ - "application/json" - ], - consumes: [ - "application/json" - ], + produces: ["application/json"], + consumes: ["application/json"], parameters: { test: { name: "PetCreateOrUpdateParameter", description: "test", in: "body", schema: { - "$ref": "#/definitions/FooRequestParams" - } - } + $ref: "#/definitions/FooRequestParams", + }, + }, }, definitions: { FooRequestParams: { properties: { prop0: { - type: "string" - } + type: "string", + }, }, - required: [] - } - } - }; + required: [], + }, + }, + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); - + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/avoid-msdn-references.test.ts b/packages/rulesets/src/spectral/test/avoid-msdn-references.test.ts index bd95fb738..e3df2d44c 100644 --- a/packages/rulesets/src/spectral/test/avoid-msdn-references.test.ts +++ b/packages/rulesets/src/spectral/test/avoid-msdn-references.test.ts @@ -1,66 +1,67 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('AvoidMsdnReferences'); - return linter; -}); + linter = await linterForRule("AvoidMsdnReferences") + return linter +}) -test('AvoidMsdnReferences should find errors', () => { +test("AvoidMsdnReferences should find errors", () => { const myOpenApiDocument = { swagger: "2.0", info: { title: "Consumes has an unsupported MIME type", - description: "Use these APIs to manage Azure Websites resources through the Azure Resource Manager. All task operations conform to the HTTP/1.1 protocol specification and each operation returns an x-ms-request-id header that can be used to obtain information about the request. You must make sure that requests made to these resources are secure. For more information, see https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx.", - version: "2014-04-01-preview" + description: + "Use these APIs to manage Azure Websites resources through the Azure Resource Manager. All task operations conform to the HTTP/1.1 protocol specification and each operation returns an x-ms-request-id header that can be used to obtain information about the request. You must make sure that requests made to these resources are secure. For more information, see https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx.", + version: "2014-04-01-preview", }, - definitions:{ - AuthorizationServerCollection:{ - definitions:{ - AuthorizationServerCollection:{ + definitions: { + AuthorizationServerCollection: { + definitions: { + AuthorizationServerCollection: { externalDocs: { - url: "https://msdn.microsoft.com" + url: "https://msdn.microsoft.com", }, - grantTypes:{ - externalDocs:{ - url: "https://docs.microsoft.com/msdn.microsoft.com" - } - } - } - } - } - } - }; + grantTypes: { + externalDocs: { + url: "https://docs.microsoft.com/msdn.microsoft.com", + }, + }, + }, + }, + }, + }, + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(2); - }); -}); + expect(results.length).toBe(2) + }) +}) -test('AvoidMsdnReferences should find no errors', () => { +test("AvoidMsdnReferences should find no errors", () => { const myOpenApiDocument = { swagger: "2.0", info: { title: "Consumes has an unsupported MIME type", - description: "Use these REST APIs for performing operations on Backend entity in Azure API Management deployment. The Backend entity in API Management represents a backend service that is configured to skip certification chain validation when using a self-signed certificate to test mutual certificate authentication.", - version: "2014-04-01-preview" + description: + "Use these REST APIs for performing operations on Backend entity in Azure API Management deployment. The Backend entity in API Management represents a backend service that is configured to skip certification chain validation when using a self-signed certificate to test mutual certificate authentication.", + version: "2014-04-01-preview", }, - definitions:{ - AuthorizationServerCollection:{ + definitions: { + AuthorizationServerCollection: { externalDocs: { - url: "https://docs.microsoft.com" + url: "https://docs.microsoft.com", }, - grantTypes:{ - externalDocs:{ - url: "https://docs.microsoft.com" - } - } - } - } - }; + grantTypes: { + externalDocs: { + url: "https://docs.microsoft.com", + }, + }, + }, + }, + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); - + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/avoid-nested-properties.test.ts b/packages/rulesets/src/spectral/test/avoid-nested-properties.test.ts index e358eca8f..dace2fdb2 100644 --- a/packages/rulesets/src/spectral/test/avoid-nested-properties.test.ts +++ b/packages/rulesets/src/spectral/test/avoid-nested-properties.test.ts @@ -1,63 +1,66 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('AvoidNestedProperties'); - return linter; -}); + linter = await linterForRule("AvoidNestedProperties") + return linter +}) -test('AvoidNestedProperties should find errors', () => { - const myOpenApiDocument = { - swagger: "2.0", - info: { - description: "Use these APIs to manage Azure Websites resources through the Azure Resource Manager. All task operations conform to the HTTP/1.1 protocol specification and each operation returns an x-ms-request-id header that can be used to obtain information about the request. You must make sure that requests made to these resources are secure. For more information, see https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx.", - }, - definitions:{ - externalDocs: { - properties:{ - properties:{ - $ref: "#/definitions/BackendProperties" - } - }, +test("AvoidNestedProperties should find errors", () => { + const myOpenApiDocument = { + swagger: "2.0", + info: { + description: + "Use these APIs to manage Azure Websites resources through the Azure Resource Manager. All task operations conform to the HTTP/1.1 protocol specification and each operation returns an x-ms-request-id header that can be used to obtain information about the request. You must make sure that requests made to these resources are secure. For more information, see https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx.", + }, + definitions: { + externalDocs: { + properties: { + properties: { + properties: { + $ref: "#/definitions/BackendProperties", }, - BackendProperties: { - properties:{ - $ref: "#/definitions/externalDocs" - }, - } - } - }; - return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - }); -}); - -test('AvoidNestedProperties should find no errors', () => { - const myOpenApiDocument = { - swagger: "2.0", - info: { - description: "Use these APIs to manage Azure Websites resources through the Azure Resource Manager. All task operations conform to the HTTP/1.1 protocol specification and each operation returns an x-ms-request-id header that can be used to obtain information about the request. You must make sure that requests made to these resources are secure. For more information, see https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx.", + }, }, - definitions:{ - externalDocs: { - properties:{ - properties:{ - "x-ms-client-flatten" : true, - $ref: "#/definitions/BackendProperties" - } - }, - }, - BackendProperties: { - properties:{ - $ref: "#/definitions/externalDocs" - }, - } - } - }; - return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + }, + BackendProperties: { + properties: { + $ref: "#/definitions/externalDocs", + }, + }, + }, + } + return linter.run(myOpenApiDocument).then((results) => { + expect(results.length).toBe(1) + }) +}) +test("AvoidNestedProperties should find no errors", () => { + const myOpenApiDocument = { + swagger: "2.0", + info: { + description: + "Use these APIs to manage Azure Websites resources through the Azure Resource Manager. All task operations conform to the HTTP/1.1 protocol specification and each operation returns an x-ms-request-id header that can be used to obtain information about the request. You must make sure that requests made to these resources are secure. For more information, see https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx.", + }, + definitions: { + externalDocs: { + properties: { + properties: { + "x-ms-client-flatten": true, + $ref: "#/definitions/BackendProperties", + }, + }, + }, + BackendProperties: { + properties: { + $ref: "#/definitions/externalDocs", + }, + }, + }, + } + return linter.run(myOpenApiDocument).then((results) => { + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/camel-case.test.ts b/packages/rulesets/src/spectral/test/camel-case.test.ts index 9cfa56cb0..87edc32f9 100644 --- a/packages/rulesets/src/spectral/test/camel-case.test.ts +++ b/packages/rulesets/src/spectral/test/camel-case.test.ts @@ -1,67 +1,65 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('DefinitionsPropertiesNamesCamelCase'); - return linter; -}); + linter = await linterForRule("DefinitionsPropertiesNamesCamelCase") + return linter +}) -test('DefinitionsPropertiesNamesCamelCase should find errors', () => { +test("DefinitionsPropertiesNamesCamelCase should find errors", () => { const oasDoc = { - swagger: '2.0', - paths: { - }, + swagger: "2.0", + paths: {}, definitions: { - TestModelA:{ - type:"object", + TestModelA: { + type: "object", properties: { - validCamelCAS:{ - type: "string" + validCamelCAS: { + type: "string", }, - validCamelCAseABC:{ - type: "string" + validCamelCAseABC: { + type: "string", }, InvalidCamelCase: { - type: "string" + type: "string", }, invalidCAMElCase: { - type: "string" - } - } - } - } - }; + type: "string", + }, + }, + }, + }, + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(2); - expect(results[0].path.join('.')).toBe('definitions.TestModelA.properties.InvalidCamelCase'); - expect(results[0].message).toBe('Property name should be camel case.'); - expect(results[1].path.join('.')).toBe('definitions.TestModelA.properties.invalidCAMElCase'); - expect(results[1].message).toBe('Property name should be camel case.'); - }); -}); + expect(results.length).toBe(2) + expect(results[0].path.join(".")).toBe("definitions.TestModelA.properties.InvalidCamelCase") + expect(results[0].message).toBe("Property name should be camel case.") + expect(results[1].path.join(".")).toBe("definitions.TestModelA.properties.invalidCAMElCase") + expect(results[1].message).toBe("Property name should be camel case.") + }) +}) -test('DefinitionsPropertiesNamesCamelCase should find no errors', () => { +test("DefinitionsPropertiesNamesCamelCase should find no errors", () => { const oasDoc = { - swagger: '2.0', - paths: { - }, + swagger: "2.0", + paths: {}, definitions: { - TestModelA:{ - type:"object", + TestModelA: { + type: "object", properties: { - validCamelCAS:{ - type: "string" + validCamelCAS: { + type: "string", + }, + validCamelCAseABC: { + type: "string", }, - validCamelCAseABC:{ - type: "string" - } - } - } - } - }; + }, + }, + }, + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/collection-object-properties-naming.test.ts b/packages/rulesets/src/spectral/test/collection-object-properties-naming.test.ts index 776dcdc68..bb2cf17a9 100644 --- a/packages/rulesets/src/spectral/test/collection-object-properties-naming.test.ts +++ b/packages/rulesets/src/spectral/test/collection-object-properties-naming.test.ts @@ -1,184 +1,186 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('CollectionObjectPropertiesNaming'); - return linter; -}); + linter = await linterForRule("CollectionObjectPropertiesNaming") + return linter +}) - -test('CollectionObjectPropertiesNaming should find errors in value property', () => { +test("CollectionObjectPropertiesNaming should find errors in value property", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/test2': { + "/test2": { get: { operationId: "test_ListByID", responses: { 200: { - description: 'Success', + description: "Success", schema: { properties: { value: { - type: 'string', + type: "string", }, nextLink: { - type: 'string', + type: "string", }, }, - required: ['value'], + required: ["value"], }, }, }, - 'x-ms-pageable': { - nextLinkName: 'nextLink', + "x-ms-pageable": { + nextLinkName: "nextLink", }, }, }, - '/test3': { + "/test3": { get: { operationId: "test_ListByID", responses: { 200: { - description: 'Success', + description: "Success", schema: { properties: { values: { - type: 'array', + type: "array", }, nextLink: { - type: 'string', + type: "string", }, }, - required: ['value'], + required: ["value"], }, }, }, - 'x-ms-pageable': { - nextLinkName: 'nextLink', + "x-ms-pageable": { + nextLinkName: "nextLink", }, }, }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(2); - expect(results[0].path.join('.')).toBe('paths./test2.get.responses.200.schema'); - expect(results[0].message).toBe("Collection object returned by list operation 'test_ListByID' with 'x-ms-pageable' extension, has no property named 'value'."); - expect(results[1].path.join('.')).toBe('paths./test3.get.responses.200.schema'); - expect(results[1].message).toBe("Collection object returned by list operation 'test_ListByID' with 'x-ms-pageable' extension, has no property named 'value'."); - }); -}); - + expect(results.length).toBe(2) + expect(results[0].path.join(".")).toBe("paths./test2.get.responses.200.schema") + expect(results[0].message).toBe( + "Collection object returned by list operation 'test_ListByID' with 'x-ms-pageable' extension, has no property named 'value'." + ) + expect(results[1].path.join(".")).toBe("paths./test3.get.responses.200.schema") + expect(results[1].message).toBe( + "Collection object returned by list operation 'test_ListByID' with 'x-ms-pageable' extension, has no property named 'value'." + ) + }) +}) -test('CollectionObjectPropertiesNaming should find no errors', () => { +test("CollectionObjectPropertiesNaming should find no errors", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/good-path': { + "/good-path": { get: { - operationId: 'Good_List', + operationId: "Good_List", responses: { 200: { - description: 'Success', + description: "Success", schema: { properties: { value: { - type: 'array', + type: "array", }, nextLink: { - type: 'string', + type: "string", }, }, - required: ['value'], + required: ["value"], }, }, }, - 'x-ms-pageable': { - nextLinkName: 'nextLink', + "x-ms-pageable": { + nextLinkName: "nextLink", }, }, }, - '/good-path2': { + "/good-path2": { get: { - operationId: 'Good_List2', + operationId: "Good_List2", responses: { 200: { - description: 'Success', + description: "Success", schema: { properties: { value: { - type: 'array', + type: "array", }, nextLink: { - type: 'string', + type: "string", }, }, - required: ['value'], + required: ["value"], }, }, }, - 'x-ms-pageable': { + "x-ms-pageable": { nextLinkName: null, }, }, }, - '/good-path3': { + "/good-path3": { get: { - operationId: 'Good_List3', + operationId: "Good_List3", responses: { 200: { - description: 'Success', + description: "Success", schema: { properties: { value: { - type: 'array', + type: "array", }, nextPage: { - type: 'string', + type: "string", }, }, - required: ['value'], + required: ["value"], }, }, }, - 'x-ms-pageable': { - nextLinkName: 'nextPage', + "x-ms-pageable": { + nextLinkName: "nextPage", }, }, }, - '/good-path4': { + "/good-path4": { get: { - operationId: 'Good_NotList', + operationId: "Good_NotList", responses: { 200: { - description: 'Success', + description: "Success", schema: { properties: { value: { - type: 'array', + type: "array", }, this: { - type: 'string', + type: "string", }, that: { - type: 'string', + type: "string", }, theOther: { - type: 'string', + type: "string", }, }, - required: ['value'], + required: ["value"], }, }, }, }, }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/consistent-response-body.test.ts b/packages/rulesets/src/spectral/test/consistent-response-body.test.ts index 5d40cf292..ae205e445 100644 --- a/packages/rulesets/src/spectral/test/consistent-response-body.test.ts +++ b/packages/rulesets/src/spectral/test/consistent-response-body.test.ts @@ -1,29 +1,29 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('ConsistentResponseBody'); - return linter; -}); + linter = await linterForRule("ConsistentResponseBody") + return linter +}) -test('ConsistentResponseBody should find errors', () => { +test("ConsistentResponseBody should find errors", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/test1/{id}': { + "/test1/{id}": { parameters: { - name: 'id', - in: 'path', - type: 'string', + name: "id", + in: "path", + type: "string", }, put: { responses: { 201: { - description: 'Created', + description: "Created", schema: { - $ref: '#/definitions/This', + $ref: "#/definitions/This", }, }, }, @@ -31,9 +31,9 @@ test('ConsistentResponseBody should find errors', () => { patch: { responses: { 200: { - description: 'Success', + description: "Success", schema: { - $ref: '#/definitions/That', + $ref: "#/definitions/That", }, }, }, @@ -41,9 +41,9 @@ test('ConsistentResponseBody should find errors', () => { get: { responses: { 200: { - description: 'Success', + description: "Success", schema: { - $ref: '#/definitions/ThaOther', + $ref: "#/definitions/ThaOther", }, }, }, @@ -52,50 +52,50 @@ test('ConsistentResponseBody should find errors', () => { }, definitions: { This: { - description: 'This', - type: 'object', + description: "This", + type: "object", }, That: { - description: 'That', - type: 'object', + description: "That", + type: "object", }, ThaOther: { - description: 'ThaOther', - type: 'object', + description: "ThaOther", + type: "object", }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(2); - expect(results[0].path.join('.')).toBe('paths./test1/{id}.patch.responses.200.schema'); - expect(results[0].message).toBe('Response body schema does not match create response body schema.'); - expect(results[1].path.join('.')).toBe('paths./test1/{id}.get.responses.200.schema'); - expect(results[1].message).toBe('Response body schema does not match create response body schema.'); - }); -}); + expect(results.length).toBe(2) + expect(results[0].path.join(".")).toBe("paths./test1/{id}.patch.responses.200.schema") + expect(results[0].message).toBe("Response body schema does not match create response body schema.") + expect(results[1].path.join(".")).toBe("paths./test1/{id}.get.responses.200.schema") + expect(results[1].message).toBe("Response body schema does not match create response body schema.") + }) +}) -test('ConsistentResponseBody should find no errors', () => { +test("ConsistentResponseBody should find no errors", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/test1/{id}': { + "/test1/{id}": { parameters: { - name: 'id', - in: 'path', - type: 'string', + name: "id", + in: "path", + type: "string", }, put: { responses: { 200: { - description: 'Success', + description: "Success", schema: { - $ref: '#/definitions/This', + $ref: "#/definitions/This", }, }, 201: { - description: 'Created', + description: "Created", schema: { - $ref: '#/definitions/This', + $ref: "#/definitions/This", }, }, }, @@ -103,9 +103,9 @@ test('ConsistentResponseBody should find no errors', () => { post: { responses: { 200: { - description: 'Success', + description: "Success", schema: { - $ref: '#/definitions/This', + $ref: "#/definitions/This", }, }, }, @@ -113,9 +113,9 @@ test('ConsistentResponseBody should find no errors', () => { get: { responses: { 200: { - description: 'Success', + description: "Success", schema: { - $ref: '#/definitions/This', + $ref: "#/definitions/This", }, }, }, @@ -124,12 +124,12 @@ test('ConsistentResponseBody should find no errors', () => { }, definitions: { This: { - description: 'This', - type: 'object', + description: "This", + type: "object", }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/default-in-enum.test.ts b/packages/rulesets/src/spectral/test/default-in-enum.test.ts index 218959b6b..488bfe604 100644 --- a/packages/rulesets/src/spectral/test/default-in-enum.test.ts +++ b/packages/rulesets/src/spectral/test/default-in-enum.test.ts @@ -1,32 +1,26 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('DefaultInEnum'); - return linter; -}); + linter = await linterForRule("DefaultInEnum") + return linter +}) -test('DefaultInEnum should find 1 error', () => { +test("DefaultInEnum should find 1 error", () => { const myOpenApiDocument = { swagger: "2.0", info: { title: "Default value for an ObjectSchema does not appear in enum constraint", description: "Some documentation.", - version: "2014-04-01-preview" + version: "2014-04-01-preview", }, host: "management.azure.com", - schemes: [ - "https" - ], + schemes: ["https"], basePath: "/", - produces: [ - "application/json" - ], - consumes: [ - "application/json" - ], + produces: ["application/json"], + consumes: ["application/json"], paths: { "/foo": { post: { @@ -35,28 +29,25 @@ test('DefaultInEnum should find 1 error', () => { description: "Foo operation", responses: { default: { - description: "Unexpected error" - } - } - } - } + description: "Unexpected error", + }, + }, + }, + }, }, definitions: { Test1: { - description: "Property for foo path 1" + description: "Property for foo path 1", }, Test2: { - description: "Property for foo path 2" + description: "Property for foo path 2", }, Test: { type: "string", description: "Property for foo path", - enum: [ - "Foo", - "Bar" - ], - default: "Baz" - } + enum: ["Foo", "Bar"], + default: "Baz", + }, }, parameters: { SubscriptionIdParameter: { @@ -64,42 +55,36 @@ test('DefaultInEnum should find 1 error', () => { in: "path", required: true, type: "string", - description: "test subscription id" + description: "test subscription id", }, ApiVersion: { name: "api-version", in: "path", required: true, type: "string", - description: "test api version" - } - } - }; + description: "test api version", + }, + }, + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - expect(results[0].path.join('.')).toBe('definitions.Test'); - }); -}); + expect(results.length).toBe(1) + expect(results[0].path.join(".")).toBe("definitions.Test") + }) +}) -test('DefaultInEnum should find no errors', () => { +test("DefaultInEnum should find no errors", () => { const myOpenApiDocument = { swagger: "2.0", info: { title: "Default value for an ObjectSchema does not appear in enum constraint", description: "Some documentation.", - version: "2014-04-01-preview" + version: "2014-04-01-preview", }, host: "management.azure.com", - schemes: [ - "https" - ], + schemes: ["https"], basePath: "/", - produces: [ - "application/json" - ], - consumes: [ - "application/json" - ], + produces: ["application/json"], + consumes: ["application/json"], paths: { "/foo": { post: { @@ -108,29 +93,26 @@ test('DefaultInEnum should find no errors', () => { description: "Foo operation", responses: { default: { - description: "Unexpected error" - } - } - } - } + description: "Unexpected error", + }, + }, + }, + }, }, definitions: { Test1: { - description: "Property for foo path 1" + description: "Property for foo path 1", }, Test2: { description: "Property for foo path 2", - enum: "a property" + enum: "a property", }, Test: { type: "string", description: "Property for foo path", - enum: [ - "Foo", - "Bar" - ], - default: "Bar" - } + enum: ["Foo", "Bar"], + default: "Bar", + }, }, parameters: { SubscriptionIdParameter: { @@ -138,18 +120,18 @@ test('DefaultInEnum should find no errors', () => { in: "path", required: true, type: "string", - description: "test subscription id" + description: "test subscription id", }, ApiVersion: { name: "api-version", in: "path", required: true, type: "string", - description: "test api version" - } - } - }; + description: "test api version", + }, + }, + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); \ No newline at end of file + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/delete-204-response.test.ts b/packages/rulesets/src/spectral/test/delete-204-response.test.ts index dc962fcb2..8fae46527 100644 --- a/packages/rulesets/src/spectral/test/delete-204-response.test.ts +++ b/packages/rulesets/src/spectral/test/delete-204-response.test.ts @@ -1,59 +1,59 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('Delete204Response'); - return linter; -}); + linter = await linterForRule("Delete204Response") + return linter +}) -test('Delete204Response should find errors', () => { +test("Delete204Response should find errors", () => { const myOpenApiDocument = { - swagger: '2.0', + swagger: "2.0", paths: { - '/api/Paths': { + "/api/Paths": { delete: { responses: { 200: { - description: 'Success', + description: "Success", }, }, }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - expect(results[0].path.join('.')).toBe('paths./api/Paths.delete.responses'); - }); -}); + expect(results.length).toBe(1) + expect(results[0].path.join(".")).toBe("paths./api/Paths.delete.responses") + }) +}) -test('Delete204Response should find no errors', () => { +test("Delete204Response should find no errors", () => { const myOpenApiDocument = { - swagger: '2.0', + swagger: "2.0", paths: { - '/api/Paths': { + "/api/Paths": { delete: { responses: { 204: { - description: 'Success', + description: "Success", }, }, }, }, - '/test202': { + "/test202": { delete: { responses: { 202: { - description: 'Success', + description: "Success", }, }, }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/delete-in-operation-name.test.ts b/packages/rulesets/src/spectral/test/delete-in-operation-name.test.ts index 4fa26495d..9164e0740 100644 --- a/packages/rulesets/src/spectral/test/delete-in-operation-name.test.ts +++ b/packages/rulesets/src/spectral/test/delete-in-operation-name.test.ts @@ -1,12 +1,12 @@ -import {Spectral} from "@stoplight/spectral-core"; -import linterForRule from "./utils"; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter: Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule("DeleteInOperationName"); - return linter; -}); + linter = await linterForRule("DeleteInOperationName") + return linter +}) test("DeleteInOperationName should find errors", () => { const myOpenApiDocument = { @@ -23,12 +23,12 @@ test("DeleteInOperationName should find errors", () => { }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - expect(results[0].path.join(".")).toBe("paths./api/Paths.delete.operationId"); - }); -}); + expect(results.length).toBe(1) + expect(results[0].path.join(".")).toBe("paths./api/Paths.delete.operationId") + }) +}) test("DeleteInOperationName should find no errors", () => { const myOpenApiDocument = { @@ -45,8 +45,8 @@ test("DeleteInOperationName should find no errors", () => { }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/delete-must-not-have-request-body.test.ts b/packages/rulesets/src/spectral/test/delete-must-not-have-request-body.test.ts index b4a5e7c55..d3f4396e6 100644 --- a/packages/rulesets/src/spectral/test/delete-must-not-have-request-body.test.ts +++ b/packages/rulesets/src/spectral/test/delete-must-not-have-request-body.test.ts @@ -1,12 +1,12 @@ -import {Spectral} from "@stoplight/spectral-core"; -import linterForRule from "./utils"; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter: Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule("DeleteMustNotHaveRequestBody"); - return linter; -}); + linter = await linterForRule("DeleteMustNotHaveRequestBody") + return linter +}) test("DeleteMustNotHaveRequestBody should find errors when body is specified with a delete", () => { const myOpenApiDocument = { @@ -17,9 +17,9 @@ test("DeleteMustNotHaveRequestBody should find errors when body is specified wit operationId: "Noun_Delete", parameters: [ { - name: 'body', - in: 'body', - type: 'string', + name: "body", + in: "body", + type: "string", required: true, }, ], @@ -31,12 +31,12 @@ test("DeleteMustNotHaveRequestBody should find errors when body is specified wit }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - expect(results[0].path.join(".")).toBe("paths./api/Paths.delete.parameters.0"); - }); -}); + expect(results.length).toBe(1) + expect(results[0].path.join(".")).toBe("paths./api/Paths.delete.parameters.0") + }) +}) test("DeleteMustNotHaveRequestBody should find no errors when body is not specified with a delete", () => { const myOpenApiDocument = { @@ -53,8 +53,8 @@ test("DeleteMustNotHaveRequestBody should find no errors when body is not specif }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/descriptive-description-required.test.ts b/packages/rulesets/src/spectral/test/descriptive-description-required.test.ts index 3b9dbf164..1c99a9b7f 100644 --- a/packages/rulesets/src/spectral/test/descriptive-description-required.test.ts +++ b/packages/rulesets/src/spectral/test/descriptive-description-required.test.ts @@ -1,72 +1,71 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('DescriptiveDescriptionRequired'); - return linter; -}); + linter = await linterForRule("DescriptiveDescriptionRequired") + return linter +}) -test('DescriptiveDescriptionRequired should find errors', () => { +test("DescriptiveDescriptionRequired should find errors", () => { const myOpenApiDocument = { - swagger: '2.0', + swagger: "2.0", paths: { - '/api/Paths': { + "/api/Paths": { parameters: [ { - name: 'version', - description: '', //Covered by ParameterDescription rule. + name: "version", + description: "", //Covered by ParameterDescription rule. }, ], get: { parameters: [ { - name: 'param1', - description: ' ', - } + name: "param1", + description: " ", + }, ], }, post: { parameters: [ { - name: 'param1', - description: 'Test', - } + name: "param1", + description: "Test", + }, ], }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - }); -}); + expect(results.length).toBe(1) + }) +}) -test('DescriptiveDescriptionRequired should find no errors', () => { +test("DescriptiveDescriptionRequired should find no errors", () => { const myOpenApiDocument = { - swagger: '2.0', + swagger: "2.0", paths: { - '/api/Paths': { + "/api/Paths": { parameters: [ { - name: 'version', - description: 'Hello', + name: "version", + description: "Hello", }, ], get: { parameters: [ { - name: 'param1', - description: ' Test', - } + name: "param1", + description: " Test", + }, ], }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); - + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/enum-insteadof-boolean.test.ts b/packages/rulesets/src/spectral/test/enum-insteadof-boolean.test.ts index a84f626d9..f76715afe 100644 --- a/packages/rulesets/src/spectral/test/enum-insteadof-boolean.test.ts +++ b/packages/rulesets/src/spectral/test/enum-insteadof-boolean.test.ts @@ -1,68 +1,62 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('EnumInsteadOfBoolean'); - return linter; -}); + linter = await linterForRule("EnumInsteadOfBoolean") + return linter +}) -test('EnumInsteadOfBoolean should find errors', () => { +test("EnumInsteadOfBoolean should find errors", () => { const myOpenApiDocument = { swagger: "2.0", info: { title: "Boolean properties not recommended in models", description: "Some documentation.", - version: "2017-02-08" + version: "2017-02-08", }, host: "management.azure.com", - schemes: [ - "https" - ], + schemes: ["https"], basePath: "/", - produces: [ - "application/json" - ], - consumes: [ - "application/json" - ], + produces: ["application/json"], + consumes: ["application/json"], paths: { - "/foo/{boolparam}": { - post: { - operationId: "PostFoo", - summary: "Foo path", - description: "Foo operation", - parameters: [ - { - in: "body", - name: "fooPost", - schema: { - type: "boolean", - description: "A foo boolean" - }, - description: "Foo body parameter" + "/foo/{boolparam}": { + post: { + operationId: "PostFoo", + summary: "Foo path", + description: "Foo operation", + parameters: [ + { + in: "body", + name: "fooPost", + schema: { + type: "boolean", + description: "A foo boolean", }, - { - name: "boolparam", - in: "path", - require: true, + description: "Foo body parameter", + }, + { + name: "boolparam", + in: "path", + require: true, + type: "boolean", + description: "A boolean param defined without schema", + }, + ], + responses: { + default: { + description: "Unexpected error", + schema: { type: "boolean", - description: "A boolean param defined without schema" - } - ], - responses: { - default: { - description: "Unexpected error", - schema: { - type: "boolean", - description: "A foo boolean" - } - } - } - } - } + description: "A foo boolean", + }, + }, + }, + }, }, + }, definitions: { Test1: { description: "Property for foo path 1", @@ -70,14 +64,16 @@ test('EnumInsteadOfBoolean should find errors', () => { nameAvailable: { readOnly: true, type: "boolean", - description: "Gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or invalid and cannot be used." + description: + "Gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or invalid and cannot be used.", }, anotherProp: { readOnly: true, type: "boolean", - description: "Gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or invalid and cannot be used." - } - } + description: + "Gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or invalid and cannot be used.", + }, + }, }, parameters: { SubscriptionIdParameter: { @@ -85,72 +81,66 @@ test('EnumInsteadOfBoolean should find errors', () => { in: "path", required: true, type: "string", - description: "test subscription id" + description: "test subscription id", }, ApiVersion: { name: "api-version", in: "path", required: true, type: "string", - description: "test api version" - } - } - } - }; + description: "test api version", + }, + }, + }, + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(5); - expect(results[0].path.join('.')).toBe('paths./foo/{boolparam}.post.parameters.0.schema'); - }); -}); + expect(results.length).toBe(5) + expect(results[0].path.join(".")).toBe("paths./foo/{boolparam}.post.parameters.0.schema") + }) +}) -test('DefaultInEnum should find no errors', () => { +test("DefaultInEnum should find no errors", () => { const myOpenApiDocument = { swagger: "2.0", info: { title: "Boolean properties not recommended in models", description: "Some documentation.", - version: "2017-02-08" + version: "2017-02-08", }, host: "management.azure.com", - schemes: [ - "https" - ], + schemes: ["https"], basePath: "/", - produces: [ - "application/json" - ], - consumes: [ - "application/json" - ], + produces: ["application/json"], + consumes: ["application/json"], paths: { - "/foo/{boolparam}": { - post: { - operationId: "PostFoo", - summary: "Foo path", - description: "Foo operation", - parameters: [ - { - in: "body", - name: "fooPost", - schema: { - type: "string", - description: "A foo boolean" - }, - description: "Foo body parameter" - } - ], - responses: { - default: { - description: "Unexpected error", - schema: { - type: "string", - description: "A foo boolean" - } - } - } - } - } + "/foo/{boolparam}": { + post: { + operationId: "PostFoo", + summary: "Foo path", + description: "Foo operation", + parameters: [ + { + in: "body", + name: "fooPost", + schema: { + type: "string", + description: "A foo boolean", + }, + description: "Foo body parameter", + }, + ], + responses: { + default: { + description: "Unexpected error", + schema: { + type: "string", + description: "A foo boolean", + }, + }, + }, + }, }, + }, definitions: { Test1: { description: "Property for foo path 1", @@ -158,9 +148,10 @@ test('DefaultInEnum should find no errors', () => { anotherProp: { readOnly: true, type: "string", - description: "Gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or invalid and cannot be used." - } - } + description: + "Gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or invalid and cannot be used.", + }, + }, }, parameters: { SubscriptionIdParameter: { @@ -168,19 +159,19 @@ test('DefaultInEnum should find no errors', () => { in: "path", required: true, type: "string", - description: "test subscription id" + description: "test subscription id", }, ApiVersion: { name: "api-version", in: "path", required: true, type: "string", - description: "test api version" - } - } - } - }; + description: "test api version", + }, + }, + }, + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); \ No newline at end of file + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/error-response.test.ts b/packages/rulesets/src/spectral/test/error-response.test.ts index 111350c18..d6f62b306 100644 --- a/packages/rulesets/src/spectral/test/error-response.test.ts +++ b/packages/rulesets/src/spectral/test/error-response.test.ts @@ -1,44 +1,44 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('ErrorResponse'); - return linter; -}); + linter = await linterForRule("ErrorResponse") + return linter +}) -test('ErrorResponse should find errors', () => { +test("ErrorResponse should find errors", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/api/Paths': { + "/api/Paths": { get: { responses: { 200: { - description: 'Success', + description: "Success", }, // Error response should contain a x-ms-error-code header. // Error response schema must be an object schema. 400: { - description: 'Bad request', + description: "Bad request", schema: { - type: 'string', + type: "string", }, }, // Error response should contain x-ms-error-response. // Error response schema should contain an object property named `error`. 401: { - description: 'Unauthorized', + description: "Unauthorized", headers: { - 'x-ms-error-code': { - type: 'string', + "x-ms-error-code": { + type: "string", }, }, schema: { properties: { code: { - type: 'string', + type: "string", }, }, }, @@ -46,144 +46,144 @@ test('ErrorResponse should find errors', () => { // The `error` property in the error response schema should be required. // Error schema should define `code` and `message` properties as required. 403: { - description: 'Forbidden', + description: "Forbidden", headers: { - 'x-ms-error-code': { - type: 'string', + "x-ms-error-code": { + type: "string", }, }, schema: { properties: { error: { - type: 'object', + type: "object", properties: { code: { - type: 'string', + type: "string", }, message: { - type: 'string', + type: "string", }, }, }, }, }, - 'x-ms-error-response': true, + "x-ms-error-response": true, }, // Error schema should contain `code` property. // The `message` property of error schema should be type `string`. // Error schema should define `code` property as required. 409: { - description: 'Conflict', + description: "Conflict", headers: { - 'x-ms-error-code': { - type: 'string', + "x-ms-error-code": { + type: "string", }, }, schema: { properties: { error: { - type: 'object', + type: "object", properties: { message: { - description: 'The message', + description: "The message", }, }, - required: ['message'], + required: ["message"], }, }, - required: ['error'], + required: ["error"], }, - 'x-ms-error-response': true, + "x-ms-error-response": true, }, // Error schema should contain `message` property. // The `code` property of error schema should be type `string`. // Error schema should define `message` property as required. 412: { - description: 'Precondition Failed', + description: "Precondition Failed", headers: { - 'x-ms-error-code': { - type: 'string', + "x-ms-error-code": { + type: "string", }, }, schema: { properties: { error: { - type: 'object', + type: "object", properties: { code: { - type: 'integer', + type: "integer", }, }, - required: ['code'], + required: ["code"], }, }, - required: ['error'], + required: ["error"], }, - 'x-ms-error-response': true, + "x-ms-error-response": true, }, }, }, }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(13); - expect(results[0].path.join('.')).toBe('paths./api/Paths.get.responses.400'); - expect(results[0].message).toBe('Error response should contain a x-ms-error-code header.'); - expect(results[1].path.join('.')).toBe('paths./api/Paths.get.responses.400'); - expect(results[1].message).toBe('Error response should contain x-ms-error-response.'); - expect(results[2].path.join('.')).toBe('paths./api/Paths.get.responses.400.schema'); - expect(results[2].message).toBe('Error response schema must be an object schema.'); - expect(results[3].path.join('.')).toBe('paths./api/Paths.get.responses.401'); - expect(results[3].message).toBe('Error response should contain x-ms-error-response.'); - expect(results[4].path.join('.')).toBe('paths./api/Paths.get.responses.401.schema.properties'); - expect(results[4].message).toBe('Error response schema should contain an object property named `error`.'); - expect(results[5].path.join('.')).toBe('paths./api/Paths.get.responses.403.schema'); - expect(results[5].message).toBe('The `error` property in the error response schema should be required.'); - expect(results[6].path.join('.')).toBe('paths./api/Paths.get.responses.403.schema.properties.error'); - expect(results[6].message).toBe('Error schema should define `code` and `message` properties as required.'); - expect(results[7].path.join('.')).toBe('paths./api/Paths.get.responses.409.schema.properties.error.properties'); - expect(results[7].message).toBe('Error schema should contain `code` property.'); - expect(results[8].path.join('.')).toBe('paths./api/Paths.get.responses.409.schema.properties.error.properties.message'); - expect(results[8].message).toBe('The `message` property of error schema should be type `string`.'); - expect(results[9].path.join('.')).toBe('paths./api/Paths.get.responses.409.schema.properties.error.required'); - expect(results[9].message).toBe('Error schema should define `code` property as required.'); - expect(results[10].path.join('.')).toBe('paths./api/Paths.get.responses.412.schema.properties.error.properties'); - expect(results[10].message).toBe('Error schema should contain `message` property.'); - expect(results[11].path.join('.')).toBe('paths./api/Paths.get.responses.412.schema.properties.error.properties.code.type'); - expect(results[11].message).toBe('The `code` property of error schema should be type `string`.'); - expect(results[12].path.join('.')).toBe('paths./api/Paths.get.responses.412.schema.properties.error.required'); - expect(results[12].message).toBe('Error schema should define `message` property as required.'); - }); -}); + expect(results.length).toBe(13) + expect(results[0].path.join(".")).toBe("paths./api/Paths.get.responses.400") + expect(results[0].message).toBe("Error response should contain a x-ms-error-code header.") + expect(results[1].path.join(".")).toBe("paths./api/Paths.get.responses.400") + expect(results[1].message).toBe("Error response should contain x-ms-error-response.") + expect(results[2].path.join(".")).toBe("paths./api/Paths.get.responses.400.schema") + expect(results[2].message).toBe("Error response schema must be an object schema.") + expect(results[3].path.join(".")).toBe("paths./api/Paths.get.responses.401") + expect(results[3].message).toBe("Error response should contain x-ms-error-response.") + expect(results[4].path.join(".")).toBe("paths./api/Paths.get.responses.401.schema.properties") + expect(results[4].message).toBe("Error response schema should contain an object property named `error`.") + expect(results[5].path.join(".")).toBe("paths./api/Paths.get.responses.403.schema") + expect(results[5].message).toBe("The `error` property in the error response schema should be required.") + expect(results[6].path.join(".")).toBe("paths./api/Paths.get.responses.403.schema.properties.error") + expect(results[6].message).toBe("Error schema should define `code` and `message` properties as required.") + expect(results[7].path.join(".")).toBe("paths./api/Paths.get.responses.409.schema.properties.error.properties") + expect(results[7].message).toBe("Error schema should contain `code` property.") + expect(results[8].path.join(".")).toBe("paths./api/Paths.get.responses.409.schema.properties.error.properties.message") + expect(results[8].message).toBe("The `message` property of error schema should be type `string`.") + expect(results[9].path.join(".")).toBe("paths./api/Paths.get.responses.409.schema.properties.error.required") + expect(results[9].message).toBe("Error schema should define `code` property as required.") + expect(results[10].path.join(".")).toBe("paths./api/Paths.get.responses.412.schema.properties.error.properties") + expect(results[10].message).toBe("Error schema should contain `message` property.") + expect(results[11].path.join(".")).toBe("paths./api/Paths.get.responses.412.schema.properties.error.properties.code.type") + expect(results[11].message).toBe("The `code` property of error schema should be type `string`.") + expect(results[12].path.join(".")).toBe("paths./api/Paths.get.responses.412.schema.properties.error.required") + expect(results[12].message).toBe("Error schema should define `message` property as required.") + }) +}) -test('ErrorResponse should find no errors', () => { +test("ErrorResponse should find no errors", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/api/Paths': { + "/api/Paths": { get: { responses: { 200: { - description: 'Success', + description: "Success", }, 400: { - description: 'Bad request', + description: "Bad request", headers: { - 'x-ms-error-code': { - type: 'string', + "x-ms-error-code": { + type: "string", }, }, schema: { - type: 'object', + type: "object", properties: { error: { - $ref: '#/definitions/ErrorDetail', + $ref: "#/definitions/ErrorDetail", }, }, - required: ['error'], + required: ["error"], }, - 'x-ms-error-response': true, + "x-ms-error-response": true, }, }, }, @@ -191,32 +191,32 @@ test('ErrorResponse should find no errors', () => { }, definitions: { ErrorDetail: { - type: 'object', + type: "object", properties: { code: { - type: 'string', + type: "string", }, message: { - type: 'string', + type: "string", }, target: { - type: 'string', + type: "string", }, details: { - type: 'array', + type: "array", items: { - $ref: '#/definitions/ErrorDetail', + $ref: "#/definitions/ErrorDetail", }, }, innererror: { - $ref: '#/definitions/ErrorDetail', + $ref: "#/definitions/ErrorDetail", }, }, - required: ['code', 'message'], + required: ["code", "message"], }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/get-in-operation-name.test.ts b/packages/rulesets/src/spectral/test/get-in-operation-name.test.ts index 1305e89fb..df48ae9aa 100644 --- a/packages/rulesets/src/spectral/test/get-in-operation-name.test.ts +++ b/packages/rulesets/src/spectral/test/get-in-operation-name.test.ts @@ -1,12 +1,12 @@ -import {Spectral} from "@stoplight/spectral-core"; -import linterForRule from "./utils"; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter: Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule("GetInOperationName"); - return linter; -}); + linter = await linterForRule("GetInOperationName") + return linter +}) test("GetInOperationName should find errors", () => { const myOpenApiDocument = { @@ -23,12 +23,12 @@ test("GetInOperationName should find errors", () => { }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - expect(results[0].path.join(".")).toBe("paths./api/Paths.get.operationId"); - }); -}); + expect(results.length).toBe(1) + expect(results[0].path.join(".")).toBe("paths./api/Paths.get.operationId") + }) +}) test("GetInOperationName should find no errors", () => { const myOpenApiDocument = { @@ -45,8 +45,8 @@ test("GetInOperationName should find no errors", () => { }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/get-must-not-have-request-body.test.ts b/packages/rulesets/src/spectral/test/get-must-not-have-request-body.test.ts index a3a8b9964..13117926f 100644 --- a/packages/rulesets/src/spectral/test/get-must-not-have-request-body.test.ts +++ b/packages/rulesets/src/spectral/test/get-must-not-have-request-body.test.ts @@ -1,12 +1,12 @@ -import {Spectral} from "@stoplight/spectral-core"; -import linterForRule from "./utils"; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter: Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule("GetMustNotHaveRequestBody"); - return linter; -}); + linter = await linterForRule("GetMustNotHaveRequestBody") + return linter +}) test("GetMustNotHaveRequestBody should find errors when body is specified with a get", () => { const myOpenApiDocument = { @@ -17,9 +17,9 @@ test("GetMustNotHaveRequestBody should find errors when body is specified with a operationId: "Noun_Get", parameters: [ { - name: 'body', - in: 'body', - type: 'string', + name: "body", + in: "body", + type: "string", required: true, }, ], @@ -31,12 +31,12 @@ test("GetMustNotHaveRequestBody should find errors when body is specified with a }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - expect(results[0].path.join(".")).toBe("paths./api/Paths.get.parameters.0"); - }); -}); + expect(results.length).toBe(1) + expect(results[0].path.join(".")).toBe("paths./api/Paths.get.parameters.0") + }) +}) test("GetMustNotHaveRequestBody should find no errors when body is not specified with a get", () => { const myOpenApiDocument = { @@ -53,8 +53,8 @@ test("GetMustNotHaveRequestBody should find no errors when body is not specified }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/header-disallowed.test.ts b/packages/rulesets/src/spectral/test/header-disallowed.test.ts index ac70fc9c5..e22f1254e 100644 --- a/packages/rulesets/src/spectral/test/header-disallowed.test.ts +++ b/packages/rulesets/src/spectral/test/header-disallowed.test.ts @@ -1,38 +1,38 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('HeaderDisallowed'); - return linter; -}); + linter = await linterForRule("HeaderDisallowed") + return linter +}) -test('HeaderDisallowed should find errors', () => { +test("HeaderDisallowed should find errors", () => { // Test parameter names in 3 different places: // 1. parameter at path level // 2. inline parameter at operation level // 3. referenced parameter at operation level const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/test1': { + "/test1": { parameters: [ { - name: 'Authorization', - in: 'header', - type: 'string', + name: "Authorization", + in: "header", + type: "string", }, ], get: { parameters: [ { - name: 'Content-Type', - in: 'header', - type: 'string', + name: "Content-Type", + in: "header", + type: "string", }, { - $ref: '#/parameters/AcceptParam', + $ref: "#/parameters/AcceptParam", }, ], }, @@ -40,51 +40,51 @@ test('HeaderDisallowed should find errors', () => { }, parameters: { AcceptParam: { - name: 'Accept', - in: 'header', - type: 'string', + name: "Accept", + in: "header", + type: "string", }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(3); - expect(results[0].path.join('.')).toBe('paths./test1.parameters.0.name'); - expect(results[1].path.join('.')).toBe('paths./test1.get.parameters.0.name'); - expect(results[2].path.join('.')).toBe('paths./test1.get.parameters.1.name'); - }); -}); + expect(results.length).toBe(3) + expect(results[0].path.join(".")).toBe("paths./test1.parameters.0.name") + expect(results[1].path.join(".")).toBe("paths./test1.get.parameters.0.name") + expect(results[2].path.join(".")).toBe("paths./test1.get.parameters.1.name") + }) +}) -test('HeaderDisallowed should find no errors', () => { +test("HeaderDisallowed should find no errors", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/test1': { + "/test1": { parameters: [ { - name: 'Authorization', - in: 'query', - type: 'string', + name: "Authorization", + in: "query", + type: "string", }, { - name: 'Content-Encoding', - in: 'header', - type: 'string', + name: "Content-Encoding", + in: "header", + type: "string", }, ], get: { parameters: [ { - name: 'Accept', - in: 'query', - type: 'string', + name: "Accept", + in: "query", + type: "string", }, { - name: 'Accept-Language', - in: 'header', - type: 'string', + name: "Accept-Language", + in: "header", + type: "string", }, { - $ref: '#/parameters/RequestIdParam', + $ref: "#/parameters/RequestIdParam", }, ], }, @@ -92,13 +92,13 @@ test('HeaderDisallowed should find no errors', () => { }, parameters: { RequestIdParam: { - name: 'x-ms-request-id', - in: 'header', - type: 'string', + name: "x-ms-request-id", + in: "header", + type: "string", }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/host-parameters.test.ts b/packages/rulesets/src/spectral/test/host-parameters.test.ts index bebe22e41..5852f163f 100644 --- a/packages/rulesets/src/spectral/test/host-parameters.test.ts +++ b/packages/rulesets/src/spectral/test/host-parameters.test.ts @@ -1,72 +1,72 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('HostParametersValidation'); - return linter; -}); + linter = await linterForRule("HostParametersValidation") + return linter +}) -test('host parameter validation should find errors', () => { +test("host parameter validation should find errors", () => { const myOpenApiDocument = { - swagger: '2.0', + swagger: "2.0", "x-ms-parameterized-host": { - "hostTemplate": "{baseUrl}", - "positionInOperation": "last", - "useSchemePrefix": false, - "parameters": [ + hostTemplate: "{baseUrl}", + positionInOperation: "last", + useSchemePrefix: false, + parameters: [ { - "$ref": "#/parameters/BaseUrl" - } - ] + $ref: "#/parameters/BaseUrl", + }, + ], }, - "parameters":{ - "BaseUrl": { - "name": "baseUrl", - "required": true, - "type": "string", - "in": "path", + parameters: { + BaseUrl: { + name: "baseUrl", + required: true, + type: "string", + in: "path", "x-ms-skip-url-encoding": true, - "x-ms-parameter-location": "client" - } - } - }; + "x-ms-parameter-location": "client", + }, + }, + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(2); - expect(results[0].path.join('.')).toBe('x-ms-parameterized-host.parameters.0'); - expect(results[0].message).toBe('The host parameter must be called \'endpoint\'.') - expect(results[1].path.join('.')).toBe('x-ms-parameterized-host.parameters.0'); + expect(results.length).toBe(2) + expect(results[0].path.join(".")).toBe("x-ms-parameterized-host.parameters.0") + expect(results[0].message).toBe("The host parameter must be called 'endpoint'.") + expect(results[1].path.join(".")).toBe("x-ms-parameterized-host.parameters.0") expect(results[1].message).toBe("The host parameter must be typed \"type 'string', format 'url'\".") - }); -}); + }) +}) -test('host parameters validation should find no errors', () => { +test("host parameters validation should find no errors", () => { const myOpenApiDocument = { - swagger: '2.0', + swagger: "2.0", "x-ms-parameterized-host": { - "hostTemplate": "{endpoint}", - "positionInOperation": "last", - "useSchemePrefix": false, - "parameters": [ + hostTemplate: "{endpoint}", + positionInOperation: "last", + useSchemePrefix: false, + parameters: [ { - "$ref": "#/parameters/Endpoint" - } - ] + $ref: "#/parameters/Endpoint", + }, + ], + }, + parameters: { + Endpoint: { + name: "endpoint", + required: true, + type: "string", + format: "url", + in: "path", + "x-ms-skip-url-encoding": true, + "x-ms-parameter-location": "client", + }, }, - "parameters":{ - "Endpoint": { - "name": "endpoint", - "required": true, - "type": "string", - "format": "url", - "in": "path", - "x-ms-skip-url-encoding": true, - "x-ms-parameter-location": "client" - } - } - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/https-supported-scheme.test.ts b/packages/rulesets/src/spectral/test/https-supported-scheme.test.ts index 0fdc4bdf3..e3bef261c 100644 --- a/packages/rulesets/src/spectral/test/https-supported-scheme.test.ts +++ b/packages/rulesets/src/spectral/test/https-supported-scheme.test.ts @@ -1,63 +1,59 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('HttpsSupportedScheme'); - return linter; -}); + linter = await linterForRule("HttpsSupportedScheme") + return linter +}) -test('HttpsSupportedScheme should find errors', () => { +test("HttpsSupportedScheme should find errors", () => { const myOpenApiDocument = { swagger: "2.0", - schemes: [ - "http", - "https" - ], + schemes: ["http", "https"], info: { title: "Consumes has an unsupported MIME type", - description: "Use these APIs to manage Azure Websites resources through the Azure Resource Manager. All task operations conform to the HTTP/1.1 protocol specification and each operation returns an x-ms-request-id header that can be used to obtain information about the request. You must make sure that requests made to these resources are secure. For more information, see https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx.", - version: "2014-04-01-preview" + description: + "Use these APIs to manage Azure Websites resources through the Azure Resource Manager. All task operations conform to the HTTP/1.1 protocol specification and each operation returns an x-ms-request-id header that can be used to obtain information about the request. You must make sure that requests made to these resources are secure. For more information, see https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx.", + version: "2014-04-01-preview", }, - definitions:{ - AuthorizationServerCollection:{ - definitions:{ - AuthorizationServerCollection:{ + definitions: { + AuthorizationServerCollection: { + definitions: { + AuthorizationServerCollection: { externalDocs: { - url: "https://msdn.microsoft.com" + url: "https://msdn.microsoft.com", }, - } - } - } - } - }; + }, + }, + }, + }, + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - }); -}); + expect(results.length).toBe(1) + }) +}) -test('HttpsSupportedScheme should find no errors', () => { +test("HttpsSupportedScheme should find no errors", () => { const myOpenApiDocument = { swagger: "2.0", - schemes: [ - "https" - ], + schemes: ["https"], info: { title: "Consumes has an unsupported MIME type", - description: "Use these REST APIs for performing operations on Backend entity in Azure API Management deployment. The Backend entity in API Management represents a backend service that is configured to skip certification chain validation when using a self-signed certificate to test mutual certificate authentication.", - version: "2014-04-01-preview" + description: + "Use these REST APIs for performing operations on Backend entity in Azure API Management deployment. The Backend entity in API Management represents a backend service that is configured to skip certification chain validation when using a self-signed certificate to test mutual certificate authentication.", + version: "2014-04-01-preview", }, paths: { "/instance": { - "get": { + get: { operationId: "Instances_GetMetadata", - } - } - } - }; + }, + }, + }, + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); - + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/jsconfig.json b/packages/rulesets/src/spectral/test/jsconfig.json index ef7b4406b..45c812050 100644 --- a/packages/rulesets/src/spectral/test/jsconfig.json +++ b/packages/rulesets/src/spectral/test/jsconfig.json @@ -1,7 +1,5 @@ { "typeAcquisition": { - "include": [ - "jest" - ] + "include": ["jest"] } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/spectral/test/list-in-operation-name.test.ts b/packages/rulesets/src/spectral/test/list-in-operation-name.test.ts index e8db6da15..50a7aa583 100644 --- a/packages/rulesets/src/spectral/test/list-in-operation-name.test.ts +++ b/packages/rulesets/src/spectral/test/list-in-operation-name.test.ts @@ -1,170 +1,213 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('ListInOperationName'); - return linter; -}); + linter = await linterForRule("ListInOperationName") + return linter +}) -test('ListInOperationName should find invalid operationId', () => { +test("ListInOperationName should find invalid operationId", () => { const myOpenApiDocument = { swagger: "2.0", - schemes: [ - "https" - ], + schemes: ["https"], info: { title: "Consumes has an unsupported MIME type", - description: "Use these APIs to manage Azure Websites resources through the Azure Resource Manager. All task operations conform to the HTTP/1.1 protocol specification and each operation returns an x-ms-request-id header that can be used to obtain information about the request. You must make sure that requests made to these resources are secure. For more information, see https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx.", - version: "2014-04-01-preview" + description: + "Use these APIs to manage Azure Websites resources through the Azure Resource Manager. All task operations conform to the HTTP/1.1 protocol specification and each operation returns an x-ms-request-id header that can be used to obtain information about the request. You must make sure that requests made to these resources are secure. For more information, see https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx.", + version: "2014-04-01-preview", }, - paths:{ - "/some/test/path":{ - get:{ - operationId:"Extensions_Get", + paths: { + "/some/test/path": { + get: { + operationId: "Extensions_Get", "x-ms-pageable": { - nextLinkName: "nextLink" + nextLinkName: "nextLink", }, - } + }, }, - "/some/test/path2":{ - post:{ - operationId:"_List", + "/some/test/path2": { + post: { + operationId: "_List", "x-ms-pageable": { - nextLinkName: "nextLink" + nextLinkName: "nextLink", }, }, }, - "/some/test/path3":{ - get:{ - operationId:"ExtensionsList", + "/some/test/path3": { + get: { + operationId: "ExtensionsList", "x-ms-pageable": { - nextLinkName: "nextLink" + nextLinkName: "nextLink", }, }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(3); - }); -}); + expect(results.length).toBe(3) + }) +}) -test('ListInOperationName should find invalid operation id which response contains array.', () => { +test("ListInOperationName should find invalid operation id which response contains array.", () => { const myOpenApiDocument = { swagger: "2.0", - schemes: [ - "http", - "https" - ], + schemes: ["http", "https"], info: { title: "Consumes has an unsupported MIME type", - description: "Use these APIs to manage Azure Websites resources through the Azure Resource Manager. All task operations conform to the HTTP/1.1 protocol specification and each operation returns an x-ms-request-id header that can be used to obtain information about the request. You must make sure that requests made to these resources are secure. For more information, see https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx.", - version: "2014-04-01-preview" + description: + "Use these APIs to manage Azure Websites resources through the Azure Resource Manager. All task operations conform to the HTTP/1.1 protocol specification and each operation returns an x-ms-request-id header that can be used to obtain information about the request. You must make sure that requests made to these resources are secure. For more information, see https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx.", + version: "2014-04-01-preview", }, - paths:{ - "/some/test/path":{ - post:{ - operationId:"Extensions_Update", + paths: { + "/some/test/path": { + post: { + operationId: "Extensions_Update", "x-ms-pageable": { - nextLinkName: "nextLink" + nextLinkName: "nextLink", }, - responses:{ - "200":{ - "schema": { - "$ref": "#/definitions/BastionSessionDeleteResult" - } + responses: { + "200": { + schema: { + $ref: "#/definitions/BastionSessionDeleteResult", + }, }, - "default": { + default: { description: "The detailed error response.", schema: { - "$ref": "#/definitions/BastionSessionDeleteResult" - } - } - } - } - } + $ref: "#/definitions/BastionSessionDeleteResult", + }, + }, + }, + }, + }, }, - definitions:{ - BastionSessionDeleteResult:{ - properties:{ - value:{ - type: "array" - } - } - } - } - }; + definitions: { + BastionSessionDeleteResult: { + properties: { + value: { + type: "array", + }, + }, + }, + }, + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - }); -}); + expect(results.length).toBe(1) + }) +}) -test('ListInOperationName should pass check', () => { +test("ListInOperationName should pass check", () => { const myOpenApiDocument = { swagger: "2.0", - schemes: [ - "https" - ], + schemes: ["https"], info: { title: "Consumes has an unsupported MIME type", - description: "Use these REST APIs for performing operations on Backend entity in Azure API Management deployment. The Backend entity in API Management represents a backend service that is configured to skip certification chain validation when using a self-signed certificate to test mutual certificate authentication.", - version: "2014-04-01-preview" + description: + "Use these REST APIs for performing operations on Backend entity in Azure API Management deployment. The Backend entity in API Management represents a backend service that is configured to skip certification chain validation when using a self-signed certificate to test mutual certificate authentication.", + version: "2014-04-01-preview", }, paths: { "/instance": { - "get": { + get: { operationId: "Instances_GetMetadata", - } + }, }, - "/some/test/path1":{ - get:{ - operationId:"List", + "/some/test/path1": { + get: { + operationId: "List", "x-ms-pageable": { - nextLinkName: "nextLink" + nextLinkName: "nextLink", }, }, }, - "/some/test/path2":{ - get:{ - operationId:"Extension_List", + "/some/test/path2": { + get: { + operationId: "Extension_List", "x-ms-pageable": { - nextLinkName: "nextLink" + nextLinkName: "nextLink", }, }, }, - "/some/test/path3":{ - post:{ - operationId:"Extension_ListByTest", - responses:{ - "200":{ - "schema": { - "$ref": "#/definitions/BastionSessionDeleteResult" - } + "/some/test/path3": { + post: { + operationId: "Extension_ListByTest", + responses: { + "200": { + schema: { + $ref: "#/definitions/BastionSessionDeleteResult", + }, }, - "default": { + default: { description: "The detailed error response.", schema: { - "$ref": "#/definitions/BastionSessionDeleteResult" - } - } - } + $ref: "#/definitions/BastionSessionDeleteResult", + }, + }, + }, }, }, }, - definitions:{ - BastionSessionDeleteResult:{ - properties:{ - value:{ - type: "array" - } - } - } - } - }; + definitions: { + BastionSessionDeleteResult: { + properties: { + value: { + type: "array", + }, + }, + }, + }, + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) +test("ListInOperationName should pass for operation returns normal model with value array", () => { + const myOpenApiDocument = { + swagger: "2.0", + schemes: ["https"], + info: { + title: "Consumes has an unsupported MIME type", + description: + "Use these REST APIs for performing operations on Backend entity in Azure API Management deployment. The Backend entity in API Management represents a backend service that is configured to skip certification chain validation when using a self-signed certificate to test mutual certificate authentication.", + version: "2014-04-01-preview", + }, + paths: { + "/some/test/path3": { + get: { + operationId: "Extension_Test", + responses: { + "200": { + schema: { + $ref: "#/definitions/BastionSessionDeleteResult", + }, + }, + default: { + description: "The detailed error response.", + schema: { + $ref: "#/definitions/BastionSessionDeleteResult", + }, + }, + }, + }, + }, + }, + definitions: { + BastionSessionDeleteResult: { + properties: { + value: { + type: "array", + }, + foo: { + type: "string", + }, + }, + }, + }, + } + return linter.run(myOpenApiDocument).then((results) => { + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/location-must-have-xms-mutability.test.ts b/packages/rulesets/src/spectral/test/location-must-have-xms-mutability.test.ts index 2e69e7616..44f33bbea 100644 --- a/packages/rulesets/src/spectral/test/location-must-have-xms-mutability.test.ts +++ b/packages/rulesets/src/spectral/test/location-must-have-xms-mutability.test.ts @@ -1,93 +1,87 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('LocationMustHaveXmsMutability'); - return linter; -}); + linter = await linterForRule("LocationMustHaveXmsMutability") + return linter +}) -test('LocationMustHaveXmsMutability should find errors', () => { +test("LocationMustHaveXmsMutability should find errors", () => { const myOpenApiDocument = { swagger: "2.0", info: { title: "Consumes has an unsupported MIME type", - description: "Use these APIs to manage Azure Websites resources through the Azure Resource Manager. All task operations conform to the HTTP/1.1 protocol specification and each operation returns an x-ms-request-id header that can be used to obtain information about the request. You must make sure that requests made to these resources are secure. For more information, see https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx.", - version: "2014-04-01-preview" + description: + "Use these APIs to manage Azure Websites resources through the Azure Resource Manager. All task operations conform to the HTTP/1.1 protocol specification and each operation returns an x-ms-request-id header that can be used to obtain information about the request. You must make sure that requests made to these resources are secure. For more information, see https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx.", + version: "2014-04-01-preview", }, - definitions:{ - AuthorizationServerCollection:{ + definitions: { + AuthorizationServerCollection: { properties: { location: { type: "string", description: "Resource location", - "x-ms-mutability": [ - "read" - ] + "x-ms-mutability": ["read"], }, - } + }, }, - ManagedResource:{ + ManagedResource: { properties: { location: { type: "string", description: "Resource location", - "x-ms-mutability": [ - "create" - ] + "x-ms-mutability": ["create"], }, - } + }, }, - Resource:{ + Resource: { properties: { location: { type: "string", - description: "Resource location" + description: "Resource location", }, - } + }, }, - ResourceWithoutArray:{ + ResourceWithoutArray: { properties: { location: { type: "string", description: "Resource location", - "x-ms-mutability": "create" + "x-ms-mutability": "create", }, - } - } - } - }; + }, + }, + }, + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(4); - }); -}); + expect(results.length).toBe(4) + }) +}) -test('LocationMustHaveXmsMutability should find no errors', () => { +test("LocationMustHaveXmsMutability should find no errors", () => { const myOpenApiDocument = { swagger: "2.0", info: { title: "Consumes has an unsupported MIME type", - description: "Use these APIs to manage Azure Websites resources through the Azure Resource Manager. All task operations conform to the HTTP/1.1 protocol specification and each operation returns an x-ms-request-id header that can be used to obtain information about the request. You must make sure that requests made to these resources are secure. For more information, see https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx.", - version: "2014-04-01-preview" + description: + "Use these APIs to manage Azure Websites resources through the Azure Resource Manager. All task operations conform to the HTTP/1.1 protocol specification and each operation returns an x-ms-request-id header that can be used to obtain information about the request. You must make sure that requests made to these resources are secure. For more information, see https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx.", + version: "2014-04-01-preview", }, - definitions:{ - AuthorizationServerCollection:{ + definitions: { + AuthorizationServerCollection: { properties: { location: { type: "string", description: "Resource location", - "x-ms-mutability": [ - "read", - "create" - ] + "x-ms-mutability": ["read", "create"], }, - } - } - } - }; + }, + }, + }, + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); - + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/long-running-operations-options-validator.test.ts b/packages/rulesets/src/spectral/test/long-running-operations-options-validator.test.ts index a2d73fa73..76a33e831 100644 --- a/packages/rulesets/src/spectral/test/long-running-operations-options-validator.test.ts +++ b/packages/rulesets/src/spectral/test/long-running-operations-options-validator.test.ts @@ -1,12 +1,12 @@ -import { Spectral } from "@stoplight/spectral-core"; -import linterForRule from "./utils"; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter: Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule("LongRunningOperationsOptionsValidator"); - return linter; -}); + linter = await linterForRule("LongRunningOperationsOptionsValidator") + return linter +}) test("LongRunningOperationsOptionsValidator should find errors", () => { const myOpenApiDocument = { @@ -44,12 +44,12 @@ test("LongRunningOperationsOptionsValidator should find errors", () => { }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - expect(results[0].path.join(".")).toBe("paths./api/Paths"); - }); -}); + expect(results.length).toBe(1) + expect(results[0].path.join(".")).toBe("paths./api/Paths") + }) +}) test("LongRunningOperationsOptionsValidator should find no errors", () => { const myOpenApiDocument = { @@ -90,8 +90,8 @@ test("LongRunningOperationsOptionsValidator should find no errors", () => { }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/long-running-response-status-code-data-plane.test.ts b/packages/rulesets/src/spectral/test/long-running-response-status-code-data-plane.test.ts index 11e961987..0cd03c372 100644 --- a/packages/rulesets/src/spectral/test/long-running-response-status-code-data-plane.test.ts +++ b/packages/rulesets/src/spectral/test/long-running-response-status-code-data-plane.test.ts @@ -1,12 +1,12 @@ -import { Spectral } from "@stoplight/spectral-core"; -import linterForRule from "./utils"; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter: Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule("LongRunningResponseStatusCodeDataPlane"); - return linter; -}); + linter = await linterForRule("LongRunningResponseStatusCodeDataPlane") + return linter +}) test("LongRunningResponseStatusCodeDataPlane should find errors in DELETE operation", () => { const myOpenApiDocument = { @@ -23,12 +23,12 @@ test("LongRunningResponseStatusCodeDataPlane should find errors in DELETE operat }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - expect(results[0].path.join(".")).toBe("paths./api/Paths.delete"); - }); -}); + expect(results.length).toBe(1) + expect(results[0].path.join(".")).toBe("paths./api/Paths.delete") + }) +}) test("LongRunningResponseStatusCodeDataPlane should find errors in POST operation", () => { const myOpenApiDocument = { @@ -45,12 +45,12 @@ test("LongRunningResponseStatusCodeDataPlane should find errors in POST operatio }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - expect(results[0].path.join(".")).toBe("paths./api/Paths.post"); - }); -}); + expect(results.length).toBe(1) + expect(results[0].path.join(".")).toBe("paths./api/Paths.post") + }) +}) test("LongRunningResponseStatusCodeDataPlane should find errors in PUT operation", () => { const myOpenApiDocument = { @@ -67,12 +67,12 @@ test("LongRunningResponseStatusCodeDataPlane should find errors in PUT operation }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - expect(results[0].path.join(".")).toBe("paths./api/Paths.put"); - }); -}); + expect(results.length).toBe(1) + expect(results[0].path.join(".")).toBe("paths./api/Paths.put") + }) +}) test("LongRunningResponseStatusCodeDataPlane should find errors in PATCH operation", () => { const myOpenApiDocument = { @@ -89,12 +89,12 @@ test("LongRunningResponseStatusCodeDataPlane should find errors in PATCH operati }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - expect(results[0].path.join(".")).toBe("paths./api/Paths.patch"); - }); -}); + expect(results.length).toBe(1) + expect(results[0].path.join(".")).toBe("paths./api/Paths.patch") + }) +}) test("LongRunningResponseStatusCodeDataPlane should find no errors in DELETE operation", () => { const myOpenApiDocument = { @@ -117,11 +117,11 @@ test("LongRunningResponseStatusCodeDataPlane should find no errors in DELETE ope }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) test("LongRunningResponseStatusCodeDataPlane should find no errors in POST operation", () => { const myOpenApiDocument = { @@ -147,11 +147,11 @@ test("LongRunningResponseStatusCodeDataPlane should find no errors in POST opera }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) test("LongRunningResponseStatusCodeDataPlane should find no errors in PUT operation", () => { const myOpenApiDocument = { @@ -174,11 +174,11 @@ test("LongRunningResponseStatusCodeDataPlane should find no errors in PUT operat }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) test("LongRunningResponseStatusCodeDataPlane should find no errors in PATCH operation", () => { const myOpenApiDocument = { @@ -201,8 +201,8 @@ test("LongRunningResponseStatusCodeDataPlane should find no errors in PATCH oper }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/long-running-response-status-code.test.ts b/packages/rulesets/src/spectral/test/long-running-response-status-code.test.ts index 8ff2dcc4b..b2c4d6b6e 100644 --- a/packages/rulesets/src/spectral/test/long-running-response-status-code.test.ts +++ b/packages/rulesets/src/spectral/test/long-running-response-status-code.test.ts @@ -1,12 +1,12 @@ -import { Spectral } from "@stoplight/spectral-core"; -import linterForRule from "./utils"; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter: Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule("LongRunningResponseStatusCode"); - return linter; -}); + linter = await linterForRule("LongRunningResponseStatusCode") + return linter +}) test("LongRunningResponseStatusCode should find errors in DELETE operation", () => { const myOpenApiDocument = { @@ -26,12 +26,12 @@ test("LongRunningResponseStatusCode should find errors in DELETE operation", () }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - expect(results[0].path.join(".")).toBe("paths./api/Paths.delete"); - }); -}); + expect(results.length).toBe(1) + expect(results[0].path.join(".")).toBe("paths./api/Paths.delete") + }) +}) test("LongRunningResponseStatusCode should find errors in POST operation", () => { const myOpenApiDocument = { @@ -48,12 +48,12 @@ test("LongRunningResponseStatusCode should find errors in POST operation", () => }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - expect(results[0].path.join(".")).toBe("paths./api/Paths.post"); - }); -}); + expect(results.length).toBe(1) + expect(results[0].path.join(".")).toBe("paths./api/Paths.post") + }) +}) test("LongRunningResponseStatusCode should find errors in PUT operation", () => { const myOpenApiDocument = { @@ -73,12 +73,12 @@ test("LongRunningResponseStatusCode should find errors in PUT operation", () => }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - expect(results[0].path.join(".")).toBe("paths./api/Paths.put"); - }); -}); + expect(results.length).toBe(1) + expect(results[0].path.join(".")).toBe("paths./api/Paths.put") + }) +}) test("LongRunningResponseStatusCode should find errors in PATCH operation", () => { const myOpenApiDocument = { @@ -95,12 +95,12 @@ test("LongRunningResponseStatusCode should find errors in PATCH operation", () = }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - expect(results[0].path.join(".")).toBe("paths./api/Paths.patch"); - }); -}); + expect(results.length).toBe(1) + expect(results[0].path.join(".")).toBe("paths./api/Paths.patch") + }) +}) test("LongRunningResponseStatusCode should find no errors in DELETE operation", () => { const myOpenApiDocument = { @@ -120,11 +120,11 @@ test("LongRunningResponseStatusCode should find no errors in DELETE operation", }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) test("LongRunningResponseStatusCode should find no errors in POST operation", () => { const myOpenApiDocument = { @@ -150,11 +150,11 @@ test("LongRunningResponseStatusCode should find no errors in POST operation", () }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) test("LongRunningResponseStatusCode should find no errors in PUT operation", () => { const myOpenApiDocument = { @@ -174,11 +174,11 @@ test("LongRunningResponseStatusCode should find no errors in PUT operation", () }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) test("LongRunningResponseStatusCode should find no errors in PATCH operation", () => { const myOpenApiDocument = { @@ -201,8 +201,8 @@ test("LongRunningResponseStatusCode should find no errors in PATCH operation", ( }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/lro-headers.test.ts b/packages/rulesets/src/spectral/test/lro-headers.test.ts index 63b6eea68..6d4eb1146 100644 --- a/packages/rulesets/src/spectral/test/lro-headers.test.ts +++ b/packages/rulesets/src/spectral/test/lro-headers.test.ts @@ -1,34 +1,34 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('LroHeaders'); - return linter; -}); + linter = await linterForRule("LroHeaders") + return linter +}) -test('LroHeaders should find errors', () => { +test("LroHeaders should find errors", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/test1': { + "/test1": { post: { responses: { 202: { - description: 'Accepted', + description: "Accepted", }, }, }, }, - '/test2': { + "/test2": { post: { responses: { 202: { - description: 'Accepted', + description: "Accepted", headers: { location: { - type: 'string', + type: "string", }, }, }, @@ -36,71 +36,69 @@ test('LroHeaders should find errors', () => { }, }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results).toHaveLength(2); - expect(results[0].path.join('.')).toBe('paths./test1.post.responses.202'); - expect(results[1].path.join('.')).toBe('paths./test2.post.responses.202.headers'); - results.forEach((result) => expect(result.message).toBe( - 'A 202 response should include an Operation-Location response header.', - )); - }); -}); + expect(results).toHaveLength(2) + expect(results[0].path.join(".")).toBe("paths./test1.post.responses.202") + expect(results[1].path.join(".")).toBe("paths./test2.post.responses.202.headers") + results.forEach((result) => expect(result.message).toBe("A 202 response should include an Operation-Location response header.")) + }) +}) -test('LroHeaders should find no errors', () => { +test("LroHeaders should find no errors", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/test1': { + "/test1": { post: { responses: { 202: { - description: 'Accepted', + description: "Accepted", headers: { - 'Operation-location': { - type: 'string', + "Operation-location": { + type: "string", }, }, }, }, }, }, - '/test2': { + "/test2": { post: { responses: { 202: { - description: 'Accepted', + description: "Accepted", headers: { - 'operation-location': { - type: 'string', + "operation-location": { + type: "string", }, }, }, }, }, }, - '/test3': { + "/test3": { post: { responses: { 202: { - description: 'Accepted', + description: "Accepted", headers: { - 'Operation-Location': { - type: 'string', + "Operation-Location": { + type: "string", }, }, }, }, }, }, - '/test4': { + "/test4": { post: { responses: { 202: { - description: 'Accepted', + description: "Accepted", headers: { - 'oPERATION-lOCATION': { - type: 'string', + "oPERATION-lOCATION": { + type: "string", }, }, }, @@ -108,8 +106,8 @@ test('LroHeaders should find no errors', () => { }, }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/lro-status-codes-return-type-schema.test.ts b/packages/rulesets/src/spectral/test/lro-status-codes-return-type-schema.test.ts index 0f5e7766f..73b457786 100644 --- a/packages/rulesets/src/spectral/test/lro-status-codes-return-type-schema.test.ts +++ b/packages/rulesets/src/spectral/test/lro-status-codes-return-type-schema.test.ts @@ -1,12 +1,12 @@ -import {Spectral} from "@stoplight/spectral-core"; -import linterForRule from "./utils"; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter: Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule("LroStatusCodesReturnTypeSchema"); - return linter; -}); + linter = await linterForRule("LroStatusCodesReturnTypeSchema") + return linter +}) test("LroStatusCodesReturnTypeSchema should find errors", () => { const myOpenApiDocument = { @@ -24,12 +24,12 @@ test("LroStatusCodesReturnTypeSchema should find errors", () => { }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - expect(results[0].path.join(".")).toBe("paths./api/Paths.put.responses.200"); - }); -}); + expect(results.length).toBe(1) + expect(results[0].path.join(".")).toBe("paths./api/Paths.put.responses.200") + }) +}) test("LroStatusCodesReturnTypeSchema should find no errors", () => { const myOpenApiDocument = { @@ -60,8 +60,8 @@ test("LroStatusCodesReturnTypeSchema should find no errors", () => { }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/mutability-with-read-only.test.ts b/packages/rulesets/src/spectral/test/mutability-with-read-only.test.ts index 76273f7ea..882fdde53 100644 --- a/packages/rulesets/src/spectral/test/mutability-with-read-only.test.ts +++ b/packages/rulesets/src/spectral/test/mutability-with-read-only.test.ts @@ -1,12 +1,12 @@ -import {Spectral} from "@stoplight/spectral-core"; -import linterForRule from "./utils"; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter: Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule("MutabilityWithReadOnly"); - return linter; -}); + linter = await linterForRule("MutabilityWithReadOnly") + return linter +}) test("MutabilityWithReadOnly should find errors", () => { const myOpenApiDocument = { @@ -43,15 +43,19 @@ test("MutabilityWithReadOnly should find errors", () => { }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(2); - expect(results[0].message).toBe(`When property is modeled as "readOnly": true then x-ms-mutability extension can only have "read" value. When property is modeled as "readOnly": false then applying x-ms-mutability extension with only "read" value is not allowed. Extension contains invalid values: 'read'.`); - expect(results[0].path.join(".")).toBe("paths./api/Paths.put.responses.200.schema.properties.length"); - expect(results[1].message).toBe(`When property is modeled as "readOnly": true then x-ms-mutability extension can only have "read" value. When property is modeled as "readOnly": false then applying x-ms-mutability extension with only "read" value is not allowed. Extension contains invalid values: 'read, update'.`); - expect(results[1].path.join(".")).toBe("paths./api/Paths.put.responses.200.schema.properties.name"); - }); -}); + expect(results.length).toBe(2) + expect(results[0].message).toBe( + `When property is modeled as "readOnly": true then x-ms-mutability extension can only have "read" value. When property is modeled as "readOnly": false then applying x-ms-mutability extension with only "read" value is not allowed. Extension contains invalid values: 'read'.` + ) + expect(results[0].path.join(".")).toBe("paths./api/Paths.put.responses.200.schema.properties.length") + expect(results[1].message).toBe( + `When property is modeled as "readOnly": true then x-ms-mutability extension can only have "read" value. When property is modeled as "readOnly": false then applying x-ms-mutability extension with only "read" value is not allowed. Extension contains invalid values: 'read, update'.` + ) + expect(results[1].path.join(".")).toBe("paths./api/Paths.put.responses.200.schema.properties.name") + }) +}) test("MutabilityWithReadOnly should find no errors", () => { const myOpenApiDocument = { @@ -88,8 +92,8 @@ test("MutabilityWithReadOnly should find no errors", () => { }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/name-property-definition-in-parameter.test.ts b/packages/rulesets/src/spectral/test/name-property-definition-in-parameter.test.ts index 3e02cc722..37609bd7a 100644 --- a/packages/rulesets/src/spectral/test/name-property-definition-in-parameter.test.ts +++ b/packages/rulesets/src/spectral/test/name-property-definition-in-parameter.test.ts @@ -1,12 +1,12 @@ -import {Spectral} from "@stoplight/spectral-core"; -import linterForRule from "./utils"; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter: Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule("NamePropertyDefinitionInParameter"); - return linter; -}); + linter = await linterForRule("NamePropertyDefinitionInParameter") + return linter +}) test("NamePropertyDefinitionInParameter should find errors", () => { const myOpenApiDocument = { @@ -44,14 +44,14 @@ test("NamePropertyDefinitionInParameter should find errors", () => { type: "string", }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(3); - expect(results[0].path.join(".")).toBe("paths./api/Paths.parameters"); - expect(results[1].path.join(".")).toBe("paths./api/Paths.put.parameters"); - expect(results[2].path.join(".")).toBe("parameters"); - }); -}); + expect(results.length).toBe(3) + expect(results[0].path.join(".")).toBe("paths./api/Paths.parameters") + expect(results[1].path.join(".")).toBe("paths./api/Paths.put.parameters") + expect(results[2].path.join(".")).toBe("parameters") + }) +}) test("NamePropertyDefinitionInParameter should find no errors", () => { const myOpenApiDocument = { @@ -98,8 +98,8 @@ test("NamePropertyDefinitionInParameter should find no errors", () => { description: "test api version", }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/next-link-property-must-exist.test.ts b/packages/rulesets/src/spectral/test/next-link-property-must-exist.test.ts index 606768a11..71b2701a3 100644 --- a/packages/rulesets/src/spectral/test/next-link-property-must-exist.test.ts +++ b/packages/rulesets/src/spectral/test/next-link-property-must-exist.test.ts @@ -1,12 +1,12 @@ -import {Spectral} from "@stoplight/spectral-core"; -import linterForRule from "./utils"; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter: Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule("NextLinkPropertyMustExist"); - return linter; -}); + linter = await linterForRule("NextLinkPropertyMustExist") + return linter +}) test("NextLinkPropertyMustExist should find errors", () => { const myOpenApiDocument = { @@ -42,13 +42,15 @@ test("NextLinkPropertyMustExist should find errors", () => { }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - expect(results[0].message).toBe(`The property 'nextLinks' specified by nextLinkName does not exist in the 200 response schema. Please, specify the name of the property that provides the nextLink. If the model does not have the nextLink property then specify null.`); - expect(results[0].path.join(".")).toBe("paths./api/Paths.put"); - }); -}); + expect(results.length).toBe(1) + expect(results[0].message).toBe( + `The property 'nextLinks' specified by nextLinkName does not exist in the 200 response schema. Please, specify the name of the property that provides the nextLink. If the model does not have the nextLink property then specify null.` + ) + expect(results[0].path.join(".")).toBe("paths./api/Paths.put") + }) +}) test("NextLinkPropertyMustExist should find no errors", () => { const myOpenApiDocument = { @@ -84,8 +86,8 @@ test("NextLinkPropertyMustExist should find no errors", () => { }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/non-empty-client-name.test.ts b/packages/rulesets/src/spectral/test/non-empty-client-name.test.ts index 62e5c4003..3613762fa 100644 --- a/packages/rulesets/src/spectral/test/non-empty-client-name.test.ts +++ b/packages/rulesets/src/spectral/test/non-empty-client-name.test.ts @@ -1,12 +1,12 @@ -import {Spectral} from "@stoplight/spectral-core"; -import linterForRule from "./utils"; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter: Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule("NonEmptyClientName"); - return linter; -}); + linter = await linterForRule("NonEmptyClientName") + return linter +}) test("NonEmptyClientName should find errors", () => { const myOpenApiDocument = { @@ -32,17 +32,17 @@ test("NonEmptyClientName should find errors", () => { properties: { name: { type: "string", - "x-ms-client-name": "" + "x-ms-client-name": "", }, }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - expect(results[0].message).toBe("Empty x-ms-client-name property."); - }); -}); + expect(results.length).toBe(1) + expect(results[0].message).toBe("Empty x-ms-client-name property.") + }) +}) test("NonEmptyClientName should find no errors", () => { const myOpenApiDocument = { @@ -68,13 +68,13 @@ test("NonEmptyClientName should find no errors", () => { properties: { name: { type: "string", - "x-ms-client-name": "Name" + "x-ms-client-name": "Name", }, }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/one-underscore-in-operation-id.test.ts b/packages/rulesets/src/spectral/test/one-underscore-in-operation-id.test.ts index b57d30cac..2859498c9 100644 --- a/packages/rulesets/src/spectral/test/one-underscore-in-operation-id.test.ts +++ b/packages/rulesets/src/spectral/test/one-underscore-in-operation-id.test.ts @@ -1,12 +1,12 @@ -import {Spectral} from "@stoplight/spectral-core"; -import linterForRule from "./utils"; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter: Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule("OperationIdSingleUnderscore"); - return linter; -}); + linter = await linterForRule("OperationIdSingleUnderscore") + return linter +}) test("OperationIdSingleUnderscore should find errors", () => { const myOpenApiDocument = { @@ -23,12 +23,12 @@ test("OperationIdSingleUnderscore should find errors", () => { }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - expect(results[0].path.join(".")).toBe("paths./api/Paths.get.operationId"); - }); -}); + expect(results.length).toBe(1) + expect(results[0].path.join(".")).toBe("paths./api/Paths.get.operationId") + }) +}) test("OperationIdSingleUnderscore should find no errors", () => { const myOpenApiDocument = { @@ -45,8 +45,8 @@ test("OperationIdSingleUnderscore should find no errors", () => { }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/operation-id-noun-conflicting-model-names.test.ts b/packages/rulesets/src/spectral/test/operation-id-noun-conflicting-model-names.test.ts index 6c37bcb55..ebce29ca7 100644 --- a/packages/rulesets/src/spectral/test/operation-id-noun-conflicting-model-names.test.ts +++ b/packages/rulesets/src/spectral/test/operation-id-noun-conflicting-model-names.test.ts @@ -1,12 +1,12 @@ -import {Spectral} from "@stoplight/spectral-core"; -import linterForRule from "./utils"; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter: Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule("OperationIdNounConflictingModelNames"); - return linter; -}); + linter = await linterForRule("OperationIdNounConflictingModelNames") + return linter +}) test("OperationIdNounConflictingModelNames should find errors", () => { const myOpenApiDocument = { @@ -28,12 +28,12 @@ test("OperationIdNounConflictingModelNames should find errors", () => { type: "string", }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - expect(results[0].path.join(".")).toBe("paths./api/Paths.get.operationId"); - }); -}); + expect(results.length).toBe(1) + expect(results[0].path.join(".")).toBe("paths./api/Paths.get.operationId") + }) +}) test("OperationIdNounConflictingModelNames should find no errors", () => { const myOpenApiDocument = { @@ -58,8 +58,8 @@ test("OperationIdNounConflictingModelNames should find no errors", () => { type: "string", }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/operation-id-noun-verb.test.ts b/packages/rulesets/src/spectral/test/operation-id-noun-verb.test.ts index 163472b33..b300e2bf6 100644 --- a/packages/rulesets/src/spectral/test/operation-id-noun-verb.test.ts +++ b/packages/rulesets/src/spectral/test/operation-id-noun-verb.test.ts @@ -1,12 +1,12 @@ -import {Spectral} from "@stoplight/spectral-core"; -import linterForRule from "./utils"; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter: Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule("OperationIdNounVerb"); - return linter; -}); + linter = await linterForRule("OperationIdNounVerb") + return linter +}) test("OperationIdNounVerb should find errors", () => { const myOpenApiDocument = { @@ -23,12 +23,12 @@ test("OperationIdNounVerb should find errors", () => { }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - expect(results[0].path.join(".")).toBe("paths./api/Paths.get.operationId"); - }); -}); + expect(results.length).toBe(1) + expect(results[0].path.join(".")).toBe("paths./api/Paths.get.operationId") + }) +}) test("OperationIdNounVerb should find no errors", () => { const myOpenApiDocument = { @@ -45,8 +45,8 @@ test("OperationIdNounVerb should find no errors", () => { }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/operation-id.test.ts b/packages/rulesets/src/spectral/test/operation-id.test.ts index 88b834ec0..838aba75f 100644 --- a/packages/rulesets/src/spectral/test/operation-id.test.ts +++ b/packages/rulesets/src/spectral/test/operation-id.test.ts @@ -1,188 +1,184 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('OperationId'); - return linter; -}); + linter = await linterForRule("OperationId") + return linter +}) -test('OperationId should find operationId not Noun_Verb', () => { +test("OperationId should find operationId not Noun_Verb", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/api/test1': { + "/api/test1": { post: { - operationId: 'fooBarBaz', + operationId: "fooBarBaz", }, }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results).toHaveLength(1); - expect(results[0].path.join('.')).toBe('paths./api/test1.post.operationId'); - results.forEach((result) => expect(result.message).toContain( - 'OperationId should be of the form "Noun_Verb"', - )); - }); -}); + expect(results).toHaveLength(1) + expect(results[0].path.join(".")).toBe("paths./api/test1.post.operationId") + results.forEach((result) => expect(result.message).toContain('OperationId should be of the form "Noun_Verb"')) + }) +}) -test('OperationId should find operationId without standard verb', () => { +test("OperationId should find operationId without standard verb", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/api/test2': { + "/api/test2": { get: { - operationId: 'Noun_Verb', + operationId: "Noun_Verb", }, put: { - operationId: 'Noun_Put', + operationId: "Noun_Put", }, patch: { - operationId: 'Noun_Patch', + operationId: "Noun_Patch", }, delete: { - operationId: 'Noun_Remove', + operationId: "Noun_Remove", }, }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results).toHaveLength(4); - expect(results[0].path.join('.')).toBe('paths./api/test2.get.operationId'); - expect(results[1].path.join('.')).toBe('paths./api/test2.put.operationId'); - expect(results[2].path.join('.')).toBe('paths./api/test2.patch.operationId'); - expect(results[3].path.join('.')).toBe('paths./api/test2.delete.operationId'); - results.forEach((result) => expect(result.message).toMatch( - /OperationId for (get|put|patch|delete) method should contain/, - )); - }); -}); + expect(results).toHaveLength(4) + expect(results[0].path.join(".")).toBe("paths./api/test2.get.operationId") + expect(results[1].path.join(".")).toBe("paths./api/test2.put.operationId") + expect(results[2].path.join(".")).toBe("paths./api/test2.patch.operationId") + expect(results[3].path.join(".")).toBe("paths./api/test2.delete.operationId") + results.forEach((result) => expect(result.message).toMatch(/OperationId for (get|put|patch|delete) method should contain/)) + }) +}) -test('OperationId should find operationId without standard verb again', () => { +test("OperationId should find operationId without standard verb again", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/api/test3': { + "/api/test3": { get: { - operationId: 'Noun_Get', - 'x-ms-pageable': { - nextLinkName: 'nextLink', + operationId: "Noun_Get", + "x-ms-pageable": { + nextLinkName: "nextLink", }, }, put: { - operationId: 'Noun_Create', + operationId: "Noun_Create", responses: { 200: { - description: 'Success', + description: "Success", }, 201: { - description: 'Created', + description: "Created", }, }, }, patch: { - operationId: 'Noun_Update', + operationId: "Noun_Update", responses: { 200: { - description: 'Success', + description: "Success", }, 201: { - description: 'Created', + description: "Created", }, }, }, }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results).toHaveLength(3); - expect(results[0].path.join('.')).toBe('paths./api/test3.get.operationId'); - expect(results[0].message).toBe('OperationId for get method on a collection should contain "List"'); - expect(results[1].path.join('.')).toBe('paths./api/test3.put.operationId'); - expect(results[1].message).toBe('OperationId for put method should contain both "Create" and "Update"'); - expect(results[2].path.join('.')).toBe('paths./api/test3.patch.operationId'); - expect(results[2].message).toBe('OperationId for patch method should contain both "Create" and "Update"'); - }); -}); + expect(results).toHaveLength(3) + expect(results[0].path.join(".")).toBe("paths./api/test3.get.operationId") + expect(results[0].message).toBe('OperationId for get method on a collection should contain "List"') + expect(results[1].path.join(".")).toBe("paths./api/test3.put.operationId") + expect(results[1].message).toBe('OperationId for put method should contain both "Create" and "Update"') + expect(results[2].path.join(".")).toBe("paths./api/test3.patch.operationId") + expect(results[2].message).toBe('OperationId for patch method should contain both "Create" and "Update"') + }) +}) -test('OperationId should find no errors', () => { +test("OperationId should find no errors", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/api/test3': { + "/api/test3": { get: { - operationId: 'Noun_Get', + operationId: "Noun_Get", }, put: { - operationId: 'Noun_Create', + operationId: "Noun_Create", }, patch: { - operationId: 'Noun_Update', + operationId: "Noun_Update", }, delete: { - operationId: 'Noun_Delete', + operationId: "Noun_Delete", }, post: { - operationId: 'Noun_Anything', + operationId: "Noun_Anything", }, }, - '/api/test4': { + "/api/test4": { get: { - operationId: 'Noun_List', - 'x-ms-pageable': { - nextLinkName: 'nextLink', + operationId: "Noun_List", + "x-ms-pageable": { + nextLinkName: "nextLink", }, }, put: { - operationId: 'Noun_CreateOrUpdate', + operationId: "Noun_CreateOrUpdate", responses: { 200: { - description: 'Success', + description: "Success", }, 201: { - description: 'Created', + description: "Created", }, }, }, patch: { - operationId: 'Noun_CreateOrUpdate', + operationId: "Noun_CreateOrUpdate", responses: { 200: { - description: 'Success', + description: "Success", }, 201: { - description: 'Created', + description: "Created", }, }, }, }, - '/api/test5': { + "/api/test5": { get: { - operationId: 'noun_get', + operationId: "noun_get", }, put: { - operationId: 'noun_create', + operationId: "noun_create", }, patch: { - operationId: 'noun_update', + operationId: "noun_update", }, delete: { - operationId: 'noun_delete', + operationId: "noun_delete", }, }, - '/api/test6': { + "/api/test6": { put: { - operationId: 'noun_update', + operationId: "noun_update", 200: { - description: 'Success', + description: "Success", }, }, }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/pageable-requires200-response.test.ts b/packages/rulesets/src/spectral/test/pageable-requires200-response.test.ts index 84e878194..5a1a25794 100644 --- a/packages/rulesets/src/spectral/test/pageable-requires200-response.test.ts +++ b/packages/rulesets/src/spectral/test/pageable-requires200-response.test.ts @@ -1,12 +1,12 @@ -import { Spectral } from "@stoplight/spectral-core"; -import linterForRule from "./utils"; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter: Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule("PageableRequires200Response"); - return linter; -}); + linter = await linterForRule("PageableRequires200Response") + return linter +}) test("PageableRequires200Response should find errors", () => { const myOpenApiDocument = { @@ -25,12 +25,12 @@ test("PageableRequires200Response should find errors", () => { }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - expect(results[0].path.join(".")).toBe("paths./api/Paths.patch.responses"); - }); -}); + expect(results.length).toBe(1) + expect(results[0].path.join(".")).toBe("paths./api/Paths.patch.responses") + }) +}) test("PageableRequires200Response should find no errors", () => { const myOpenApiDocument = { @@ -49,8 +49,8 @@ test("PageableRequires200Response should find no errors", () => { }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/pagination-response.test.ts b/packages/rulesets/src/spectral/test/pagination-response.test.ts index 21ba8e285..5408ad9ff 100644 --- a/packages/rulesets/src/spectral/test/pagination-response.test.ts +++ b/packages/rulesets/src/spectral/test/pagination-response.test.ts @@ -1,26 +1,26 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('PaginationResponse'); - return linter; -}); + linter = await linterForRule("PaginationResponse") + return linter +}) -test('PaginationResponse should find missing x-ms-pageable extension', () => { +test("PaginationResponse should find missing x-ms-pageable extension", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/test1': { + "/test1": { get: { responses: { 200: { - description: 'Success', + description: "Success", schema: { properties: { value: { - type: 'array', + type: "array", }, }, }, @@ -30,11 +30,11 @@ test('PaginationResponse should find missing x-ms-pageable extension', () => { post: { responses: { 200: { - description: 'Success', + description: "Success", schema: { properties: { value: { - type: 'array', + type: "array", }, }, }, @@ -43,293 +43,293 @@ test('PaginationResponse should find missing x-ms-pageable extension', () => { }, }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(2); - expect(results[0].path.join('.')).toBe('paths./test1.get'); - expect(results[0].message).toBe('Operation might be pageable. Consider adding the x-ms-pageable extension.'); - expect(results[1].path.join('.')).toBe('paths./test1.post'); - expect(results[1].message).toBe('Operation might be pageable. Consider adding the x-ms-pageable extension.'); - }); -}); + expect(results.length).toBe(2) + expect(results[0].path.join(".")).toBe("paths./test1.get") + expect(results[0].message).toBe("Operation might be pageable. Consider adding the x-ms-pageable extension.") + expect(results[1].path.join(".")).toBe("paths./test1.post") + expect(results[1].message).toBe("Operation might be pageable. Consider adding the x-ms-pageable extension.") + }) +}) -test('PaginationResponse should find errors in value property', () => { +test("PaginationResponse should find errors in value property", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/test2': { + "/test2": { get: { responses: { 200: { - description: 'Success', + description: "Success", schema: { properties: { value: { - type: 'string', + type: "string", }, nextLink: { - type: 'string', + type: "string", }, }, - required: ['value'], + required: ["value"], }, }, }, - 'x-ms-pageable': { - nextLinkName: 'nextLink', + "x-ms-pageable": { + nextLinkName: "nextLink", }, }, }, - '/test3': { + "/test3": { get: { responses: { 200: { - description: 'Success', + description: "Success", schema: { properties: { value: { - type: 'array', + type: "array", }, nextLink: { - type: 'string', + type: "string", }, }, }, }, }, - 'x-ms-pageable': { - nextLinkName: 'nextLink', + "x-ms-pageable": { + nextLinkName: "nextLink", }, }, }, - '/test4': { + "/test4": { get: { responses: { 200: { - description: 'Success', + description: "Success", schema: { properties: { values: { - type: 'array', + type: "array", }, nextLink: { - type: 'string', + type: "string", }, }, - required: ['value'], + required: ["value"], }, }, }, - 'x-ms-pageable': { - nextLinkName: 'nextLink', + "x-ms-pageable": { + nextLinkName: "nextLink", }, }, }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(3); - expect(results[0].path.join('.')).toBe('paths./test2.get.responses.200.schema.properties.value.type'); - expect(results[0].message).toBe('`value` property in pageable response should be type: array'); - expect(results[1].path.join('.')).toBe('paths./test3.get.responses.200.schema'); - expect(results[1].message).toBe('`value` property in pageable response should be required'); - expect(results[2].path.join('.')).toBe('paths./test4.get.responses.200.schema.properties'); - expect(results[2].message).toBe('Response body schema of pageable response should contain top-level array property `value`'); - }); -}); + expect(results.length).toBe(3) + expect(results[0].path.join(".")).toBe("paths./test2.get.responses.200.schema.properties.value.type") + expect(results[0].message).toBe("`value` property in pageable response should be type: array") + expect(results[1].path.join(".")).toBe("paths./test3.get.responses.200.schema") + expect(results[1].message).toBe("`value` property in pageable response should be required") + expect(results[2].path.join(".")).toBe("paths./test4.get.responses.200.schema.properties") + expect(results[2].message).toBe("Response body schema of pageable response should contain top-level array property `value`") + }) +}) -test('PaginationResponse should find errors in nextLink property', () => { +test("PaginationResponse should find errors in nextLink property", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/test5': { + "/test5": { get: { responses: { 200: { - description: 'Success', + description: "Success", schema: { properties: { value: { - type: 'array', + type: "array", }, nextLink: { - type: 'object', + type: "object", }, }, - required: ['value'], + required: ["value"], }, }, }, - 'x-ms-pageable': { - nextLinkName: 'nextLink', + "x-ms-pageable": { + nextLinkName: "nextLink", }, }, }, - '/test6': { + "/test6": { get: { responses: { 200: { - description: 'Success', + description: "Success", schema: { properties: { value: { - type: 'array', + type: "array", }, nextPage: { - type: 'string', + type: "string", }, }, - required: ['value', 'nextPage'], + required: ["value", "nextPage"], }, }, }, - 'x-ms-pageable': { - nextLinkName: 'nextPage', + "x-ms-pageable": { + nextLinkName: "nextPage", }, }, }, - '/test7': { + "/test7": { get: { responses: { 200: { - description: 'Success', + description: "Success", schema: { properties: { value: { - type: 'array', + type: "array", }, nextPage: { - type: 'string', + type: "string", }, }, - required: ['value'], + required: ["value"], }, }, }, - 'x-ms-pageable': { + "x-ms-pageable": { nextLinkName: null, }, }, }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(3); - expect(results[0].path.join('.')).toBe('paths./test5.get.responses.200.schema.properties.nextLink.type'); - expect(results[0].message).toBe('`nextLink` property in pageable response should be type: string'); - expect(results[1].path.join('.')).toBe('paths./test6.get.responses.200.schema.required'); - expect(results[1].message).toBe('`nextPage` property in pageable response should be optional.'); - expect(results[2].path.join('.')).toBe('paths./test7.get.responses.200.schema.properties'); - expect(results[2].message).toBe('Response body schema of pageable response should contain top-level property `nextLink`'); - }); -}); + expect(results.length).toBe(3) + expect(results[0].path.join(".")).toBe("paths./test5.get.responses.200.schema.properties.nextLink.type") + expect(results[0].message).toBe("`nextLink` property in pageable response should be type: string") + expect(results[1].path.join(".")).toBe("paths./test6.get.responses.200.schema.required") + expect(results[1].message).toBe("`nextPage` property in pageable response should be optional.") + expect(results[2].path.join(".")).toBe("paths./test7.get.responses.200.schema.properties") + expect(results[2].message).toBe("Response body schema of pageable response should contain top-level property `nextLink`") + }) +}) -test('PaginationResponse should find no errors', () => { +test("PaginationResponse should find no errors", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/good-path': { + "/good-path": { get: { - operationId: 'Good_List', + operationId: "Good_List", responses: { 200: { - description: 'Success', + description: "Success", schema: { properties: { value: { - type: 'array', + type: "array", }, nextLink: { - type: 'string', + type: "string", }, }, - required: ['value'], + required: ["value"], }, }, }, - 'x-ms-pageable': { - nextLinkName: 'nextLink', + "x-ms-pageable": { + nextLinkName: "nextLink", }, }, }, - '/good-path2': { + "/good-path2": { get: { - operationId: 'Good_List2', + operationId: "Good_List2", responses: { 200: { - description: 'Success', + description: "Success", schema: { properties: { value: { - type: 'array', + type: "array", }, nextLink: { - type: 'string', + type: "string", }, }, - required: ['value'], + required: ["value"], }, }, }, - 'x-ms-pageable': { + "x-ms-pageable": { nextLinkName: null, }, }, }, - '/good-path3': { + "/good-path3": { get: { - operationId: 'Good_List3', + operationId: "Good_List3", responses: { 200: { - description: 'Success', + description: "Success", schema: { properties: { value: { - type: 'array', + type: "array", }, nextPage: { - type: 'string', + type: "string", }, }, - required: ['value'], + required: ["value"], }, }, }, - 'x-ms-pageable': { - nextLinkName: 'nextPage', + "x-ms-pageable": { + nextLinkName: "nextPage", }, }, }, - '/good-path4': { + "/good-path4": { get: { - operationId: 'Good_NotList', + operationId: "Good_NotList", responses: { 200: { - description: 'Success', + description: "Success", schema: { properties: { value: { - type: 'array', + type: "array", }, this: { - type: 'string', + type: "string", }, that: { - type: 'string', + type: "string", }, theOther: { - type: 'string', + type: "string", }, }, - required: ['value'], + required: ["value"], }, }, }, }, }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/parameter-default-not-allowed.test.ts b/packages/rulesets/src/spectral/test/parameter-default-not-allowed.test.ts index ebe7c20da..9d0bef92a 100644 --- a/packages/rulesets/src/spectral/test/parameter-default-not-allowed.test.ts +++ b/packages/rulesets/src/spectral/test/parameter-default-not-allowed.test.ts @@ -1,76 +1,76 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('ParameterDefaultNotAllowed'); - return linter; -}); + linter = await linterForRule("ParameterDefaultNotAllowed") + return linter +}) -test('ParameterDefaultNotAllowed should find errors', () => { +test("ParameterDefaultNotAllowed should find errors", () => { const myOpenApiDocument = { - swagger: '2.0', + swagger: "2.0", paths: { - '/path1': { + "/path1": { parameters: [ { - name: 'param1', - in: 'query', - type: 'string', + name: "param1", + in: "query", + type: "string", required: true, - default: 'param1', + default: "param1", }, ], get: { parameters: [ { - name: 'param2', - in: 'query', - type: 'string', + name: "param2", + in: "query", + type: "string", required: true, - default: 'param2', + default: "param2", }, ], }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(2); - expect(results[0].path.join('.')).toBe('paths./path1.parameters.0.default'); - expect(results[1].path.join('.')).toBe('paths./path1.get.parameters.0.default'); - }); -}); + expect(results.length).toBe(2) + expect(results[0].path.join(".")).toBe("paths./path1.parameters.0.default") + expect(results[1].path.join(".")).toBe("paths./path1.get.parameters.0.default") + }) +}) -test('ParameterDefaultNotAllowed should find no errors', () => { +test("ParameterDefaultNotAllowed should find no errors", () => { const myOpenApiDocument = { - swagger: '2.0', + swagger: "2.0", paths: { - '/path1': { + "/path1": { parameters: [ { - name: 'param1', - in: 'query', - type: 'string', + name: "param1", + in: "query", + type: "string", required: false, - default: 'param1', + default: "param1", }, ], get: { parameters: [ { - name: 'param2', - in: 'query', - type: 'string', - default: 'param2', + name: "param2", + in: "query", + type: "string", + default: "param2", }, ], }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/parameter-description.test.ts b/packages/rulesets/src/spectral/test/parameter-description.test.ts index 33772010d..02b3f4c73 100644 --- a/packages/rulesets/src/spectral/test/parameter-description.test.ts +++ b/packages/rulesets/src/spectral/test/parameter-description.test.ts @@ -1,38 +1,38 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('ParameterDescription'); - return linter; -}); + linter = await linterForRule("ParameterDescription") + return linter +}) -test('ParameterDescription should find errors', () => { +test("ParameterDescription should find errors", () => { // Test missing description in 3 different places: // 1. parameter at path level // 2. inline parameter at operation level // 3. referenced parameter at operation level const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/api/Paths': { + "/api/Paths": { parameters: [ { - name: 'version', - in: 'query', - type: 'string', + name: "version", + in: "query", + type: "string", }, ], get: { parameters: [ { - name: 'param1', - in: 'query', - type: 'string', + name: "param1", + in: "query", + type: "string", }, { - $ref: '#/parameters/Param2', + $ref: "#/parameters/Param2", }, ], }, @@ -40,43 +40,43 @@ test('ParameterDescription should find errors', () => { }, parameters: { Param2: { - name: 'param2', - in: 'query', - type: 'string', + name: "param2", + in: "query", + type: "string", }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(3); - expect(results[0].path.join('.')).toBe('paths./api/Paths.parameters.0'); - expect(results[1].path.join('.')).toBe('paths./api/Paths.get.parameters.0'); - expect(results[2].path.join('.')).toBe('paths./api/Paths.get.parameters.1'); - }); -}); + expect(results.length).toBe(3) + expect(results[0].path.join(".")).toBe("paths./api/Paths.parameters.0") + expect(results[1].path.join(".")).toBe("paths./api/Paths.get.parameters.0") + expect(results[2].path.join(".")).toBe("paths./api/Paths.get.parameters.1") + }) +}) -test('ParameterDescription should find no errors', () => { +test("ParameterDescription should find no errors", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/api/Paths': { + "/api/Paths": { parameters: [ { - name: 'version', - in: 'query', - type: 'string', - description: 'A descriptive description', + name: "version", + in: "query", + type: "string", + description: "A descriptive description", }, ], get: { parameters: [ { - name: 'param1', - in: 'query', - type: 'string', - description: 'A descriptive description', + name: "param1", + in: "query", + type: "string", + description: "A descriptive description", }, { - $ref: '#/parameters/Param2', + $ref: "#/parameters/Param2", }, ], }, @@ -84,14 +84,14 @@ test('ParameterDescription should find no errors', () => { }, parameters: { Param2: { - name: 'param2', - in: 'query', - type: 'string', - description: 'A descriptive description', + name: "param2", + in: "query", + type: "string", + description: "A descriptive description", }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/parameter-names-convention.test.ts b/packages/rulesets/src/spectral/test/parameter-names-convention.test.ts index a1511625d..9e8506714 100644 --- a/packages/rulesets/src/spectral/test/parameter-names-convention.test.ts +++ b/packages/rulesets/src/spectral/test/parameter-names-convention.test.ts @@ -1,61 +1,61 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('ParameterNamesConvention'); - return linter; -}); + linter = await linterForRule("ParameterNamesConvention") + return linter +}) -test('ParameterNamesConvention should find errors', () => { +test("ParameterNamesConvention should find errors", () => { // Test parameter names in 3 different places: // 1. parameter at path level // 2. inline parameter at operation level // 3. referenced parameter at operation level const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/test1/{test-id}': { + "/test1/{test-id}": { parameters: [ { - name: 'test-id', - in: 'path', - type: 'string', + name: "test-id", + in: "path", + type: "string", }, { - name: 'foo_bar', - in: 'query', - type: 'string', + name: "foo_bar", + in: "query", + type: "string", }, { - name: 'fooBar', - in: 'header', - type: 'string', - description: 'Camel case header', + name: "fooBar", + in: "header", + type: "string", + description: "Camel case header", }, { - name: '$foo-bar', - in: 'header', - type: 'string', - description: '$ should not be first character of header', + name: "$foo-bar", + in: "header", + type: "string", + description: "$ should not be first character of header", }, { - name: '@foo-bar', - in: 'header', - type: 'string', - description: '@ should not be first character of header', + name: "@foo-bar", + in: "header", + type: "string", + description: "@ should not be first character of header", }, ], get: { parameters: [ { - name: 'resource-id', - in: 'query', - type: 'string', + name: "resource-id", + in: "query", + type: "string", }, { - $ref: '#/parameters/SkipParam', + $ref: "#/parameters/SkipParam", }, ], }, @@ -63,57 +63,57 @@ test('ParameterNamesConvention should find errors', () => { }, parameters: { SkipParam: { - name: '$skip', - in: 'query', - type: 'integer', + name: "$skip", + in: "query", + type: "integer", }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(7); - expect(results[0].path.join('.')).toBe('paths./test1/{test-id}.parameters.0.name'); - expect(results[1].path.join('.')).toBe('paths./test1/{test-id}.parameters.1.name'); - expect(results[2].path.join('.')).toBe('paths./test1/{test-id}.parameters.2.name'); - expect(results[3].path.join('.')).toBe('paths./test1/{test-id}.parameters.3.name'); - expect(results[3].message).toContain("should not begin with '$' or '@'"); - expect(results[4].path.join('.')).toBe('paths./test1/{test-id}.parameters.4.name'); - expect(results[4].message).toContain("should not begin with '$' or '@'"); - expect(results[5].path.join('.')).toBe('paths./test1/{test-id}.get.parameters.0.name'); - expect(results[6].path.join('.')).toBe('paths./test1/{test-id}.get.parameters.1.name'); - }); -}); + expect(results.length).toBe(7) + expect(results[0].path.join(".")).toBe("paths./test1/{test-id}.parameters.0.name") + expect(results[1].path.join(".")).toBe("paths./test1/{test-id}.parameters.1.name") + expect(results[2].path.join(".")).toBe("paths./test1/{test-id}.parameters.2.name") + expect(results[3].path.join(".")).toBe("paths./test1/{test-id}.parameters.3.name") + expect(results[3].message).toContain("should not begin with '$' or '@'") + expect(results[4].path.join(".")).toBe("paths./test1/{test-id}.parameters.4.name") + expect(results[4].message).toContain("should not begin with '$' or '@'") + expect(results[5].path.join(".")).toBe("paths./test1/{test-id}.get.parameters.0.name") + expect(results[6].path.join(".")).toBe("paths./test1/{test-id}.get.parameters.1.name") + }) +}) -test('ParameterNamesConvention should find no errors', () => { +test("ParameterNamesConvention should find no errors", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/test1/{id}': { + "/test1/{id}": { parameters: [ { - name: 'id', - in: 'path', - type: 'string', + name: "id", + in: "path", + type: "string", }, { - name: 'fooBar', - in: 'query', - type: 'string', + name: "fooBar", + in: "query", + type: "string", }, { - name: 'foo-bar', - in: 'header', - type: 'string', + name: "foo-bar", + in: "header", + type: "string", }, ], get: { parameters: [ { - name: 'resourceId', - in: 'query', - type: 'string', + name: "resourceId", + in: "query", + type: "string", }, { - $ref: '#/parameters/SkipParam', + $ref: "#/parameters/SkipParam", }, ], }, @@ -121,13 +121,13 @@ test('ParameterNamesConvention should find no errors', () => { }, parameters: { SkipParam: { - name: 'skip', - in: 'query', - type: 'integer', + name: "skip", + in: "query", + type: "integer", }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/parameter-names-unique.test.ts b/packages/rulesets/src/spectral/test/parameter-names-unique.test.ts index e9c434a1d..ea68cdec1 100644 --- a/packages/rulesets/src/spectral/test/parameter-names-unique.test.ts +++ b/packages/rulesets/src/spectral/test/parameter-names-unique.test.ts @@ -1,59 +1,59 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('ParameterNamesUnique'); - return linter; -}); + linter = await linterForRule("ParameterNamesUnique") + return linter +}) -test('ParameterNamesUnique should find errors', () => { +test("ParameterNamesUnique should find errors", () => { // Test parameter names in 3 different places: // 1. parameter at path level // 2. inline parameter at operation level // 3. referenced parameter at operation level const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/test1/{p1}': { + "/test1/{p1}": { parameters: [ { - name: 'p1', - in: 'path', - type: 'string', + name: "p1", + in: "path", + type: "string", }, // Legal in OAS2 for same name w/ different in { - name: 'p1', - in: 'query', - type: 'string', + name: "p1", + in: "query", + type: "string", }, { - name: 'p2', - in: 'query', - type: 'string', + name: "p2", + in: "query", + type: "string", }, ], get: { parameters: [ { - name: 'p1', - in: 'header', - type: 'string', + name: "p1", + in: "header", + type: "string", }, { - $ref: '#/parameters/Param2', + $ref: "#/parameters/Param2", }, { - name: 'p3', - in: 'query', - type: 'string', + name: "p3", + in: "query", + type: "string", }, { - name: 'p3', - in: 'header', - type: 'string', + name: "p3", + in: "header", + type: "string", }, ], }, @@ -61,52 +61,52 @@ test('ParameterNamesUnique should find errors', () => { }, parameters: { Param2: { - name: 'p2', - in: 'header', - type: 'integer', + name: "p2", + in: "header", + type: "integer", }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(4); - expect(results[0].path.join('.')).toBe('paths./test1/{p1}.parameters.1.name'); - expect(results[1].path.join('.')).toBe('paths./test1/{p1}.get.parameters.0.name'); - expect(results[2].path.join('.')).toBe('paths./test1/{p1}.get.parameters.1.name'); - expect(results[3].path.join('.')).toBe('paths./test1/{p1}.get.parameters.3.name'); - }); -}); + expect(results.length).toBe(4) + expect(results[0].path.join(".")).toBe("paths./test1/{p1}.parameters.1.name") + expect(results[1].path.join(".")).toBe("paths./test1/{p1}.get.parameters.0.name") + expect(results[2].path.join(".")).toBe("paths./test1/{p1}.get.parameters.1.name") + expect(results[3].path.join(".")).toBe("paths./test1/{p1}.get.parameters.3.name") + }) +}) -test('ParameterNamesUnique should find no errors', () => { +test("ParameterNamesUnique should find no errors", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/test1/{id}': { + "/test1/{id}": { parameters: [ { - name: 'id', - in: 'path', - type: 'string', + name: "id", + in: "path", + type: "string", }, { - name: 'fooBar', - in: 'query', - type: 'string', + name: "fooBar", + in: "query", + type: "string", }, { - name: 'foo-bar', - in: 'header', - type: 'string', + name: "foo-bar", + in: "header", + type: "string", }, ], get: { parameters: [ { - name: 'resourceId', - in: 'query', - type: 'string', + name: "resourceId", + in: "query", + type: "string", }, { - $ref: '#/parameters/SkipParam', + $ref: "#/parameters/SkipParam", }, ], }, @@ -114,13 +114,13 @@ test('ParameterNamesUnique should find no errors', () => { }, parameters: { SkipParam: { - name: 'skip', - in: 'query', - type: 'integer', + name: "skip", + in: "query", + type: "integer", }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/parameter-not-defined-in-global-parameters.test.ts b/packages/rulesets/src/spectral/test/parameter-not-defined-in-global-parameters.test.ts index 17f871e5b..4068e8ff0 100644 --- a/packages/rulesets/src/spectral/test/parameter-not-defined-in-global-parameters.test.ts +++ b/packages/rulesets/src/spectral/test/parameter-not-defined-in-global-parameters.test.ts @@ -1,12 +1,12 @@ -import {Spectral} from "@stoplight/spectral-core"; -import linterForRule from "./utils"; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter: Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule("ParameterNotDefinedInGlobalParameters"); - return linter; -}); + linter = await linterForRule("ParameterNotDefinedInGlobalParameters") + return linter +}) test("ParameterNotDefinedInGlobalParameters should find errors", () => { const myOpenApiDocument = { @@ -48,12 +48,12 @@ test("ParameterNotDefinedInGlobalParameters should find errors", () => { type: "string", }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(2); - expect(results[0].path.join(".")).toBe("paths./api/Paths.get.parameters"); - }); -}); + expect(results.length).toBe(2) + expect(results[0].path.join(".")).toBe("paths./api/Paths.get.parameters") + }) +}) test("ParameterNotDefinedInGlobalParameters should find no errors", () => { const myOpenApiDocument = { @@ -64,10 +64,10 @@ test("ParameterNotDefinedInGlobalParameters should find no errors", () => { operationId: "Path_Get", parameters: [ { - $ref: "#/parameters/SubscriptionIdParameter" + $ref: "#/parameters/SubscriptionIdParameter", }, { - $ref: "#/parameters/ApiVersionParameter" + $ref: "#/parameters/ApiVersionParameter", }, ], responses: { @@ -94,8 +94,8 @@ test("ParameterNotDefinedInGlobalParameters should find no errors", () => { description: "test api version", }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/parameter-order.test.ts b/packages/rulesets/src/spectral/test/parameter-order.test.ts index 71a9fcbf0..b161b0f77 100644 --- a/packages/rulesets/src/spectral/test/parameter-order.test.ts +++ b/packages/rulesets/src/spectral/test/parameter-order.test.ts @@ -1,267 +1,267 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('ParameterOrder'); - return linter; -}); + linter = await linterForRule("ParameterOrder") + return linter +}) -test('ParameterOrder should find errors', () => { +test("ParameterOrder should find errors", () => { // Test parameter ordering at path item level and operation level. const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/test1/{p1}/foo/{p2}': { + "/test1/{p1}/foo/{p2}": { parameters: [ { - name: 'p2', - in: 'path', - type: 'string', + name: "p2", + in: "path", + type: "string", }, { - name: 'p1', - in: 'path', - type: 'string', + name: "p1", + in: "path", + type: "string", }, ], get: { parameters: [ { - name: 'p3', - in: 'query', - type: 'string', + name: "p3", + in: "query", + type: "string", }, ], }, }, - '/test2/{p1}/foo/{p2}/bar/{p3}': { + "/test2/{p1}/foo/{p2}/bar/{p3}": { parameters: [ { - name: 'p1', - in: 'path', - type: 'string', + name: "p1", + in: "path", + type: "string", }, ], get: { parameters: [ { - name: 'p3', - in: 'path', - type: 'string', + name: "p3", + in: "path", + type: "string", }, { - name: 'p2', - in: 'path', - type: 'string', + name: "p2", + in: "path", + type: "string", }, ], }, }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(2); - expect(results[0].path.join('.')).toBe('paths./test1/{p1}/foo/{p2}.parameters'); - expect(results[1].path.join('.')).toBe('paths./test2/{p1}/foo/{p2}/bar/{p3}.get.parameters'); - }); -}); + expect(results.length).toBe(2) + expect(results[0].path.join(".")).toBe("paths./test1/{p1}/foo/{p2}.parameters") + expect(results[1].path.join(".")).toBe("paths./test2/{p1}/foo/{p2}/bar/{p3}.get.parameters") + }) +}) -test('ParameterOrder should find no errors', () => { +test("ParameterOrder should find no errors", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/test1/{p1}/foo/{p2}': { + "/test1/{p1}/foo/{p2}": { parameters: [ { - name: 'p1', - in: 'path', - type: 'string', + name: "p1", + in: "path", + type: "string", }, { - name: 'p2', - in: 'path', - type: 'string', + name: "p2", + in: "path", + type: "string", }, ], get: { parameters: [ { - name: 'p3', - in: 'query', - type: 'string', + name: "p3", + in: "query", + type: "string", }, ], }, }, - '/test2/{p1}/foo/{p2}/bar/{p3}': { + "/test2/{p1}/foo/{p2}/bar/{p3}": { parameters: [ { - name: 'p1', - in: 'path', - type: 'string', + name: "p1", + in: "path", + type: "string", }, ], get: { parameters: [ { - name: 'p2', - in: 'path', - type: 'string', + name: "p2", + in: "path", + type: "string", }, { - name: 'p3', - in: 'path', - type: 'string', + name: "p3", + in: "path", + type: "string", }, ], }, }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) -test('ParameterOrder should find oas3 errors', () => { +test("ParameterOrder should find oas3 errors", () => { // Test parameter ordering at path item level and operation level. const oasDoc = { - openapi: '3.0.3', + openapi: "3.0.3", paths: { - '/test1/{p1}/foo/{p2}': { + "/test1/{p1}/foo/{p2}": { parameters: [ { - name: 'p2', - in: 'path', + name: "p2", + in: "path", schema: { - type: 'string', + type: "string", }, }, { - name: 'p1', - in: 'path', + name: "p1", + in: "path", schema: { - type: 'string', + type: "string", }, }, ], get: { parameters: [ { - name: 'p3', - in: 'query', + name: "p3", + in: "query", schema: { - type: 'string', + type: "string", }, }, ], }, }, - '/test2/{p1}/foo/{p2}/bar/{p3}': { + "/test2/{p1}/foo/{p2}/bar/{p3}": { parameters: [ { - name: 'p1', - in: 'path', + name: "p1", + in: "path", schema: { - type: 'string', + type: "string", }, }, ], get: { parameters: [ { - name: 'p3', - in: 'path', + name: "p3", + in: "path", schema: { - type: 'string', + type: "string", }, }, { - name: 'p2', - in: 'path', + name: "p2", + in: "path", schema: { - type: 'string', + type: "string", }, }, ], }, }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(2); - expect(results[0].path.join('.')).toBe('paths./test1/{p1}/foo/{p2}.parameters'); - expect(results[1].path.join('.')).toBe('paths./test2/{p1}/foo/{p2}/bar/{p3}.get.parameters'); - }); -}); + expect(results.length).toBe(2) + expect(results[0].path.join(".")).toBe("paths./test1/{p1}/foo/{p2}.parameters") + expect(results[1].path.join(".")).toBe("paths./test2/{p1}/foo/{p2}/bar/{p3}.get.parameters") + }) +}) -test('ParameterOrder should find no oas3 errors', () => { +test("ParameterOrder should find no oas3 errors", () => { const oasDoc = { - openapi: '3.0.3', + openapi: "3.0.3", paths: { - '/test1/{p1}/foo/{p2}': { + "/test1/{p1}/foo/{p2}": { parameters: [ { - name: 'p1', - in: 'path', + name: "p1", + in: "path", schema: { - type: 'string', + type: "string", }, }, { - name: 'p2', - in: 'path', + name: "p2", + in: "path", schema: { - type: 'string', + type: "string", }, }, ], get: { parameters: [ { - name: 'p3', - in: 'query', + name: "p3", + in: "query", schema: { - type: 'string', + type: "string", }, }, ], }, }, - '/test2/{p1}/foo/{p2}/bar/{p3}': { + "/test2/{p1}/foo/{p2}/bar/{p3}": { parameters: [ { - name: 'p1', - in: 'path', + name: "p1", + in: "path", schema: { - type: 'string', + type: "string", }, }, ], get: { parameters: [ { - name: 'p2', - in: 'path', + name: "p2", + in: "path", schema: { - type: 'string', + type: "string", }, }, { - name: 'p3', - in: 'path', + name: "p3", + in: "path", schema: { - type: 'string', + type: "string", }, }, ], }, }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/patch-body-parameters.test.ts b/packages/rulesets/src/spectral/test/patch-body-parameters.test.ts index 173b5cf3f..cc95de390 100644 --- a/packages/rulesets/src/spectral/test/patch-body-parameters.test.ts +++ b/packages/rulesets/src/spectral/test/patch-body-parameters.test.ts @@ -1,159 +1,156 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('PatchBodyParametersSchema'); - return linter; -}); + linter = await linterForRule("PatchBodyParametersSchema") + return linter +}) -test('PatchBodyParametersSchema should find errors for default value body parameter', () => { +test("PatchBodyParametersSchema should find errors for default value body parameter", () => { const oasDoc = { - "swagger": "2.0", - "paths": { - "/foo": { - "patch": { - "tags": [ "SampleTag" ], - "operationId": "Foo_Update", - "description": "Test Description", - "parameters": [ - { - "name": "foo_patch", - "in": "body", - "schema": { - "$ref": "#/definitions/FooRequestParams" - }, - } - ], - "responses": { - } - } - } + swagger: "2.0", + paths: { + "/foo": { + patch: { + tags: ["SampleTag"], + operationId: "Foo_Update", + description: "Test Description", + parameters: [ + { + name: "foo_patch", + in: "body", + schema: { + $ref: "#/definitions/FooRequestParams", + }, + }, + ], + responses: {}, + }, + }, }, - "definitions": { - "FooRequestParams": { - "allOf": [ + definitions: { + FooRequestParams: { + allOf: [ { - "$ref": "#/definitions/FooProps" - } - ] + $ref: "#/definitions/FooProps", + }, + ], + }, + FooProps: { + properties: { + prop0: { + type: "string", + default: "my def val", + }, + }, }, - "FooProps": { - "properties": { - "prop0": { - "type": "string", - "default": "my def val" - } - } - } - } - }; + }, + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(1); - expect(results[0].path.join('.')).toBe('paths./foo.patch.parameters.0.schema'); - expect(results[0].message).toContain('Properties of a PATCH request body must not have default value, property:prop0.'); - }); -}); + expect(results.length).toBe(1) + expect(results[0].path.join(".")).toBe("paths./foo.patch.parameters.0.schema") + expect(results[0].message).toContain("Properties of a PATCH request body must not have default value, property:prop0.") + }) +}) -test('PatchBodyParametersSchema should find errors for required/create value', () => { +test("PatchBodyParametersSchema should find errors for required/create value", () => { const oasDoc = { - "swagger": "2.0", - "paths": { - "/foo": { - "patch": { - "tags": [ "SampleTag" ], - "operationId": "Foo_Update", - "description": "Test Description", - "parameters": [ - { - "name": "foo_patch", - "in": "body", - "schema": { - "$ref": "#/definitions/FooRequestParams" - }, - } - ], - "responses": { - } - } - } + swagger: "2.0", + paths: { + "/foo": { + patch: { + tags: ["SampleTag"], + operationId: "Foo_Update", + description: "Test Description", + parameters: [ + { + name: "foo_patch", + in: "body", + schema: { + $ref: "#/definitions/FooRequestParams", + }, + }, + ], + responses: {}, + }, + }, }, - "definitions": { - "FooRequestParams": { - "allOf": [ + definitions: { + FooRequestParams: { + allOf: [ { - "$ref": "#/definitions/FooProps" - } - ] + $ref: "#/definitions/FooProps", + }, + ], }, - "FooProps": { - "properties": { - "prop0": { - "type": "string", + FooProps: { + properties: { + prop0: { + type: "string", + }, + prop1: { + type: "string", + "x-ms-mutability": ["create"], }, - "prop1": { - "type": "string", - "x-ms-mutability": ["create"] - } }, - required:["prop0"] - } - } - }; + required: ["prop0"], + }, + }, + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(2); - expect(results[0].path.join('.')).toBe('paths./foo.patch.parameters.0.schema'); - expect(results[0].message).toContain('Properties of a PATCH request body must not be required, property:prop0.'); - expect(results[1].path.join('.')).toBe('paths./foo.patch.parameters.0.schema'); - expect(results[1].message).toContain('Properties of a PATCH request body must not be x-ms-mutability: ["create"], property:prop1.'); - }); -}); + expect(results.length).toBe(2) + expect(results[0].path.join(".")).toBe("paths./foo.patch.parameters.0.schema") + expect(results[0].message).toContain("Properties of a PATCH request body must not be required, property:prop0.") + expect(results[1].path.join(".")).toBe("paths./foo.patch.parameters.0.schema") + expect(results[1].message).toContain('Properties of a PATCH request body must not be x-ms-mutability: ["create"], property:prop1.') + }) +}) -test('PatchBodyParametersSchema should find no errors', () => { +test("PatchBodyParametersSchema should find no errors", () => { const oasDoc = { - "swagger": "2.0", - "paths": { - "/foo": { - "patch": { - "tags": [ "SampleTag" ], - "operationId": "Foo_Update", - "description": "Test Description", - "parameters": [ - { - "name": "foo_patch", - "in": "body", - "schema": { - "$ref": "#/definitions/FooRequestParams" - }, - } - ], - "responses": { - } - } - } + swagger: "2.0", + paths: { + "/foo": { + patch: { + tags: ["SampleTag"], + operationId: "Foo_Update", + description: "Test Description", + parameters: [ + { + name: "foo_patch", + in: "body", + schema: { + $ref: "#/definitions/FooRequestParams", + }, + }, + ], + responses: {}, + }, + }, }, - "definitions": { - "FooRequestParams": { - "allOf": [ + definitions: { + FooRequestParams: { + allOf: [ { - "$ref": "#/definitions/FooProps" - } - ] + $ref: "#/definitions/FooProps", + }, + ], }, - "FooProps": { - "properties": { - "prop0": { - "type": "string", + FooProps: { + properties: { + prop0: { + type: "string", + }, + prop1: { + type: "string", }, - "prop1": { - "type": "string" - } }, - } - } - }; + }, + }, + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(0); - }); -}); \ No newline at end of file + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/patch-content-type.test.ts b/packages/rulesets/src/spectral/test/patch-content-type.test.ts index 1d4d8ccc1..6811820b0 100644 --- a/packages/rulesets/src/spectral/test/patch-content-type.test.ts +++ b/packages/rulesets/src/spectral/test/patch-content-type.test.ts @@ -1,80 +1,61 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('PatchContentType'); - return linter; -}); + linter = await linterForRule("PatchContentType") + return linter +}) -test('PatchContentType should find errors', () => { +test("PatchContentType should find errors", () => { const oasDoc = { - swagger: '2.0', - consumes: [ - 'application/json', - 'application/merge-patch+json', - ], + swagger: "2.0", + consumes: ["application/json", "application/merge-patch+json"], paths: { - '/test1': { + "/test1": { put: { - consumes: [ - 'application/json', - 'application/merge-patch+json', - ], + consumes: ["application/json", "application/merge-patch+json"], }, post: { - consumes: [ - 'application/json', - 'application/merge-patch+json', - ], - }, - patch: { + consumes: ["application/json", "application/merge-patch+json"], }, + patch: {}, }, - '/test2': { + "/test2": { patch: { - consumes: [ - 'application/json', - ], + consumes: ["application/json"], }, }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(5); - expect(results[0].path.join('.')).toBe('consumes'); - expect(results[1].path.join('.')).toBe('paths./test1.put.consumes'); - expect(results[2].path.join('.')).toBe('paths./test1.post.consumes'); - expect(results[3].path.join('.')).toBe('paths./test1.patch'); - expect(results[4].path.join('.')).toBe('paths./test2.patch.consumes'); - }); -}); + expect(results.length).toBe(5) + expect(results[0].path.join(".")).toBe("consumes") + expect(results[1].path.join(".")).toBe("paths./test1.put.consumes") + expect(results[2].path.join(".")).toBe("paths./test1.post.consumes") + expect(results[3].path.join(".")).toBe("paths./test1.patch") + expect(results[4].path.join(".")).toBe("paths./test2.patch.consumes") + }) +}) -test('PatchContentType should find no errors', () => { +test("PatchContentType should find no errors", () => { const oasDoc = { - swagger: '2.0', - consumes: [ - 'application/json', - ], + swagger: "2.0", + consumes: ["application/json"], paths: { - '/test1': { + "/test1": { put: { - consumes: [ - 'application/json', - ], - }, - post: { + consumes: ["application/json"], }, + post: {}, patch: { - consumes: [ - 'application/merge-patch+json', - ], + consumes: ["application/merge-patch+json"], }, }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/patch-in-operation-name.test.ts b/packages/rulesets/src/spectral/test/patch-in-operation-name.test.ts index 988abada5..5f19dd450 100644 --- a/packages/rulesets/src/spectral/test/patch-in-operation-name.test.ts +++ b/packages/rulesets/src/spectral/test/patch-in-operation-name.test.ts @@ -1,12 +1,12 @@ -import {Spectral} from "@stoplight/spectral-core"; -import linterForRule from "./utils"; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter: Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule("PatchInOperationName"); - return linter; -}); + linter = await linterForRule("PatchInOperationName") + return linter +}) test("PatchInOperationName should find errors", () => { const myOpenApiDocument = { @@ -23,12 +23,12 @@ test("PatchInOperationName should find errors", () => { }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - expect(results[0].path.join(".")).toBe("paths./api/Paths.patch.operationId"); - }); -}); + expect(results.length).toBe(1) + expect(results[0].path.join(".")).toBe("paths./api/Paths.patch.operationId") + }) +}) test("PatchInOperationName should find no errors", () => { const myOpenApiDocument = { @@ -45,8 +45,8 @@ test("PatchInOperationName should find no errors", () => { }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/path-characters.test.ts b/packages/rulesets/src/spectral/test/path-characters.test.ts index 5c1288c86..ea1659351 100644 --- a/packages/rulesets/src/spectral/test/path-characters.test.ts +++ b/packages/rulesets/src/spectral/test/path-characters.test.ts @@ -1,40 +1,40 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('PathCharacters'); - return linter; -}); + linter = await linterForRule("PathCharacters") + return linter +}) -test('PathCharacters should find errors', () => { +test("PathCharacters should find errors", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/api[]': {}, - '/foo:bar/{baz}': {}, - '/foo/{bar}:baz/qux': {}, + "/api[]": {}, + "/foo:bar/{baz}": {}, + "/foo/{bar}:baz/qux": {}, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(3); - expect(results[0].path.join('.')).toBe('paths./api[]'); - expect(results[1].path.join('.')).toBe('paths./foo:bar/{baz}'); - expect(results[2].path.join('.')).toBe('paths./foo/{bar}:baz/qux'); - }); -}); + expect(results.length).toBe(3) + expect(results[0].path.join(".")).toBe("paths./api[]") + expect(results[1].path.join(".")).toBe("paths./foo:bar/{baz}") + expect(results[2].path.join(".")).toBe("paths./foo/{bar}:baz/qux") + }) +}) -test('PathCharacters should find no errors', () => { +test("PathCharacters should find no errors", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/abcdefghijklmnopqrstuvwxyz0123456789': {}, - '/A0.B1.C2/D3_E4_F5/GHI-JKL-MNO/~PQRSTUVWXYZ': {}, - '/foo/{$#@&^}:goo': {}, + "/abcdefghijklmnopqrstuvwxyz0123456789": {}, + "/A0.B1.C2/D3_E4_F5/GHI-JKL-MNO/~PQRSTUVWXYZ": {}, + "/foo/{$#@&^}:goo": {}, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/path-param-names.test.ts b/packages/rulesets/src/spectral/test/path-param-names.test.ts index af425814d..a3991f148 100644 --- a/packages/rulesets/src/spectral/test/path-param-names.test.ts +++ b/packages/rulesets/src/spectral/test/path-param-names.test.ts @@ -1,73 +1,73 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('PathParameterNames'); - return linter; -}); + linter = await linterForRule("PathParameterNames") + return linter +}) -test('PathParameterNames should find errors', () => { +test("PathParameterNames should find errors", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/foo/{p1}': {}, - '/foo/{p2}/bar/{p3}': {}, - '/bar/{p4}': {}, + "/foo/{p1}": {}, + "/foo/{p2}/bar/{p3}": {}, + "/bar/{p4}": {}, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(2); - expect(results[0].path.join('.')).toBe('paths./foo/{p2}/bar/{p3}'); - expect(results[0].message).toContain('Inconsistent path parameter names "p2" and "p1"'); - expect(results[1].path.join('.')).toBe('paths./bar/{p4}'); - expect(results[1].message).toContain('Inconsistent path parameter names "p4" and "p3"'); - }); -}); + expect(results.length).toBe(2) + expect(results[0].path.join(".")).toBe("paths./foo/{p2}/bar/{p3}") + expect(results[0].message).toContain('Inconsistent path parameter names "p2" and "p1"') + expect(results[1].path.join(".")).toBe("paths./bar/{p4}") + expect(results[1].message).toContain('Inconsistent path parameter names "p4" and "p3"') + }) +}) -test('PathParameterNames should find no errors', () => { +test("PathParameterNames should find no errors", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/foo/{p1}': {}, - '/foo/{p1}/bar/{p2}': {}, - '/bar/{p2}': {}, + "/foo/{p1}": {}, + "/foo/{p1}/bar/{p2}": {}, + "/bar/{p2}": {}, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) -test('PathParameterNames should find oas3 errors', () => { +test("PathParameterNames should find oas3 errors", () => { const oasDoc = { - openapi: '3.0', + openapi: "3.0", paths: { - '/foo/{p1}': {}, - '/foo/{p2}/bar/{p3}': {}, - '/bar/{p4}': {}, + "/foo/{p1}": {}, + "/foo/{p2}/bar/{p3}": {}, + "/bar/{p4}": {}, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(2); - expect(results[0].path.join('.')).toBe('paths./foo/{p2}/bar/{p3}'); - expect(results[0].message).toContain('Inconsistent path parameter names "p2" and "p1"'); - expect(results[1].path.join('.')).toBe('paths./bar/{p4}'); - expect(results[1].message).toContain('Inconsistent path parameter names "p4" and "p3"'); - }); -}); + expect(results.length).toBe(2) + expect(results[0].path.join(".")).toBe("paths./foo/{p2}/bar/{p3}") + expect(results[0].message).toContain('Inconsistent path parameter names "p2" and "p1"') + expect(results[1].path.join(".")).toBe("paths./bar/{p4}") + expect(results[1].message).toContain('Inconsistent path parameter names "p4" and "p3"') + }) +}) -test('PathParameterNames should find no oas3 errors', () => { +test("PathParameterNames should find no oas3 errors", () => { const oasDoc = { - openapi: '3.0', + openapi: "3.0", paths: { - '/foo/{p1}': {}, - '/foo/{p1}/bar/{p2}': {}, - '/bar/{p2}': {}, + "/foo/{p1}": {}, + "/foo/{p1}/bar/{p2}": {}, + "/bar/{p2}": {}, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/path-param-schema.test.ts b/packages/rulesets/src/spectral/test/path-param-schema.test.ts index e57745680..20d7aa4d2 100644 --- a/packages/rulesets/src/spectral/test/path-param-schema.test.ts +++ b/packages/rulesets/src/spectral/test/path-param-schema.test.ts @@ -1,46 +1,46 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('PathParameterSchema'); - return linter; -}); + linter = await linterForRule("PathParameterSchema") + return linter +}) -test('PathParameterSchema should find errors', () => { +test("PathParameterSchema should find errors", () => { // Test path parameter in 3 different places: // 1. parameter at path level // 2. inline parameter at operation level // 3. referenced parameter at operation level const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/foo/{p1}': { + "/foo/{p1}": { parameters: [ { - name: 'p1', - in: 'path', - type: 'integer', + name: "p1", + in: "path", + type: "integer", }, ], }, - '/bar/{p2}/baz/{p3}/foo/{p4}': { + "/bar/{p2}/baz/{p3}/foo/{p4}": { get: { parameters: [ { - $ref: '#/parameters/Param2', + $ref: "#/parameters/Param2", }, { - name: 'p3', - in: 'path', - type: 'string', + name: "p3", + in: "path", + type: "string", maxLength: 50, }, { - name: 'p4', - in: 'path', - type: 'string', + name: "p4", + in: "path", + type: "string", maxLength: 2083, }, ], @@ -49,55 +49,55 @@ test('PathParameterSchema should find errors', () => { }, parameters: { Param2: { - name: 'p2', - in: 'path', - type: 'string', + name: "p2", + in: "path", + type: "string", }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(5); - expect(results[0].path.join('.')).toBe('paths./foo/{p1}.parameters.0'); - expect(results[0].message).toContain('should specify a maximum length'); - expect(results[0].message).toContain('and characters allowed'); - expect(results[1].path.join('.')).toBe('paths./foo/{p1}.parameters.0.type'); - expect(results[1].message).toContain('should be defined as type: string'); - expect(results[2].path.join('.')).toBe('paths./bar/{p2}/baz/{p3}/foo/{p4}.get.parameters.0'); - expect(results[2].message).toContain('should specify a maximum length'); - expect(results[3].path.join('.')).toBe('paths./bar/{p2}/baz/{p3}/foo/{p4}.get.parameters.1'); - expect(results[3].message).toContain('should specify characters allowed'); - expect(results[4].path.join('.')).toBe('paths./bar/{p2}/baz/{p3}/foo/{p4}.get.parameters.2'); - expect(results[4].message).toContain('should be less than'); - }); -}); + expect(results.length).toBe(5) + expect(results[0].path.join(".")).toBe("paths./foo/{p1}.parameters.0") + expect(results[0].message).toContain("should specify a maximum length") + expect(results[0].message).toContain("and characters allowed") + expect(results[1].path.join(".")).toBe("paths./foo/{p1}.parameters.0.type") + expect(results[1].message).toContain("should be defined as type: string") + expect(results[2].path.join(".")).toBe("paths./bar/{p2}/baz/{p3}/foo/{p4}.get.parameters.0") + expect(results[2].message).toContain("should specify a maximum length") + expect(results[3].path.join(".")).toBe("paths./bar/{p2}/baz/{p3}/foo/{p4}.get.parameters.1") + expect(results[3].message).toContain("should specify characters allowed") + expect(results[4].path.join(".")).toBe("paths./bar/{p2}/baz/{p3}/foo/{p4}.get.parameters.2") + expect(results[4].message).toContain("should be less than") + }) +}) -test('PathParameterSchema should find no errors', () => { +test("PathParameterSchema should find no errors", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/foo/{p1}': { + "/foo/{p1}": { parameters: [ { - name: 'p1', - in: 'path', - type: 'string', + name: "p1", + in: "path", + type: "string", maxLength: 50, - pattern: '/[a-z]+/', + pattern: "/[a-z]+/", }, ], }, - '/bar/{p2}/baz/{p3}': { + "/bar/{p2}/baz/{p3}": { get: { parameters: [ { - $ref: '#/parameters/Param2', + $ref: "#/parameters/Param2", }, { - name: 'p3', - in: 'path', - type: 'string', + name: "p3", + in: "path", + type: "string", maxLength: 50, - pattern: '/[a-z]+/', + pattern: "/[a-z]+/", }, ], }, @@ -105,45 +105,45 @@ test('PathParameterSchema should find no errors', () => { }, parameters: { Param2: { - name: 'p2', - in: 'path', - type: 'string', + name: "p2", + in: "path", + type: "string", maxLength: 50, - pattern: '/[a-z]+/', + pattern: "/[a-z]+/", }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) -test('PathParameterSchema should find oas3 errors', () => { +test("PathParameterSchema should find oas3 errors", () => { const oasDoc = { - openapi: '3.0', + openapi: "3.0", paths: { - '/foo/{p1}': { + "/foo/{p1}": { parameters: [ { - name: 'p1', - in: 'path', + name: "p1", + in: "path", schema: { - type: 'integer', + type: "integer", }, }, ], }, - '/bar/{p2}/baz/{p3}': { + "/bar/{p2}/baz/{p3}": { get: { parameters: [ { - $ref: '#/components/parameters/Param2', + $ref: "#/components/parameters/Param2", }, { - name: 'p3', - in: 'path', + name: "p3", + in: "path", schema: { - type: 'string', + type: "string", maxLength: 50, }, }, @@ -154,59 +154,59 @@ test('PathParameterSchema should find oas3 errors', () => { components: { parameters: { Param2: { - name: 'p2', - in: 'path', + name: "p2", + in: "path", schema: { - type: 'string', + type: "string", }, }, }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(4); - expect(results[0].path.join('.')).toBe('paths./foo/{p1}.parameters.0.schema'); - expect(results[0].message).toContain('should specify a maximum length'); - expect(results[0].message).toContain('and characters allowed'); - expect(results[1].path.join('.')).toBe('paths./foo/{p1}.parameters.0.schema.type'); - expect(results[1].message).toContain('should be defined as type: string'); - expect(results[2].path.join('.')).toBe('paths./bar/{p2}/baz/{p3}.get.parameters.0.schema'); - expect(results[2].message).toContain('should specify a maximum length'); - expect(results[3].path.join('.')).toBe('paths./bar/{p2}/baz/{p3}.get.parameters.1.schema'); - expect(results[3].message).toContain('should specify characters allowed'); - }); -}); + expect(results.length).toBe(4) + expect(results[0].path.join(".")).toBe("paths./foo/{p1}.parameters.0.schema") + expect(results[0].message).toContain("should specify a maximum length") + expect(results[0].message).toContain("and characters allowed") + expect(results[1].path.join(".")).toBe("paths./foo/{p1}.parameters.0.schema.type") + expect(results[1].message).toContain("should be defined as type: string") + expect(results[2].path.join(".")).toBe("paths./bar/{p2}/baz/{p3}.get.parameters.0.schema") + expect(results[2].message).toContain("should specify a maximum length") + expect(results[3].path.join(".")).toBe("paths./bar/{p2}/baz/{p3}.get.parameters.1.schema") + expect(results[3].message).toContain("should specify characters allowed") + }) +}) -test('PathParameterSchema should find no oas3 errors', () => { +test("PathParameterSchema should find no oas3 errors", () => { const oasDoc = { - openapi: '3.0', + openapi: "3.0", paths: { - '/foo/{p1}': { + "/foo/{p1}": { parameters: [ { - name: 'p1', - in: 'path', + name: "p1", + in: "path", schema: { - type: 'string', + type: "string", maxLength: 50, - pattern: '/[a-z]+/', + pattern: "/[a-z]+/", }, }, ], }, - '/bar/{p2}/baz/{p3}': { + "/bar/{p2}/baz/{p3}": { get: { parameters: [ { - $ref: '#/components/parameters/Param2', + $ref: "#/components/parameters/Param2", }, { - name: 'p3', - in: 'path', + name: "p3", + in: "path", schema: { - type: 'string', + type: "string", maxLength: 50, - pattern: '/[a-z]+/', + pattern: "/[a-z]+/", }, }, ], @@ -216,18 +216,18 @@ test('PathParameterSchema should find no oas3 errors', () => { components: { parameters: { Param2: { - name: 'p2', - in: 'path', + name: "p2", + in: "path", schema: { - type: 'string', + type: "string", maxLength: 50, - pattern: '/[a-z]+/', + pattern: "/[a-z]+/", }, }, }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/property-description.test.ts b/packages/rulesets/src/spectral/test/property-description.test.ts index b55deeca7..065519439 100644 --- a/packages/rulesets/src/spectral/test/property-description.test.ts +++ b/packages/rulesets/src/spectral/test/property-description.test.ts @@ -1,12 +1,12 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('PropertyDescription'); - return linter; -}); + linter = await linterForRule("PropertyDescription") + return linter +}) // Test for missing property description in // - inline body parameter schema @@ -14,27 +14,27 @@ beforeAll(async () => { // - top-level schema in definitions // - inner schema in definitions -test('PropertyDescription should find errors', () => { +test("PropertyDescription should find errors", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/test1': { + "/test1": { post: { parameters: [ { - name: 'version', - in: 'body', + name: "version", + in: "body", schema: { - type: 'object', + type: "object", properties: { prop1: { - type: 'string', + type: "string", }, prop2: { - type: 'object', + type: "object", properties: { prop3: { - type: 'string', + type: "string", }, }, }, @@ -44,18 +44,18 @@ test('PropertyDescription should find errors', () => { ], responses: { 200: { - description: 'Success', + description: "Success", schema: { - type: 'object', + type: "object", properties: { propA: { - type: 'string', + type: "string", }, propB: { - type: 'object', + type: "object", properties: { propC: { - type: 'string', + type: "string", }, }, }, @@ -68,67 +68,67 @@ test('PropertyDescription should find errors', () => { }, definitions: { Model1: { - type: 'object', + type: "object", properties: { propW: { - type: 'string', + type: "string", }, propX: { - type: 'object', + type: "object", properties: { propY: { - type: 'string', + type: "string", }, }, }, propZ: { - $ref: '#/definitions/PropZ', + $ref: "#/definitions/PropZ", }, }, }, PropZ: { - type: 'string', + type: "string", }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(9); - expect(results[0].path.join('.')).toBe('paths./test1.post.parameters.0.schema.properties.prop1'); - expect(results[1].path.join('.')).toBe('paths./test1.post.parameters.0.schema.properties.prop2'); - expect(results[2].path.join('.')).toBe('paths./test1.post.parameters.0.schema.properties.prop2.properties.prop3'); - expect(results[3].path.join('.')).toBe('paths./test1.post.responses.200.schema.properties.propA'); - expect(results[4].path.join('.')).toBe('paths./test1.post.responses.200.schema.properties.propB'); - expect(results[5].path.join('.')).toBe('paths./test1.post.responses.200.schema.properties.propB.properties.propC'); - expect(results[6].path.join('.')).toBe('definitions.Model1.properties.propW'); - expect(results[7].path.join('.')).toBe('definitions.Model1.properties.propX'); - expect(results[8].path.join('.')).toBe('definitions.Model1.properties.propX.properties.propY'); - }); -}); + expect(results.length).toBe(9) + expect(results[0].path.join(".")).toBe("paths./test1.post.parameters.0.schema.properties.prop1") + expect(results[1].path.join(".")).toBe("paths./test1.post.parameters.0.schema.properties.prop2") + expect(results[2].path.join(".")).toBe("paths./test1.post.parameters.0.schema.properties.prop2.properties.prop3") + expect(results[3].path.join(".")).toBe("paths./test1.post.responses.200.schema.properties.propA") + expect(results[4].path.join(".")).toBe("paths./test1.post.responses.200.schema.properties.propB") + expect(results[5].path.join(".")).toBe("paths./test1.post.responses.200.schema.properties.propB.properties.propC") + expect(results[6].path.join(".")).toBe("definitions.Model1.properties.propW") + expect(results[7].path.join(".")).toBe("definitions.Model1.properties.propX") + expect(results[8].path.join(".")).toBe("definitions.Model1.properties.propX.properties.propY") + }) +}) -test('PropertyDescription should find no errors', () => { +test("PropertyDescription should find no errors", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/test1': { + "/test1": { post: { parameters: [ { - name: 'version', - in: 'body', + name: "version", + in: "body", schema: { - type: 'object', + type: "object", properties: { prop1: { - type: 'string', - description: 'prop1', + type: "string", + description: "prop1", }, prop2: { - type: 'object', - description: 'prop2', + type: "object", + description: "prop2", properties: { prop3: { - type: 'string', - description: 'prop3', + type: "string", + description: "prop3", }, }, }, @@ -138,21 +138,21 @@ test('PropertyDescription should find no errors', () => { ], responses: { 200: { - description: 'Success', + description: "Success", schema: { - type: 'object', + type: "object", properties: { propA: { - type: 'string', - description: 'propA', + type: "string", + description: "propA", }, propB: { - type: 'object', - description: 'propB', + type: "object", + description: "propB", properties: { propC: { - type: 'string', - description: 'propC', + type: "string", + description: "propC", }, }, }, @@ -165,33 +165,33 @@ test('PropertyDescription should find no errors', () => { }, definitions: { Model1: { - type: 'object', + type: "object", properties: { propW: { - type: 'string', - description: 'propW', + type: "string", + description: "propW", }, propX: { - type: 'object', - description: 'propX', + type: "object", + description: "propX", properties: { propY: { - type: 'string', - description: 'propY', + type: "string", + description: "propY", }, }, }, propZ: { - $ref: '#/definitions/PropZ', + $ref: "#/definitions/PropZ", }, }, }, PropZ: { - type: 'string', + type: "string", }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/put-get-patch-schema.test.ts b/packages/rulesets/src/spectral/test/put-get-patch-schema.test.ts index 9b00b41a6..6aa2c38fe 100644 --- a/packages/rulesets/src/spectral/test/put-get-patch-schema.test.ts +++ b/packages/rulesets/src/spectral/test/put-get-patch-schema.test.ts @@ -1,183 +1,185 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('PutGetPatchResponseSchema'); - return linter; -}); + linter = await linterForRule("PutGetPatchResponseSchema") + return linter +}) -test('PutGetPatchResponseSchema should find errors for inconsistent resposne', () => { +test("PutGetPatchResponseSchema should find errors for inconsistent resposne", () => { const oasDoc = { - "swagger": "2.0", - "paths": { - "/foo": { - "patch": { - "tags": [ "SampleTag" ], - "operationId": "Foo_Update", - "description": "Test Description", - "parameters": [ - { - "name": "foo_patch", - "in": "body", - "schema": { - "$ref": "#/definitions/FooRequestParams" - }, - } - ], - "responses": { - "200":{ - schema: { - $ref :"#/definitions/FooResourceUpdate" - } - } - } + swagger: "2.0", + paths: { + "/foo": { + patch: { + tags: ["SampleTag"], + operationId: "Foo_Update", + description: "Test Description", + parameters: [ + { + name: "foo_patch", + in: "body", + schema: { + $ref: "#/definitions/FooRequestParams", + }, }, - "put": { - "tags": [ "SampleTag" ], - "operationId": "Foo_Update", - "description": "Test Description", - "parameters": [ - { - "name": "foo_patch", - "in": "body", - "schema": { - "$ref": "#/definitions/FooRequestParams" - }, - } - ], - "responses": { - "200":{ - schema: { - $ref :"#/definitions/FooResource" - } - } - } - } - } + ], + responses: { + "200": { + schema: { + $ref: "#/definitions/FooResourceUpdate", + }, + }, + }, + }, + put: { + tags: ["SampleTag"], + operationId: "Foo_Update", + description: "Test Description", + parameters: [ + { + name: "foo_patch", + in: "body", + schema: { + $ref: "#/definitions/FooRequestParams", + }, + }, + ], + responses: { + "200": { + schema: { + $ref: "#/definitions/FooResource", + }, + }, + }, + }, + }, }, - "definitions": { - "FooRequestParams": { - "allOf": [ + definitions: { + FooRequestParams: { + allOf: [ { - "$ref": "#/definitions/FooProps" - } - ] + $ref: "#/definitions/FooProps", + }, + ], }, - "FooResource": { - "allOf": [ + FooResource: { + allOf: [ { - "$ref": "#/definitions/FooProps" - } - ] + $ref: "#/definitions/FooProps", + }, + ], }, - "FooResourceUpdate": { - "allOf": [ + FooResourceUpdate: { + allOf: [ { - "$ref": "#/definitions/FooProps" - } - ] + $ref: "#/definitions/FooProps", + }, + ], + }, + FooProps: { + properties: { + prop0: { + type: "string", + default: "my def val", + }, + }, }, - "FooProps": { - "properties": { - "prop0": { - "type": "string", - "default": "my def val" - } - } - } - } - }; + }, + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(1); - expect(results[0].path.join('.')).toBe('paths./foo'); - expect(results[0].message).toContain("/foo has different responses for PUT/GET/PATCH operations. The PUT/GET/PATCH operations must have same schema response."); - }); -}); + expect(results.length).toBe(1) + expect(results[0].path.join(".")).toBe("paths./foo") + expect(results[0].message).toContain( + "/foo has different responses for PUT/GET/PATCH operations. The PUT/GET/PATCH operations must have same schema response." + ) + }) +}) -test('PutGetPatchResponseSchema should find no errors', () => { +test("PutGetPatchResponseSchema should find no errors", () => { const oasDoc = { - "swagger": "2.0", - "paths": { - "/foo": { - "patch": { - "tags": [ "SampleTag" ], - "operationId": "Foo_Update", - "description": "Test Description", - "parameters": [ - { - "name": "foo_patch", - "in": "body", - "schema": { - "$ref": "#/definitions/FooRequestParams" - }, - } - ], - "responses": { - "200":{ - schema: { - $ref :"#/definitions/FooResource" - } - } - } + swagger: "2.0", + paths: { + "/foo": { + patch: { + tags: ["SampleTag"], + operationId: "Foo_Update", + description: "Test Description", + parameters: [ + { + name: "foo_patch", + in: "body", + schema: { + $ref: "#/definitions/FooRequestParams", + }, }, - "put": { - "tags": [ "SampleTag" ], - "operationId": "Foo_Update", - "description": "Test Description", - "parameters": [ - { - "name": "foo_patch", - "in": "body", - "schema": { - "$ref": "#/definitions/FooRequestParams" - }, - } - ], - "responses": { - "200":{ - schema: { - $ref :"#/definitions/FooResource" - } - } - } - } - } + ], + responses: { + "200": { + schema: { + $ref: "#/definitions/FooResource", + }, + }, + }, + }, + put: { + tags: ["SampleTag"], + operationId: "Foo_Update", + description: "Test Description", + parameters: [ + { + name: "foo_patch", + in: "body", + schema: { + $ref: "#/definitions/FooRequestParams", + }, + }, + ], + responses: { + "200": { + schema: { + $ref: "#/definitions/FooResource", + }, + }, + }, + }, + }, }, - "definitions": { - "FooRequestParams": { - "allOf": [ + definitions: { + FooRequestParams: { + allOf: [ { - "$ref": "#/definitions/FooProps" - } - ] + $ref: "#/definitions/FooProps", + }, + ], }, - "FooResource": { - "allOf": [ + FooResource: { + allOf: [ { - "$ref": "#/definitions/FooProps" - } - ] + $ref: "#/definitions/FooProps", + }, + ], }, - "FooResourceUpdate": { - "allOf": [ + FooResourceUpdate: { + allOf: [ { - "$ref": "#/definitions/FooProps" - } - ] + $ref: "#/definitions/FooProps", + }, + ], + }, + FooProps: { + properties: { + prop0: { + type: "string", + default: "my def val", + }, + }, }, - "FooProps": { - "properties": { - "prop0": { - "type": "string", - "default": "my def val" - } - } - } - } - }; + }, + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(0); - }); -}); \ No newline at end of file + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/put-in-operation-name.test.ts b/packages/rulesets/src/spectral/test/put-in-operation-name.test.ts index 2a3f046d0..2646a3043 100644 --- a/packages/rulesets/src/spectral/test/put-in-operation-name.test.ts +++ b/packages/rulesets/src/spectral/test/put-in-operation-name.test.ts @@ -1,12 +1,12 @@ -import {Spectral} from "@stoplight/spectral-core"; -import linterForRule from "./utils"; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter: Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule("PutInOperationName"); - return linter; -}); + linter = await linterForRule("PutInOperationName") + return linter +}) test("PutInOperationName should find errors", () => { const myOpenApiDocument = { @@ -23,12 +23,12 @@ test("PutInOperationName should find errors", () => { }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - expect(results[0].path.join(".")).toBe("paths./api/Paths.put.operationId"); - }); -}); + expect(results.length).toBe(1) + expect(results[0].path.join(".")).toBe("paths./api/Paths.put.operationId") + }) +}) test("PutInOperationName should find no errors", () => { const myOpenApiDocument = { @@ -45,8 +45,8 @@ test("PutInOperationName should find no errors", () => { }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/put-path.test.ts b/packages/rulesets/src/spectral/test/put-path.test.ts index 1c50de98c..1b7ca0343 100644 --- a/packages/rulesets/src/spectral/test/put-path.test.ts +++ b/packages/rulesets/src/spectral/test/put-path.test.ts @@ -1,47 +1,47 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('PutPath'); - return linter; -}); + linter = await linterForRule("PutPath") + return linter +}) -test('PutPath should find errors', () => { +test("PutPath should find errors", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/bar/baz': { + "/bar/baz": { put: {}, }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(1); - expect(results[0].path.join('.')).toBe('paths./bar/baz'); - }); -}); + expect(results.length).toBe(1) + expect(results[0].path.join(".")).toBe("paths./bar/baz") + }) +}) -test('PutPath should find no errors', () => { +test("PutPath should find no errors", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/bar/{p1}': { + "/bar/{p1}": { put: { parameters: [ { - name: 'p1', - in: 'path', - type: 'string', + name: "p1", + in: "path", + type: "string", maxLength: 50, }, ], }, }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/put-request-response-scheme.test.ts b/packages/rulesets/src/spectral/test/put-request-response-scheme.test.ts index 4ec324cf3..97330755a 100644 --- a/packages/rulesets/src/spectral/test/put-request-response-scheme.test.ts +++ b/packages/rulesets/src/spectral/test/put-request-response-scheme.test.ts @@ -1,12 +1,12 @@ -import {Spectral} from "@stoplight/spectral-core"; -import linterForRule from "./utils"; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter: Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule("PutRequestResponseScheme"); - return linter; -}); + linter = await linterForRule("PutRequestResponseScheme") + return linter +}) test("PutRequestResponseScheme should find errors", () => { const myOpenApiDocument = { @@ -98,15 +98,15 @@ test("PutRequestResponseScheme should find errors", () => { }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); + expect(results.length).toBe(1) expect(results[0].message).toBe( "A PUT operation request body schema should be the same as its 200 response schema, to allow reusing the same entity between GET and PUT. If the schema of the PUT request body is a superset of the GET response body, make sure you have a PATCH operation to make the resource updatable. Operation: 'ConfigServers_Update' Request Model: 'parameters[2].schema' Response Model: 'responses[200].schema'" - ); - expect(results[0].path.join(".")).toBe("paths./api/configServers.put"); - }); -}); + ) + expect(results[0].path.join(".")).toBe("paths./api/configServers.put") + }) +}) test("PutRequestResponseScheme should find errors when response code 200 is not defined", () => { const myOpenApiDocument = { @@ -198,15 +198,15 @@ test("PutRequestResponseScheme should find errors when response code 200 is not }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); + expect(results.length).toBe(1) expect(results[0].message).toBe( "A PUT operation request body schema should be the same as its 200 response schema, to allow reusing the same entity between GET and PUT. If the schema of the PUT request body is a superset of the GET response body, make sure you have a PATCH operation to make the resource updatable. Operation: 'ConfigServers_Update' Request Model: 'parameters[2].schema' Response Model: 'responses[201].schema'" - ); - expect(results[0].path.join(".")).toBe("paths./api/configServers.put"); - }); -}); + ) + expect(results[0].path.join(".")).toBe("paths./api/configServers.put") + }) +}) test("PutRequestResponseScheme should find no errors", () => { const myOpenApiDocument = { @@ -298,8 +298,8 @@ test("PutRequestResponseScheme should find no errors", () => { }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/request-body-optional.test.ts b/packages/rulesets/src/spectral/test/request-body-optional.test.ts index 23bf5a41b..dffe3d15e 100644 --- a/packages/rulesets/src/spectral/test/request-body-optional.test.ts +++ b/packages/rulesets/src/spectral/test/request-body-optional.test.ts @@ -1,103 +1,103 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('RequestBodyOptional'); - return linter; -}); + linter = await linterForRule("RequestBodyOptional") + return linter +}) -test('RequestBodyOptional should find errors', () => { +test("RequestBodyOptional should find errors", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/test1': { + "/test1": { put: { parameters: [ { - name: 'body', - in: 'body', - type: 'string', + name: "body", + in: "body", + type: "string", }, ], }, }, - '/test2': { + "/test2": { patch: { parameters: [ { - name: 'body', - in: 'body', - type: 'string', + name: "body", + in: "body", + type: "string", }, ], }, }, - '/test3': { + "/test3": { post: { parameters: [ { - name: 'body', - in: 'body', - type: 'string', + name: "body", + in: "body", + type: "string", }, ], }, }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(3); - expect(results[0].path.join('.')).toBe('paths./test1.put.parameters.0'); - expect(results[1].path.join('.')).toBe('paths./test2.patch.parameters.0'); - expect(results[2].path.join('.')).toBe('paths./test3.post.parameters.0'); - }); -}); + expect(results.length).toBe(3) + expect(results[0].path.join(".")).toBe("paths./test1.put.parameters.0") + expect(results[1].path.join(".")).toBe("paths./test2.patch.parameters.0") + expect(results[2].path.join(".")).toBe("paths./test3.post.parameters.0") + }) +}) -test('RequestBodyOptional should find no errors', () => { +test("RequestBodyOptional should find no errors", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/test1': { + "/test1": { put: { parameters: [ { - name: 'body', - in: 'body', - type: 'string', + name: "body", + in: "body", + type: "string", required: true, }, ], }, }, - '/test2': { + "/test2": { patch: { parameters: [ { - name: 'body', - in: 'body', - type: 'string', + name: "body", + in: "body", + type: "string", required: true, }, ], }, }, - '/test3': { + "/test3": { post: { parameters: [ { - name: 'body', - in: 'body', - type: 'string', + name: "body", + in: "body", + type: "string", required: true, }, ], }, }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/required-read-only-properties.test.ts b/packages/rulesets/src/spectral/test/required-read-only-properties.test.ts index f182cadf1..4d27fb224 100644 --- a/packages/rulesets/src/spectral/test/required-read-only-properties.test.ts +++ b/packages/rulesets/src/spectral/test/required-read-only-properties.test.ts @@ -1,12 +1,12 @@ -import { Spectral } from "@stoplight/spectral-core"; -import linterForRule from "./utils"; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter: Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule("RequiredReadOnlyProperties"); - return linter; -}); + linter = await linterForRule("RequiredReadOnlyProperties") + return linter +}) test("RequiredReadOnlyProperties should find errors", () => { const myOpenApiDocument = { @@ -60,15 +60,13 @@ test("RequiredReadOnlyProperties should find errors", () => { description: "The Resource definition.", }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - expect(results[0].message).toBe( - "Property 'name' is a required property. It should not be marked as 'readonly'" - ); - expect(results[0].path.join(".")).toBe("definitions.ResponseResource"); - }); -}); + expect(results.length).toBe(1) + expect(results[0].message).toBe("Property 'name' is a required property. It should not be marked as 'readonly'") + expect(results[0].path.join(".")).toBe("definitions.ResponseResource") + }) +}) test("RequiredReadOnlyProperties should find no errors", () => { const myOpenApiDocument = { @@ -121,8 +119,8 @@ test("RequiredReadOnlyProperties should find no errors", () => { description: "The Resource definition.", }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/resource-has-x-ms-resource-enabled.test.ts b/packages/rulesets/src/spectral/test/resource-has-x-ms-resource-enabled.test.ts index 13b2a174c..d67f01205 100644 --- a/packages/rulesets/src/spectral/test/resource-has-x-ms-resource-enabled.test.ts +++ b/packages/rulesets/src/spectral/test/resource-has-x-ms-resource-enabled.test.ts @@ -1,12 +1,12 @@ -import { Spectral } from "@stoplight/spectral-core"; -import linterForRule from "./utils"; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter: Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule("ResourceHasXMsResourceEnabled"); - return linter; -}); + linter = await linterForRule("ResourceHasXMsResourceEnabled") + return linter +}) test("ResourceHasXMsResourceEnabled should find errors when there's no x-ms-azure-resource extension", () => { const myOpenApiDocument = { @@ -53,15 +53,13 @@ test("ResourceHasXMsResourceEnabled should find errors when there's no x-ms-azur }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - expect(results[0].message).toBe( - `A 'Resource' definition must have x-ms-azure-resource extension enabled and set to true.` - ); - expect(results[0].path.join(".")).toBe("definitions.Resource"); - }); -}); + expect(results.length).toBe(1) + expect(results[0].message).toBe(`A 'Resource' definition must have x-ms-azure-resource extension enabled and set to true.`) + expect(results[0].path.join(".")).toBe("definitions.Resource") + }) +}) test("ResourceHasXMsResourceEnabled should find errors when x-ms-azure-resource is false", () => { const myOpenApiDocument = { @@ -109,15 +107,13 @@ test("ResourceHasXMsResourceEnabled should find errors when x-ms-azure-resource }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - expect(results[0].message).toBe( - `A 'Resource' definition must have x-ms-azure-resource extension enabled and set to true.` - ); - expect(results[0].path.join(".")).toBe("definitions.Resource.x-ms-azure-resource"); - }); -}); + expect(results.length).toBe(1) + expect(results[0].message).toBe(`A 'Resource' definition must have x-ms-azure-resource extension enabled and set to true.`) + expect(results[0].path.join(".")).toBe("definitions.Resource.x-ms-azure-resource") + }) +}) test("ResourceHasXMsResourceEnabled should find no errors", () => { const myOpenApiDocument = { @@ -165,8 +161,8 @@ test("ResourceHasXMsResourceEnabled should find no errors", () => { }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/resources/Microsoft.Contoso/inconsistent-provider-namespace.json b/packages/rulesets/src/spectral/test/resources/Microsoft.Contoso/inconsistent-provider-namespace.json index 46b5695fc..1af564750 100644 --- a/packages/rulesets/src/spectral/test/resources/Microsoft.Contoso/inconsistent-provider-namespace.json +++ b/packages/rulesets/src/spectral/test/resources/Microsoft.Contoso/inconsistent-provider-namespace.json @@ -4,4 +4,4 @@ "/foo/{p1}": {}, "/{scope}/providers/Microsoft.Conto/bar/{p3}": {} } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/spectral/test/resources/Microsoft.Contoso/provider-namespace.json b/packages/rulesets/src/spectral/test/resources/Microsoft.Contoso/provider-namespace.json index 46b5695fc..1af564750 100644 --- a/packages/rulesets/src/spectral/test/resources/Microsoft.Contoso/provider-namespace.json +++ b/packages/rulesets/src/spectral/test/resources/Microsoft.Contoso/provider-namespace.json @@ -4,4 +4,4 @@ "/foo/{p1}": {}, "/{scope}/providers/Microsoft.Conto/bar/{p3}": {} } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/spectral/test/resources/operation.json b/packages/rulesets/src/spectral/test/resources/operation.json index 0cfec00b5..b862f9715 100644 --- a/packages/rulesets/src/spectral/test/resources/operation.json +++ b/packages/rulesets/src/spectral/test/resources/operation.json @@ -72,4 +72,4 @@ "description": "Describes the properties of a Compute Operation Value Display." } } -} \ No newline at end of file +} diff --git a/packages/rulesets/src/spectral/test/security-definition-description.test.ts b/packages/rulesets/src/spectral/test/security-definition-description.test.ts index a3e12d929..3b1a6fd30 100644 --- a/packages/rulesets/src/spectral/test/security-definition-description.test.ts +++ b/packages/rulesets/src/spectral/test/security-definition-description.test.ts @@ -1,81 +1,81 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('SecurityDefinitionDescription'); - return linter; -}); + linter = await linterForRule("SecurityDefinitionDescription") + return linter +}) -test('SecurityDefinitionDescription should find errors', () => { +test("SecurityDefinitionDescription should find errors", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", securityDefinitions: { apim_key: { - type: 'apiKey', - name: 'Ocp-Apim-Subscription-Key', - in: 'header', + type: "apiKey", + name: "Ocp-Apim-Subscription-Key", + in: "header", }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(1); - expect(results[0].path.join('.')).toBe('securityDefinitions.apim_key'); - }); -}); + expect(results.length).toBe(1) + expect(results[0].path.join(".")).toBe("securityDefinitions.apim_key") + }) +}) -test('SecurityDefinitionDescription should find oas3 errors', () => { +test("SecurityDefinitionDescription should find oas3 errors", () => { const oasDoc = { - openapi: '3.0.0', + openapi: "3.0.0", components: { securitySchemes: { jwt: { - type: 'http', - scheme: 'bearer', - bearerFormat: 'JWT', + type: "http", + scheme: "bearer", + bearerFormat: "JWT", }, }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(1); - expect(results[0].path.join('.')).toBe('components.securitySchemes.jwt'); - }); -}); + expect(results.length).toBe(1) + expect(results[0].path.join(".")).toBe("components.securitySchemes.jwt") + }) +}) -test('SecurityDefinitionDescription should find no errors', () => { +test("SecurityDefinitionDescription should find no errors", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", securityDefinitions: { apim_key: { - type: 'apiKey', - name: 'Ocp-Apim-Subscription-Key', - in: 'header', - description: 'API Key for your subscription', + type: "apiKey", + name: "Ocp-Apim-Subscription-Key", + in: "header", + description: "API Key for your subscription", }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) -test('SecurityDefinitionDescription should find no oas3 errors', () => { +test("SecurityDefinitionDescription should find no oas3 errors", () => { const oasDoc = { - openapi: '3.0.0', + openapi: "3.0.0", components: { securitySchemes: { jwt: { - type: 'http', - scheme: 'bearer', - bearerFormat: 'JWT', - description: 'JSON Web Token with credentials for the service', + type: "http", + scheme: "bearer", + bearerFormat: "JWT", + description: "JSON Web Token with credentials for the service", }, }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/security-definitions-structure.test.ts b/packages/rulesets/src/spectral/test/security-definitions-structure.test.ts index 3eae1c417..f2d5ba0b1 100644 --- a/packages/rulesets/src/spectral/test/security-definitions-structure.test.ts +++ b/packages/rulesets/src/spectral/test/security-definitions-structure.test.ts @@ -1,12 +1,12 @@ -import { Spectral } from "@stoplight/spectral-core"; -import linterForRule from "./utils"; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter: Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule("SecurityDefinitionsStructure"); - return linter; -}); + linter = await linterForRule("SecurityDefinitionsStructure") + return linter +}) test("SecurityDefinitionsStructure should find errors", () => { const myOpenApiDocument = { @@ -34,14 +34,14 @@ test("SecurityDefinitionsStructure should find errors", () => { }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); + expect(results.length).toBe(1) expect(results[0].message).toBe( "Every OpenAPI(swagger) spec/configuration must have a security definitions section and it must adhere to the following structure: https://github.com/Azure/azure-openapi-validator/blob/main/docs/security-definitions-structure-validation.md" - ); - }); -}); + ) + }) +}) test("SecurityDefinitionsStructure should find no errors", () => { const myOpenApiDocument = { @@ -69,8 +69,8 @@ test("SecurityDefinitionsStructure should find no errors", () => { }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/sku-violation.test.ts b/packages/rulesets/src/spectral/test/sku-violation.test.ts index 994c50e31..4248797d9 100644 --- a/packages/rulesets/src/spectral/test/sku-violation.test.ts +++ b/packages/rulesets/src/spectral/test/sku-violation.test.ts @@ -103,7 +103,9 @@ test("InvalidSkuModel should find errors when missing 'name'", () => { return linter.run(oasDoc).then((results) => { expect(results.length).toBe(1) expect(results[0].path.join(".")).toBe("definitions.Sku") - expect(results[0].message).toContain("A Sku model must have 'name' property. It can also have 'tier', 'size', 'family', 'capacity' as optional properties.") + expect(results[0].message).toContain( + "A Sku model must have 'name' property. It can also have 'tier', 'size', 'family', 'capacity' as optional properties." + ) }) }) @@ -205,7 +207,9 @@ test("InvalidSkuModel should find errors when exists extra property", () => { return linter.run(oasDoc).then((results) => { expect(results.length).toBe(1) expect(results[0].path.join(".")).toBe("definitions.Sku") - expect(results[0].message).toContain("A Sku model must have 'name' property. It can also have 'tier', 'size', 'family', 'capacity' as optional properties.") + expect(results[0].message).toContain( + "A Sku model must have 'name' property. It can also have 'tier', 'size', 'family', 'capacity' as optional properties." + ) }) }) diff --git a/packages/rulesets/src/spectral/test/utils.test.ts b/packages/rulesets/src/spectral/test/utils.test.ts index f74a8f31b..59f358667 100644 --- a/packages/rulesets/src/spectral/test/utils.test.ts +++ b/packages/rulesets/src/spectral/test/utils.test.ts @@ -1,9 +1,9 @@ -import { getProperties, jsonPath } from '../functions/utils'; +import { getProperties, jsonPath } from "../functions/utils" -test('getProperties return empty object', () => { +test("getProperties return empty object", () => { expect(getProperties(undefined)).toEqual({}) -}); +}) -test('jsonPath return undefined', () => { - expect(jsonPath(["/"],"string")).toBe(undefined) -}); +test("jsonPath return undefined", () => { + expect(jsonPath(["/"], "string")).toBe(undefined) +}) diff --git a/packages/rulesets/src/spectral/test/version-convention.test.ts b/packages/rulesets/src/spectral/test/version-convention.test.ts index 764e9bb95..29d9bd0a0 100644 --- a/packages/rulesets/src/spectral/test/version-convention.test.ts +++ b/packages/rulesets/src/spectral/test/version-convention.test.ts @@ -1,46 +1,46 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('VersionConvention'); - return linter; -}); + linter = await linterForRule("VersionConvention") + return linter +}) -test('VersionConvention should find errors', () => { +test("VersionConvention should find errors", () => { const myOpenApiDocument = { - swagger: '2.0', + swagger: "2.0", info: { - version: '3.0.1', + version: "3.0.1", }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - expect(results[0].path.join('.')).toBe('info.version'); - }); -}); + expect(results.length).toBe(1) + expect(results[0].path.join(".")).toBe("info.version") + }) +}) -test('VersionConvention should find no errors', () => { +test("VersionConvention should find no errors", () => { const myOpenApiDocument = { - swagger: '2.0', + swagger: "2.0", info: { - version: '2021-07-01', + version: "2021-07-01", }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) -test('VersionConvention allows -preview suffix', () => { +test("VersionConvention allows -preview suffix", () => { const myOpenApiDocument = { - swagger: '2.0', + swagger: "2.0", info: { - version: '2021-07-01-preview', + version: "2021-07-01-preview", }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/version-policy.test.ts b/packages/rulesets/src/spectral/test/version-policy.test.ts index 6237a060c..3c8020558 100644 --- a/packages/rulesets/src/spectral/test/version-policy.test.ts +++ b/packages/rulesets/src/spectral/test/version-policy.test.ts @@ -1,144 +1,144 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('VersionPolicy'); - return linter; -}); + linter = await linterForRule("VersionPolicy") + return linter +}) -test('VersionPolicy should find version in basePath', () => { +test("VersionPolicy should find version in basePath", () => { const oasDoc = { - swagger: '2.0', - basePath: '/v3/api', + swagger: "2.0", + basePath: "/v3/api", paths: { - '/test1': { + "/test1": { get: { responses: { default: { - description: 'default', + description: "default", }, }, }, }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(2); - expect(results[0].path.join('.')).toBe('basePath'); - expect(results[1].path.join('.')).toBe('paths./test1.get'); - }); -}); + expect(results.length).toBe(2) + expect(results[0].path.join(".")).toBe("basePath") + expect(results[1].path.join(".")).toBe("paths./test1.get") + }) +}) -test('VersionPolicy should find errors', () => { +test("VersionPolicy should find errors", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/v1/test1': { + "/v1/test1": { get: { responses: { default: { - description: 'default', + description: "default", }, }, }, }, - '/test2': { + "/test2": { get: { // no parameters responses: { default: { - description: 'default', + description: "default", }, }, }, }, - '/test3': { + "/test3": { get: { parameters: [ { - name: 'p1', - in: 'query', - type: 'string', + name: "p1", + in: "query", + type: "string", }, ], responses: { default: { - description: 'default', + description: "default", }, }, }, }, - '/test4': { + "/test4": { get: { parameters: [ { - name: 'api-version', - in: 'query', - type: 'string', + name: "api-version", + in: "query", + type: "string", }, ], responses: { default: { - description: 'default', + description: "default", }, }, }, }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(5); - expect(results[0].path.join('.')).toBe('paths./v1/test1'); - expect(results[1].path.join('.')).toBe('paths./v1/test1.get'); - expect(results[2].path.join('.')).toBe('paths./test2.get'); - expect(results[3].path.join('.')).toBe('paths./test3.get.parameters'); - expect(results[4].path.join('.')).toBe('paths./test4.get.parameters.0'); - }); -}); + expect(results.length).toBe(5) + expect(results[0].path.join(".")).toBe("paths./v1/test1") + expect(results[1].path.join(".")).toBe("paths./v1/test1.get") + expect(results[2].path.join(".")).toBe("paths./test2.get") + expect(results[3].path.join(".")).toBe("paths./test3.get.parameters") + expect(results[4].path.join(".")).toBe("paths./test4.get.parameters.0") + }) +}) -test('VersionPolicy should find no errors', () => { +test("VersionPolicy should find no errors", () => { const oasDoc = { - swagger: '2.0', + swagger: "2.0", paths: { - '/test1': { + "/test1": { get: { parameters: [ { - name: 'api-version', - in: 'query', - type: 'string', + name: "api-version", + in: "query", + type: "string", required: true, }, ], responses: { default: { - description: 'default', + description: "default", }, }, }, }, - '/test2': { + "/test2": { parameters: [ { - name: 'api-version', - in: 'query', - type: 'string', + name: "api-version", + in: "query", + type: "string", required: true, }, ], get: { responses: { default: { - description: 'default', + description: "default", }, }, }, }, }, - }; + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/with-xms-resource.test.ts b/packages/rulesets/src/spectral/test/with-xms-resource.test.ts index b590f61f1..e5cef8ad8 100644 --- a/packages/rulesets/src/spectral/test/with-xms-resource.test.ts +++ b/packages/rulesets/src/spectral/test/with-xms-resource.test.ts @@ -1,163 +1,165 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('XmsResourceInPutResponse'); - return linter; -}); + linter = await linterForRule("XmsResourceInPutResponse") + return linter +}) -test('XmsResourceInPutResponse should find errors for inconsistent resposne', () => { +test("XmsResourceInPutResponse should find errors for inconsistent resposne", () => { const oasDoc = { - "swagger": "2.0", - "paths": { - "/foo": { - "put": { - "tags": [ "SampleTag" ], - "operationId": "Foo_Update", - "description": "Test Description", - "parameters": [ - { - "name": "foo_patch", - "in": "body", - "schema": { - "$ref": "#/definitions/FooRequestParams" - }, - } - ], - "responses": { - "200":{ - schema: { - $ref :"#/definitions/FooResource" - } - } - } - } - } + swagger: "2.0", + paths: { + "/foo": { + put: { + tags: ["SampleTag"], + operationId: "Foo_Update", + description: "Test Description", + parameters: [ + { + name: "foo_patch", + in: "body", + schema: { + $ref: "#/definitions/FooRequestParams", + }, + }, + ], + responses: { + "200": { + schema: { + $ref: "#/definitions/FooResource", + }, + }, + }, + }, + }, }, - "definitions": { - "FooRequestParams": { - "allOf": [ + definitions: { + FooRequestParams: { + allOf: [ { - "$ref": "#/definitions/FooProps" - } - ] + $ref: "#/definitions/FooProps", + }, + ], }, - "FooResource": { - "allOf": [ + FooResource: { + allOf: [ { - "$ref": "#/definitions/FooProps" - } - ] + $ref: "#/definitions/FooProps", + }, + ], }, - "FooResourceUpdate": { - "allOf": [ + FooResourceUpdate: { + allOf: [ { - "$ref": "#/definitions/FooProps" - } - ] + $ref: "#/definitions/FooProps", + }, + ], }, - "FooProps": { - "properties": { - "prop0": { - "type": "string", - "default": "my def val" - } - } - } - } - }; + FooProps: { + properties: { + prop0: { + type: "string", + default: "my def val", + }, + }, + }, + }, + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(1); - expect(results[0].path.join('.')).toBe('paths./foo.put'); - expect(results[0].message).toContain("The 200 response model for an ARM PUT operation must have x-ms-azure-resource extension set to true in its hierarchy.Operation: Foo_Update"); - }); -}); + expect(results.length).toBe(1) + expect(results[0].path.join(".")).toBe("paths./foo.put") + expect(results[0].message).toContain( + "The 200 response model for an ARM PUT operation must have x-ms-azure-resource extension set to true in its hierarchy.Operation: Foo_Update" + ) + }) +}) -test('XmsResourceInPutResponse should find no errors', () => { +test("XmsResourceInPutResponse should find no errors", () => { const oasDoc = { - "swagger": "2.0", - "paths": { - "/foo": { - "patch": { - "tags": [ "SampleTag" ], - "operationId": "Foo_Update", - "description": "Test Description", - "parameters": [ - { - "name": "foo_patch", - "in": "body", - "schema": { - "$ref": "#/definitions/FooRequestParams" - }, - } - ], - "responses": { - "200":{ - schema: { - $ref :"#/definitions/FooResource" - } - } - } + swagger: "2.0", + paths: { + "/foo": { + patch: { + tags: ["SampleTag"], + operationId: "Foo_Update", + description: "Test Description", + parameters: [ + { + name: "foo_patch", + in: "body", + schema: { + $ref: "#/definitions/FooRequestParams", + }, + }, + ], + responses: { + "200": { + schema: { + $ref: "#/definitions/FooResource", + }, }, - "put": { - "tags": [ "SampleTag" ], - "operationId": "Foo_Update", - "description": "Test Description", - "parameters": [ - { - "name": "foo_patch", - "in": "body", - "schema": { - "$ref": "#/definitions/FooRequestParams" - }, - } - ], - "responses": { - "200":{ - schema: { - $ref :"#/definitions/FooResource" - } - } - } - } - } + }, + }, + put: { + tags: ["SampleTag"], + operationId: "Foo_Update", + description: "Test Description", + parameters: [ + { + name: "foo_patch", + in: "body", + schema: { + $ref: "#/definitions/FooRequestParams", + }, + }, + ], + responses: { + "200": { + schema: { + $ref: "#/definitions/FooResource", + }, + }, + }, + }, + }, }, - "definitions": { - "FooRequestParams": { - "allOf": [ + definitions: { + FooRequestParams: { + allOf: [ { - "$ref": "#/definitions/FooProps" - } - ] + $ref: "#/definitions/FooProps", + }, + ], }, - "FooResource": { - "allOf": [ + FooResource: { + allOf: [ { - "$ref": "#/definitions/FooProps" - } - ] + $ref: "#/definitions/FooProps", + }, + ], }, - "FooResourceUpdate": { - "allOf": [ + FooResourceUpdate: { + allOf: [ { - "$ref": "#/definitions/FooProps" - } - ] + $ref: "#/definitions/FooProps", + }, + ], }, - "FooProps": { - "properties": { - "prop0": { - "type": "string", - "default": "my def val" - } + FooProps: { + properties: { + prop0: { + type: "string", + default: "my def val", + }, }, - "x-ms-azure-resource":true - } - } - }; + "x-ms-azure-resource": true, + }, + }, + } return linter.run(oasDoc).then((results) => { - expect(results.length).toBe(0); - }); -}); \ No newline at end of file + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/xms-client-name-parameter.test.ts b/packages/rulesets/src/spectral/test/xms-client-name-parameter.test.ts index 63e00f759..72633fdff 100644 --- a/packages/rulesets/src/spectral/test/xms-client-name-parameter.test.ts +++ b/packages/rulesets/src/spectral/test/xms-client-name-parameter.test.ts @@ -1,79 +1,79 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('XmsClientNameParameter'); - return linter; -}); + linter = await linterForRule("XmsClientNameParameter") + return linter +}) -test('XmsClientNameParameter should find errors', () => { - const myOpenApiDocument = { - "swagger": "2.0", - "paths": { - "/providers/Microsoft.Storage/operations": { - "get": { - "responses": { - "200": { - "description": "OK. The request has succeeded." - } - }, - "parameters": [ - { - "name": "search", - "in": "query", - "type": "string", - "description": "test1", - "x-ms-client-name": "search" - } - ] - } - } - } - }; - return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - }); -}); +test("XmsClientNameParameter should find errors", () => { + const myOpenApiDocument = { + swagger: "2.0", + paths: { + "/providers/Microsoft.Storage/operations": { + get: { + responses: { + "200": { + description: "OK. The request has succeeded.", + }, + }, + parameters: [ + { + name: "search", + in: "query", + type: "string", + description: "test1", + "x-ms-client-name": "search", + }, + ], + }, + }, + }, + } + return linter.run(myOpenApiDocument).then((results) => { + expect(results.length).toBe(1) + }) +}) -test('XmsClientNameParameter should pass check', () => { - const myOpenApiDocument = { - "swagger": "2.0", - "paths": { - "/providers/Microsoft.Storage/operations": { - "get": { - "responses": { - "200": { - "description": "OK. The request has succeeded." - } - }, - "parameters": [ - { - "name": "search", - "in": "query", - "type": "string", - "description": "test", - "x-ms-client-name": "search2" - }, - { - "in": "query", - "type": "string", - "description": "test", - "x-ms-client-name": "search3" - }, - { - "name": "search4", - "in": "query", - "type": "string", - "description": "test", - }, - ] - } - } - } - }; - return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); \ No newline at end of file +test("XmsClientNameParameter should pass check", () => { + const myOpenApiDocument = { + swagger: "2.0", + paths: { + "/providers/Microsoft.Storage/operations": { + get: { + responses: { + "200": { + description: "OK. The request has succeeded.", + }, + }, + parameters: [ + { + name: "search", + in: "query", + type: "string", + description: "test", + "x-ms-client-name": "search2", + }, + { + in: "query", + type: "string", + description: "test", + "x-ms-client-name": "search3", + }, + { + name: "search4", + in: "query", + type: "string", + description: "test", + }, + ], + }, + }, + }, + } + return linter.run(myOpenApiDocument).then((results) => { + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/xms-client-name-property.test.ts b/packages/rulesets/src/spectral/test/xms-client-name-property.test.ts index 738b0539c..b8489f172 100644 --- a/packages/rulesets/src/spectral/test/xms-client-name-property.test.ts +++ b/packages/rulesets/src/spectral/test/xms-client-name-property.test.ts @@ -1,56 +1,56 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('XmsClientNameProperty'); - return linter; -}); + linter = await linterForRule("XmsClientNameProperty") + return linter +}) -test('XmsClientNameProperty should find errors', () => { - const myOpenApiDocument = { - "swagger": "2.0", - "definitions":{ - "item1": { - "properties": { - "prop1": { - "x-ms-client-name": "prop1", - "type": "string", - "format": "base64url", - "description": "name." - } - } - } - } - }; - return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - }); -}); +test("XmsClientNameProperty should find errors", () => { + const myOpenApiDocument = { + swagger: "2.0", + definitions: { + item1: { + properties: { + prop1: { + "x-ms-client-name": "prop1", + type: "string", + format: "base64url", + description: "name.", + }, + }, + }, + }, + } + return linter.run(myOpenApiDocument).then((results) => { + expect(results.length).toBe(1) + }) +}) -test('XmsClientNameProperty should pass check', () => { - const myOpenApiDocument = { - "swagger": "2.0", - "definitions":{ - "item1": { - "properties": { - "prop1": { - "x-ms-client-name": "prop", - "type": "string", - "format": "base64url", - "description": "name." - }, - "prop2": { - "type": "string", - "format": "base64url", - "description": "name." - } - } - } - } - }; - return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); \ No newline at end of file +test("XmsClientNameProperty should pass check", () => { + const myOpenApiDocument = { + swagger: "2.0", + definitions: { + item1: { + properties: { + prop1: { + "x-ms-client-name": "prop", + type: "string", + format: "base64url", + description: "name.", + }, + prop2: { + type: "string", + format: "base64url", + description: "name.", + }, + }, + }, + }, + } + return linter.run(myOpenApiDocument).then((results) => { + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/xms-client-name.test.ts b/packages/rulesets/src/spectral/test/xms-client-name.test.ts index 8e9a84759..76fa8f9c8 100644 --- a/packages/rulesets/src/spectral/test/xms-client-name.test.ts +++ b/packages/rulesets/src/spectral/test/xms-client-name.test.ts @@ -1,12 +1,12 @@ -import { Spectral } from "@stoplight/spectral-core"; -import linterForRule from "./utils"; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter: Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule("XmsClientName"); - return linter; -}); + linter = await linterForRule("XmsClientName") + return linter +}) test("XmsClientName should find errors", () => { const myOpenApiDocument = { @@ -62,15 +62,15 @@ test("XmsClientName should find errors", () => { }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(2); - expect(results[0].message).toBe(`Value of 'x-ms-client-name' cannot be the same as 'name' Property/Model.`); - expect(results[0].path.join(".")).toBe("paths./api/Paths.put.parameters.1"); - expect(results[1].message).toBe(`Value of 'x-ms-client-name' cannot be the same as 'length' Property/Model.`); - expect(results[1].path.join(".")).toBe("paths./api/Paths.put.responses.200.schema.properties.length"); - }); -}); + expect(results.length).toBe(2) + expect(results[0].message).toBe(`Value of 'x-ms-client-name' cannot be the same as 'name' Property/Model.`) + expect(results[0].path.join(".")).toBe("paths./api/Paths.put.parameters.1") + expect(results[1].message).toBe(`Value of 'x-ms-client-name' cannot be the same as 'length' Property/Model.`) + expect(results[1].path.join(".")).toBe("paths./api/Paths.put.responses.200.schema.properties.length") + }) +}) test("XmsClientName should find no errors", () => { const myOpenApiDocument = { @@ -126,8 +126,8 @@ test("XmsClientName should find no errors", () => { }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/xms-examples-required.test.ts b/packages/rulesets/src/spectral/test/xms-examples-required.test.ts index d7994a65f..d7952550b 100644 --- a/packages/rulesets/src/spectral/test/xms-examples-required.test.ts +++ b/packages/rulesets/src/spectral/test/xms-examples-required.test.ts @@ -1,54 +1,54 @@ -import { Spectral } from '@stoplight/spectral-core'; -import linterForRule from './utils'; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter:Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule('XmsExamplesRequired'); - return linter; -}); + linter = await linterForRule("XmsExamplesRequired") + return linter +}) -test('XmsClientNameProperty should find errors', () => { - const myOpenApiDocument = { - "swagger": "2.0", - "paths": { - "/providers/Microsoft.Storage/operations": { - "get": { - "responses": { - "200": { - "description": "OK. The request has succeeded." - } - } - } - } - } - }; - return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - }); -}); +test("XmsClientNameProperty should find errors", () => { + const myOpenApiDocument = { + swagger: "2.0", + paths: { + "/providers/Microsoft.Storage/operations": { + get: { + responses: { + "200": { + description: "OK. The request has succeeded.", + }, + }, + }, + }, + }, + } + return linter.run(myOpenApiDocument).then((results) => { + expect(results.length).toBe(1) + }) +}) -test('XmsClientNameProperty should pass check', () => { - const myOpenApiDocument = { - "swagger": "2.0", - "paths": { - "/providers/Microsoft.Storage/operations": { - "get": { - "responses": { - "200": { - "description": "OK. The request has succeeded." - } - }, - "x-ms-examples": { - "GetCertificates": { - "$ref": "#/swagger" - } - } - } - } - } - }; - return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); \ No newline at end of file +test("XmsClientNameProperty should pass check", () => { + const myOpenApiDocument = { + swagger: "2.0", + paths: { + "/providers/Microsoft.Storage/operations": { + get: { + responses: { + "200": { + description: "OK. The request has succeeded.", + }, + }, + "x-ms-examples": { + GetCertificates: { + $ref: "#/swagger", + }, + }, + }, + }, + }, + } + return linter.run(myOpenApiDocument).then((results) => { + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/src/spectral/test/xms-paths-must-overload-paths.test.ts b/packages/rulesets/src/spectral/test/xms-paths-must-overload-paths.test.ts index 263484d38..5f203e4df 100644 --- a/packages/rulesets/src/spectral/test/xms-paths-must-overload-paths.test.ts +++ b/packages/rulesets/src/spectral/test/xms-paths-must-overload-paths.test.ts @@ -1,12 +1,12 @@ -import { Spectral } from "@stoplight/spectral-core"; -import linterForRule from "./utils"; +import { Spectral } from "@stoplight/spectral-core" +import linterForRule from "./utils" -let linter: Spectral; +let linter: Spectral beforeAll(async () => { - linter = await linterForRule("XmsPathsMustOverloadPaths"); - return linter; -}); + linter = await linterForRule("XmsPathsMustOverloadPaths") + return linter +}) test("XmsPathsMustOverloadPaths should find errors", () => { const myOpenApiDocument = { @@ -35,13 +35,15 @@ test("XmsPathsMustOverloadPaths should find errors", () => { }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(1); - expect(results[0].message).toBe(`Paths in x-ms-paths must overload a normal path in the paths section, i.e. a path in the x-ms-paths must either be same as a path in the paths section or a path in the paths sections followed by additional parameters.`); - expect(results[0].path.join(".")).toBe("x-ms-paths./api/Path?op=baz"); - }); -}); + expect(results.length).toBe(1) + expect(results[0].message).toBe( + `Paths in x-ms-paths must overload a normal path in the paths section, i.e. a path in the x-ms-paths must either be same as a path in the paths section or a path in the paths sections followed by additional parameters.` + ) + expect(results[0].path.join(".")).toBe("x-ms-paths./api/Path?op=baz") + }) +}) test("XmsPathsMustOverloadPaths should find no errors", () => { const myOpenApiDocument = { @@ -70,8 +72,8 @@ test("XmsPathsMustOverloadPaths should find no errors", () => { }, }, }, - }; + } return linter.run(myOpenApiDocument).then((results) => { - expect(results.length).toBe(0); - }); -}); + expect(results.length).toBe(0) + }) +}) diff --git a/packages/rulesets/tsconfig.json b/packages/rulesets/tsconfig.json index d9945db2d..2bd1f901e 100644 --- a/packages/rulesets/tsconfig.json +++ b/packages/rulesets/tsconfig.json @@ -1,11 +1,7 @@ { - "extends": "../../tsconfig-base.json", - "include": [ - "./src/spectral/**/*.ts", - "./src/native/**/*.ts", - "src/index.ts" - ], - "compilerOptions": { - "outDir": "dist" - } -} \ No newline at end of file + "extends": "../../tsconfig-base.json", + "include": ["./src/spectral/**/*.ts", "./src/native/**/*.ts", "src/index.ts"], + "compilerOptions": { + "outDir": "dist" + } +} diff --git a/packages/rulesets/tsconfig.spectral.esm.json b/packages/rulesets/tsconfig.spectral.esm.json index a22f7c6c2..955cfd1a8 100644 --- a/packages/rulesets/tsconfig.spectral.esm.json +++ b/packages/rulesets/tsconfig.spectral.esm.json @@ -1,38 +1,34 @@ { - "include": [ - "./src/spectral/**/*.ts", - ], - "compilerOptions": { - "outDir": "esm", - "baseUrl": ".", - "types": [ - "node","jest" - ], - "moduleResolution": "node", - "target": "ES2019", - "module": "esnext", - "esModuleInterop": true, - "lib": ["es2021"], - "strict": false, - "pretty": true, - "experimentalDecorators": true, - "emitDecoratorMetadata": true, - "noFallthroughCasesInSwitch": true, - "allowUnreachableCode": false, - "forceConsistentCasingInFileNames": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "noImplicitAny": true, - "strictNullChecks": true, - "suppressImplicitAnyIndexErrors": true, - "noUnusedLocals": true, - "resolveJsonModule": true, - "sourceMap": true, - "declaration": true, - "removeComments": true, - "skipLibCheck": false, - "noEmitHelpers": true, - "skipDefaultLibCheck": true, - "allowJs": false, - } -} \ No newline at end of file + "include": ["./src/spectral/**/*.ts"], + "compilerOptions": { + "outDir": "esm", + "baseUrl": ".", + "types": ["node", "jest"], + "moduleResolution": "node", + "target": "ES2019", + "module": "esnext", + "esModuleInterop": true, + "lib": ["es2021"], + "strict": false, + "pretty": true, + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "noFallthroughCasesInSwitch": true, + "allowUnreachableCode": false, + "forceConsistentCasingInFileNames": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "noImplicitAny": true, + "strictNullChecks": true, + "suppressImplicitAnyIndexErrors": true, + "noUnusedLocals": true, + "resolveJsonModule": true, + "sourceMap": true, + "declaration": true, + "removeComments": true, + "skipLibCheck": false, + "noEmitHelpers": true, + "skipDefaultLibCheck": true, + "allowJs": false + } +} diff --git a/regression/.eslintrc.yaml b/regression/.eslintrc.yaml index f52b27e99..d75732606 100644 --- a/regression/.eslintrc.yaml +++ b/regression/.eslintrc.yaml @@ -2,4 +2,4 @@ parser: "@typescript-eslint/parser" extends: - "../.eslintrc.yaml" rules: - no-console: off + no-console: off diff --git a/regression/package.json b/regression/package.json index 2bb0c2b23..6561c2c0f 100644 --- a/regression/package.json +++ b/regression/package.json @@ -40,6 +40,8 @@ "test": "jest -u --runInBand --max-old-space-size=10192 --ci --config ./jest.config.js ", "build": "tsc", "lint:fix": "eslint ./tests --fix --ext .ts", - "lint": "eslint ./tests --ext .ts --max-warnings=0" + "lint": "eslint ./tests --ext .ts --max-warnings=0", + "prettier": "prettier -w ./tests", + "prettier-check": "prettier -c ./tests" } -} +} \ No newline at end of file diff --git a/regression/tests/__linting_result__/diff/AvoidAnonymousTypes.json b/regression/tests/__linting_result__/diff/AvoidAnonymousTypes.json index 54e82c2c8..9318f83c6 100644 --- a/regression/tests/__linting_result__/diff/AvoidAnonymousTypes.json +++ b/regression/tests/__linting_result__/diff/AvoidAnonymousTypes.json @@ -9,4 +9,4 @@ ], "v2Only": [], "v3Only": [] -} \ No newline at end of file +} diff --git a/regression/tests/__linting_result__/diff/AvoidNestedProperties.json b/regression/tests/__linting_result__/diff/AvoidNestedProperties.json index 91ebe0edc..4d89a6e29 100644 --- a/regression/tests/__linting_result__/diff/AvoidNestedProperties.json +++ b/regression/tests/__linting_result__/diff/AvoidNestedProperties.json @@ -340,4 +340,4 @@ "source": "specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2020-05-01/ResourceHealth.json:267:10" } ] -} \ No newline at end of file +} diff --git a/regression/tests/__linting_result__/diff/AzureResourceTagsSchema.json b/regression/tests/__linting_result__/diff/AzureResourceTagsSchema.json index 9fd8c846b..ea4b6a1e1 100644 --- a/regression/tests/__linting_result__/diff/AzureResourceTagsSchema.json +++ b/regression/tests/__linting_result__/diff/AzureResourceTagsSchema.json @@ -9,4 +9,4 @@ ], "v2Only": [], "v3Only": [] -} \ No newline at end of file +} diff --git a/regression/tests/__linting_result__/diff/DefaultErrorResponseSchema.json b/regression/tests/__linting_result__/diff/DefaultErrorResponseSchema.json index d8354e264..7e6087ecb 100644 --- a/regression/tests/__linting_result__/diff/DefaultErrorResponseSchema.json +++ b/regression/tests/__linting_result__/diff/DefaultErrorResponseSchema.json @@ -874,4 +874,4 @@ "source": "specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/metricNamespaces_API.json:55:10" } ] -} \ No newline at end of file +} diff --git a/regression/tests/__linting_result__/diff/DeleteInOperationName.json b/regression/tests/__linting_result__/diff/DeleteInOperationName.json index 84d5ff8f5..5362d5508 100644 --- a/regression/tests/__linting_result__/diff/DeleteInOperationName.json +++ b/regression/tests/__linting_result__/diff/DeleteInOperationName.json @@ -15,4 +15,4 @@ ], "v2Only": [], "v3Only": [] -} \ No newline at end of file +} diff --git a/regression/tests/__linting_result__/diff/DeprecatedXmsCodeGenerationSetting.json b/regression/tests/__linting_result__/diff/DeprecatedXmsCodeGenerationSetting.json index fa48b235b..b3c6e63d8 100644 --- a/regression/tests/__linting_result__/diff/DeprecatedXmsCodeGenerationSetting.json +++ b/regression/tests/__linting_result__/diff/DeprecatedXmsCodeGenerationSetting.json @@ -123,4 +123,4 @@ ], "v2Only": [], "v3Only": [] -} \ No newline at end of file +} diff --git a/regression/tests/__linting_result__/diff/EnumInsteadOfBoolean.json b/regression/tests/__linting_result__/diff/EnumInsteadOfBoolean.json index 16d6ff902..6c1c0f901 100644 --- a/regression/tests/__linting_result__/diff/EnumInsteadOfBoolean.json +++ b/regression/tests/__linting_result__/diff/EnumInsteadOfBoolean.json @@ -4516,4 +4516,4 @@ "source": "specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/JobTargetExecutions.json:87:10" } ] -} \ No newline at end of file +} diff --git a/regression/tests/__linting_result__/diff/EnumMustRespectType.json b/regression/tests/__linting_result__/diff/EnumMustRespectType.json index dee74e9a5..781cd8648 100644 --- a/regression/tests/__linting_result__/diff/EnumMustRespectType.json +++ b/regression/tests/__linting_result__/diff/EnumMustRespectType.json @@ -9,4 +9,4 @@ ], "v2Only": [], "v3Only": [] -} \ No newline at end of file +} diff --git a/regression/tests/__linting_result__/diff/GetInOperationName.json b/regression/tests/__linting_result__/diff/GetInOperationName.json index ef8677b8e..55450fb6f 100644 --- a/regression/tests/__linting_result__/diff/GetInOperationName.json +++ b/regression/tests/__linting_result__/diff/GetInOperationName.json @@ -34,4 +34,4 @@ "source": "specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/virtualNetwork.json:1163:8" } ] -} \ No newline at end of file +} diff --git a/regression/tests/__linting_result__/diff/GuidUsage.json b/regression/tests/__linting_result__/diff/GuidUsage.json index dbaa009f7..bace90d78 100644 --- a/regression/tests/__linting_result__/diff/GuidUsage.json +++ b/regression/tests/__linting_result__/diff/GuidUsage.json @@ -376,4 +376,4 @@ "source": "specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/JobTargetExecutions.json:53:12" } ] -} \ No newline at end of file +} diff --git a/regression/tests/__linting_result__/diff/ImplementPrivateEndpointAPIs.json b/regression/tests/__linting_result__/diff/ImplementPrivateEndpointAPIs.json index 3fe09a372..943b38ae6 100644 --- a/regression/tests/__linting_result__/diff/ImplementPrivateEndpointAPIs.json +++ b/regression/tests/__linting_result__/diff/ImplementPrivateEndpointAPIs.json @@ -64,4 +64,4 @@ "source": "specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/PrivateEndpointConnections.json:18:2" } ] -} \ No newline at end of file +} diff --git a/regression/tests/__linting_result__/diff/ListInOperationName.json b/regression/tests/__linting_result__/diff/ListInOperationName.json index f417a4f49..375a46a2c 100644 --- a/regression/tests/__linting_result__/diff/ListInOperationName.json +++ b/regression/tests/__linting_result__/diff/ListInOperationName.json @@ -160,4 +160,4 @@ "source": "specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/virtualNetworkGateway.json:2216:6" } ] -} \ No newline at end of file +} diff --git a/regression/tests/__linting_result__/diff/LocationMustHaveXmsMutability.json b/regression/tests/__linting_result__/diff/LocationMustHaveXmsMutability.json index a917db5d7..bfce905bf 100644 --- a/regression/tests/__linting_result__/diff/LocationMustHaveXmsMutability.json +++ b/regression/tests/__linting_result__/diff/LocationMustHaveXmsMutability.json @@ -340,4 +340,4 @@ "source": "specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2020-05-01/ResourceHealth.json:353:8" } ] -} \ No newline at end of file +} diff --git a/regression/tests/__linting_result__/diff/NestedResourcesMustHaveListOperation.json b/regression/tests/__linting_result__/diff/NestedResourcesMustHaveListOperation.json index 2cae32b19..b60315a9e 100644 --- a/regression/tests/__linting_result__/diff/NestedResourcesMustHaveListOperation.json +++ b/regression/tests/__linting_result__/diff/NestedResourcesMustHaveListOperation.json @@ -82,4 +82,4 @@ "source": "specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/compute.json:9913:4" } ] -} \ No newline at end of file +} diff --git a/regression/tests/__linting_result__/diff/OperationIdNounVerb.json b/regression/tests/__linting_result__/diff/OperationIdNounVerb.json index c15ee1745..2791ff99a 100644 --- a/regression/tests/__linting_result__/diff/OperationIdNounVerb.json +++ b/regression/tests/__linting_result__/diff/OperationIdNounVerb.json @@ -124,4 +124,4 @@ "source": "specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/vmssPublicIpAddress.json:89:8" } ] -} \ No newline at end of file +} diff --git a/regression/tests/__linting_result__/diff/PatchInOperationName.json b/regression/tests/__linting_result__/diff/PatchInOperationName.json index ff450434c..d1dc83b25 100644 --- a/regression/tests/__linting_result__/diff/PatchInOperationName.json +++ b/regression/tests/__linting_result__/diff/PatchInOperationName.json @@ -15,4 +15,4 @@ ], "v2Only": [], "v3Only": [] -} \ No newline at end of file +} diff --git a/regression/tests/__linting_result__/diff/PathResourceProviderMatchNamespace.json b/regression/tests/__linting_result__/diff/PathResourceProviderMatchNamespace.json index 561d3e8ef..a7392a9c7 100644 --- a/regression/tests/__linting_result__/diff/PathResourceProviderMatchNamespace.json +++ b/regression/tests/__linting_result__/diff/PathResourceProviderMatchNamespace.json @@ -129,4 +129,4 @@ ], "v2Only": [], "v3Only": [] -} \ No newline at end of file +} diff --git a/regression/tests/__linting_result__/diff/PathResourceProviderNamePascalCase.json b/regression/tests/__linting_result__/diff/PathResourceProviderNamePascalCase.json index c5ad84596..f3225d66b 100644 --- a/regression/tests/__linting_result__/diff/PathResourceProviderNamePascalCase.json +++ b/regression/tests/__linting_result__/diff/PathResourceProviderNamePascalCase.json @@ -75,4 +75,4 @@ ], "v2Only": [], "v3Only": [] -} \ No newline at end of file +} diff --git a/regression/tests/__linting_result__/diff/PathResourceTypeNameCamelCase.json b/regression/tests/__linting_result__/diff/PathResourceTypeNameCamelCase.json index e5f054663..26ae71ee4 100644 --- a/regression/tests/__linting_result__/diff/PathResourceTypeNameCamelCase.json +++ b/regression/tests/__linting_result__/diff/PathResourceTypeNameCamelCase.json @@ -159,4 +159,4 @@ ], "v2Only": [], "v3Only": [] -} \ No newline at end of file +} diff --git a/regression/tests/__linting_result__/diff/PostOperationIdContainsUrlVerb.json b/regression/tests/__linting_result__/diff/PostOperationIdContainsUrlVerb.json index fe01fce5c..0096f2d7a 100644 --- a/regression/tests/__linting_result__/diff/PostOperationIdContainsUrlVerb.json +++ b/regression/tests/__linting_result__/diff/PostOperationIdContainsUrlVerb.json @@ -340,4 +340,4 @@ "source": "specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/expressRouteCrossConnection.json:612:8" } ] -} \ No newline at end of file +} diff --git a/regression/tests/__linting_result__/diff/PreviewVersionOverOneYear.json b/regression/tests/__linting_result__/diff/PreviewVersionOverOneYear.json index 158f9dc94..563a2bf6e 100644 --- a/regression/tests/__linting_result__/diff/PreviewVersionOverOneYear.json +++ b/regression/tests/__linting_result__/diff/PreviewVersionOverOneYear.json @@ -669,4 +669,4 @@ ], "v2Only": [], "v3Only": [] -} \ No newline at end of file +} diff --git a/regression/tests/__linting_result__/diff/PutInOperationName.json b/regression/tests/__linting_result__/diff/PutInOperationName.json index 32b31dbc0..0b54bfe53 100644 --- a/regression/tests/__linting_result__/diff/PutInOperationName.json +++ b/regression/tests/__linting_result__/diff/PutInOperationName.json @@ -100,4 +100,4 @@ "source": "specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/virtualNetworkGateway.json:1469:8" } ] -} \ No newline at end of file +} diff --git a/regression/tests/__linting_result__/diff/RequiredDefaultResponse.json b/regression/tests/__linting_result__/diff/RequiredDefaultResponse.json index e06c9e805..b9fa82181 100644 --- a/regression/tests/__linting_result__/diff/RequiredDefaultResponse.json +++ b/regression/tests/__linting_result__/diff/RequiredDefaultResponse.json @@ -645,4 +645,4 @@ ], "v2Only": [], "v3Only": [] -} \ No newline at end of file +} diff --git a/regression/tests/__linting_result__/diff/TopLevelResourcesListByResourceGroup.json b/regression/tests/__linting_result__/diff/TopLevelResourcesListByResourceGroup.json index 9a41ab471..51a44651b 100644 --- a/regression/tests/__linting_result__/diff/TopLevelResourcesListByResourceGroup.json +++ b/regression/tests/__linting_result__/diff/TopLevelResourcesListByResourceGroup.json @@ -9,4 +9,4 @@ ], "v2Only": [], "v3Only": [] -} \ No newline at end of file +} diff --git a/regression/tests/__linting_result__/diff/TopLevelResourcesListBySubscription.json b/regression/tests/__linting_result__/diff/TopLevelResourcesListBySubscription.json index d4b80aecd..e13c257b5 100644 --- a/regression/tests/__linting_result__/diff/TopLevelResourcesListBySubscription.json +++ b/regression/tests/__linting_result__/diff/TopLevelResourcesListBySubscription.json @@ -70,4 +70,4 @@ "source": "specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/vmInsightsOnboarding_API.json:192:4" } ] -} \ No newline at end of file +} diff --git a/regression/tests/__linting_result__/diff/XmsEnumValidation.json b/regression/tests/__linting_result__/diff/XmsEnumValidation.json index b7bab5566..d2e760390 100644 --- a/regression/tests/__linting_result__/diff/XmsEnumValidation.json +++ b/regression/tests/__linting_result__/diff/XmsEnumValidation.json @@ -105,4 +105,4 @@ ], "v2Only": [], "v3Only": [] -} \ No newline at end of file +} diff --git a/regression/tests/__linting_result__/v2/AllResourcesMustHaveGetOperation.json b/regression/tests/__linting_result__/v2/AllResourcesMustHaveGetOperation.json index b16a43773..ab4d7a650 100644 --- a/regression/tests/__linting_result__/v2/AllResourcesMustHaveGetOperation.json +++ b/regression/tests/__linting_result__/v2/AllResourcesMustHaveGetOperation.json @@ -149,4 +149,4 @@ "jsonpath": "$.definitions.VirtualNetworkGatewayConnectionListEntity", "source": "specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/virtualNetworkGateway.json:3894:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/AvoidAnonymousTypes.json b/regression/tests/__linting_result__/v2/AvoidAnonymousTypes.json index 1c5a92ea5..7d5c39e0b 100644 --- a/regression/tests/__linting_result__/v2/AvoidAnonymousTypes.json +++ b/regression/tests/__linting_result__/v2/AvoidAnonymousTypes.json @@ -5,4 +5,4 @@ "jsonpath": "$.definitions.ManagedServiceIdentity.properties.userAssignedIdentities.additionalProperties", "source": "specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/network.json:221:10" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/AvoidNestedProperties.json b/regression/tests/__linting_result__/v2/AvoidNestedProperties.json index 713acfa48..354bc7d07 100644 --- a/regression/tests/__linting_result__/v2/AvoidNestedProperties.json +++ b/regression/tests/__linting_result__/v2/AvoidNestedProperties.json @@ -209,4 +209,4 @@ "jsonpath": "$.definitions.availabilityStatus.properties.properties", "source": "specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2020-05-01/ResourceHealth.json:357:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/AzureResourceTagsSchema.json b/regression/tests/__linting_result__/v2/AzureResourceTagsSchema.json index 84be6a617..df8cce95f 100644 --- a/regression/tests/__linting_result__/v2/AzureResourceTagsSchema.json +++ b/regression/tests/__linting_result__/v2/AzureResourceTagsSchema.json @@ -5,4 +5,4 @@ "jsonpath": "$.definitions.JobResponse", "source": "specification/storageimportexport/resource-manager/Microsoft.ImportExport/stable/2016-11-01/storageimportexport.json:830:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/BodyTopLevelProperties.json b/regression/tests/__linting_result__/v2/BodyTopLevelProperties.json index 48d6f3f3b..13500f54d 100644 --- a/regression/tests/__linting_result__/v2/BodyTopLevelProperties.json +++ b/regression/tests/__linting_result__/v2/BodyTopLevelProperties.json @@ -23,4 +23,4 @@ "jsonpath": "$.definitions.IscsiTargetUpdate.properties", "source": "specification/storagepool/resource-manager/Microsoft.StoragePool/stable/2021-08-01/storagepool.json:1759:6" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/DefaultErrorResponseSchema.json b/regression/tests/__linting_result__/v2/DefaultErrorResponseSchema.json index 78fc81d57..575ee5304 100644 --- a/regression/tests/__linting_result__/v2/DefaultErrorResponseSchema.json +++ b/regression/tests/__linting_result__/v2/DefaultErrorResponseSchema.json @@ -437,4 +437,4 @@ "jsonpath": "$.paths[\"/{resourceUri}/providers/Microsoft.Insights/metricBaselines\"].get.responses.default", "source": "specification/monitor/resource-manager/Microsoft.Insights/stable/2019-03-01/metricBaselines_API.json:92:10" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/DeleteInOperationName.json b/regression/tests/__linting_result__/v2/DeleteInOperationName.json index 1160a4e13..e1787d051 100644 --- a/regression/tests/__linting_result__/v2/DeleteInOperationName.json +++ b/regression/tests/__linting_result__/v2/DeleteInOperationName.json @@ -11,4 +11,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring\"].delete.operationId", "source": "specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/extensions.json:141:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/DeleteOperationResponses.json b/regression/tests/__linting_result__/v2/DeleteOperationResponses.json index 50d2010a7..8d0843294 100644 --- a/regression/tests/__linting_result__/v2/DeleteOperationResponses.json +++ b/regression/tests/__linting_result__/v2/DeleteOperationResponses.json @@ -101,4 +101,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}\"].delete.responses", "source": "specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/table.json:340:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/DeprecatedXmsCodeGenerationSetting.json b/regression/tests/__linting_result__/v2/DeprecatedXmsCodeGenerationSetting.json index d069e0ada..79faf823b 100644 --- a/regression/tests/__linting_result__/v2/DeprecatedXmsCodeGenerationSetting.json +++ b/regression/tests/__linting_result__/v2/DeprecatedXmsCodeGenerationSetting.json @@ -119,4 +119,4 @@ "jsonpath": "$.info[\"x-ms-code-generation-settings\"]", "source": "specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/storagesync.json:7:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/DescriptionAndTitleMissing.json b/regression/tests/__linting_result__/v2/DescriptionAndTitleMissing.json index f2f9ee7ec..89db5f57f 100644 --- a/regression/tests/__linting_result__/v2/DescriptionAndTitleMissing.json +++ b/regression/tests/__linting_result__/v2/DescriptionAndTitleMissing.json @@ -575,4 +575,4 @@ "jsonpath": "$.definitions.FirewallRuleList.properties.values", "source": "specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/FirewallRules.json:347:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/DescriptiveDescriptionRequired.json b/regression/tests/__linting_result__/v2/DescriptiveDescriptionRequired.json index eb70f703b..eea7c5c5c 100644 --- a/regression/tests/__linting_result__/v2/DescriptiveDescriptionRequired.json +++ b/regression/tests/__linting_result__/v2/DescriptiveDescriptionRequired.json @@ -5,4 +5,4 @@ "jsonpath": "$.definitions.CloudServiceRoleProperties.description", "source": "specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/cloudService.json:1933:6" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/EnumInsteadOfBoolean.json b/regression/tests/__linting_result__/v2/EnumInsteadOfBoolean.json index 9a907ee7c..3a42cac6c 100644 --- a/regression/tests/__linting_result__/v2/EnumInsteadOfBoolean.json +++ b/regression/tests/__linting_result__/v2/EnumInsteadOfBoolean.json @@ -1283,4 +1283,4 @@ "jsonpath": "$.definitions.ImageStorageProfile.properties.zoneResilient", "source": "specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/compute.json:14240:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/EnumMustRespectType.json b/regression/tests/__linting_result__/v2/EnumMustRespectType.json index a7a31c956..2bb540af9 100644 --- a/regression/tests/__linting_result__/v2/EnumMustRespectType.json +++ b/regression/tests/__linting_result__/v2/EnumMustRespectType.json @@ -5,4 +5,4 @@ "jsonpath": "$.definitions.BackupShortTermRetentionPolicyProperties.properties.diffBackupIntervalInHours", "source": "specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/BackupShortTermRetentionPolicies.json:265:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/GetCollectionResponseSchema.json b/regression/tests/__linting_result__/v2/GetCollectionResponseSchema.json index d4b781a0d..09b306799 100644 --- a/regression/tests/__linting_result__/v2/GetCollectionResponseSchema.json +++ b/regression/tests/__linting_result__/v2/GetCollectionResponseSchema.json @@ -17,4 +17,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors\"]", "source": "specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/ServerAdvisors.json:19:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/GetInOperationName.json b/regression/tests/__linting_result__/v2/GetInOperationName.json index 47c9f9829..9b9f709d6 100644 --- a/regression/tests/__linting_result__/v2/GetInOperationName.json +++ b/regression/tests/__linting_result__/v2/GetInOperationName.json @@ -11,4 +11,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/instanceView\"].get.operationId", "source": "specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/compute.json:4001:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/GuidUsage.json b/regression/tests/__linting_result__/v2/GuidUsage.json index a5a37d12d..7dcbff5ef 100644 --- a/regression/tests/__linting_result__/v2/GuidUsage.json +++ b/regression/tests/__linting_result__/v2/GuidUsage.json @@ -5,4 +5,4 @@ "jsonpath": "$.definitions.ResourceIdentity.properties.principalId", "source": "specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2021-11-01-preview/sqlvm.json:1535:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/ImplementPrivateEndpointAPIs.json b/regression/tests/__linting_result__/v2/ImplementPrivateEndpointAPIs.json index 24c36f072..9f4a50ecb 100644 --- a/regression/tests/__linting_result__/v2/ImplementPrivateEndpointAPIs.json +++ b/regression/tests/__linting_result__/v2/ImplementPrivateEndpointAPIs.json @@ -5,4 +5,4 @@ "jsonpath": "$.paths", "source": "specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/webapplicationfirewall.json:36:2" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/IntegerTypeMustHaveFormat.json b/regression/tests/__linting_result__/v2/IntegerTypeMustHaveFormat.json index 2813dc4d2..f0ff21daf 100644 --- a/regression/tests/__linting_result__/v2/IntegerTypeMustHaveFormat.json +++ b/regression/tests/__linting_result__/v2/IntegerTypeMustHaveFormat.json @@ -275,4 +275,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/targets\"].get.parameters[11]", "source": "specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/JobTargetExecutions.json:101:10" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/LROStatusCodesReturnTypeSchema.json b/regression/tests/__linting_result__/v2/LROStatusCodesReturnTypeSchema.json index 9aaa8005c..ae7b9030a 100644 --- a/regression/tests/__linting_result__/v2/LROStatusCodesReturnTypeSchema.json +++ b/regression/tests/__linting_result__/v2/LROStatusCodesReturnTypeSchema.json @@ -29,4 +29,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindows/current\"].put.responses[\"200\"]", "source": "specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/MaintenanceWindows.json:114:10" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/ListInOperationName.json b/regression/tests/__linting_result__/v2/ListInOperationName.json index 5d646ab95..798aad624 100644 --- a/regression/tests/__linting_result__/v2/ListInOperationName.json +++ b/regression/tests/__linting_result__/v2/ListInOperationName.json @@ -65,4 +65,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommand\"].post.operationId", "source": "specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/runCommands.json:130:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/LocationMustHaveXmsMutability.json b/regression/tests/__linting_result__/v2/LocationMustHaveXmsMutability.json index 4bf07e543..c1403de3f 100644 --- a/regression/tests/__linting_result__/v2/LocationMustHaveXmsMutability.json +++ b/regression/tests/__linting_result__/v2/LocationMustHaveXmsMutability.json @@ -17,4 +17,4 @@ "jsonpath": "$.definitions", "source": "specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/cloudService.json:1660:2" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/LongRunningOperationsOptionsValidator.json b/regression/tests/__linting_result__/v2/LongRunningOperationsOptionsValidator.json index 6e20db7a0..6fd1af943 100644 --- a/regression/tests/__linting_result__/v2/LongRunningOperationsOptionsValidator.json +++ b/regression/tests/__linting_result__/v2/LongRunningOperationsOptionsValidator.json @@ -149,4 +149,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/postbackup\"]", "source": "specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/storagesync.json:1496:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/LongRunningOperationsWithLongRunningExtension.json b/regression/tests/__linting_result__/v2/LongRunningOperationsWithLongRunningExtension.json index ae0020360..8f269770b 100644 --- a/regression/tests/__linting_result__/v2/LongRunningOperationsWithLongRunningExtension.json +++ b/regression/tests/__linting_result__/v2/LongRunningOperationsWithLongRunningExtension.json @@ -11,4 +11,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}\"].put", "source": "specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/TransparentDataEncryptions.json:82:6" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/MissingTypeObject.json b/regression/tests/__linting_result__/v2/MissingTypeObject.json index 1467b3ab1..6e2de4d9a 100644 --- a/regression/tests/__linting_result__/v2/MissingTypeObject.json +++ b/regression/tests/__linting_result__/v2/MissingTypeObject.json @@ -8663,4 +8663,4 @@ "jsonpath": "$.definitions.TagsResource.properties.tags", "source": "specification/monitor/resource-manager/Microsoft.Insights/preview/2019-10-17-preview/privateLinkScopes_API.json:822:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/NestedResourcesMustHaveListOperation.json b/regression/tests/__linting_result__/v2/NestedResourcesMustHaveListOperation.json index 02aeb9453..9dbbe917e 100644 --- a/regression/tests/__linting_result__/v2/NestedResourcesMustHaveListOperation.json +++ b/regression/tests/__linting_result__/v2/NestedResourcesMustHaveListOperation.json @@ -29,4 +29,4 @@ "jsonpath": "$.definitions.ManagementPolicy", "source": "specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/storage.json:4478:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/NonApplicationJsonType.json b/regression/tests/__linting_result__/v2/NonApplicationJsonType.json index 2eb69d8cd..c9d4e0238 100644 --- a/regression/tests/__linting_result__/v2/NonApplicationJsonType.json +++ b/regression/tests/__linting_result__/v2/NonApplicationJsonType.json @@ -17,4 +17,4 @@ "jsonpath": "$.produces[1]", "source": "specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/runCommands.json:18:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/OperationDescriptionOrSummaryRequired.json b/regression/tests/__linting_result__/v2/OperationDescriptionOrSummaryRequired.json index 76f242a7d..3272f946a 100644 --- a/regression/tests/__linting_result__/v2/OperationDescriptionOrSummaryRequired.json +++ b/regression/tests/__linting_result__/v2/OperationDescriptionOrSummaryRequired.json @@ -5,4 +5,4 @@ "jsonpath": "$.paths[\"/providers/Microsoft.Migrate/operations\"].get", "source": "specification/resourcemover/resource-manager/Microsoft.Migrate/stable/2021-08-01/resourcemovercollection.json:881:6" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/OperationIdNounConflictingModelNames.json b/regression/tests/__linting_result__/v2/OperationIdNounConflictingModelNames.json index f1aeba0bd..df0d935ca 100644 --- a/regression/tests/__linting_result__/v2/OperationIdNounConflictingModelNames.json +++ b/regression/tests/__linting_result__/v2/OperationIdNounConflictingModelNames.json @@ -389,4 +389,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages\"].get.operationId", "source": "specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/compute.json:3014:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/OperationIdNounVerb.json b/regression/tests/__linting_result__/v2/OperationIdNounVerb.json index f86b8b1b4..d8c6f8aaf 100644 --- a/regression/tests/__linting_result__/v2/OperationIdNounVerb.json +++ b/regression/tests/__linting_result__/v2/OperationIdNounVerb.json @@ -89,4 +89,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/disconnectVirtualNetworkGatewayVpnConnections\"].post.operationId", "source": "specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/virtualNetworkGateway.json:2277:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/OperationsApiResponseSchema.json b/regression/tests/__linting_result__/v2/OperationsApiResponseSchema.json index a4869d118..a2b2a9f19 100644 --- a/regression/tests/__linting_result__/v2/OperationsApiResponseSchema.json +++ b/regression/tests/__linting_result__/v2/OperationsApiResponseSchema.json @@ -65,4 +65,4 @@ "jsonpath": "$.paths[\"/providers/Microsoft.StorageSync/operations\"]", "source": "specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/storagesync.json:22:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/PageableOperation.json b/regression/tests/__linting_result__/v2/PageableOperation.json index 7cbda1637..e0c01654e 100644 --- a/regression/tests/__linting_result__/v2/PageableOperation.json +++ b/regression/tests/__linting_result__/v2/PageableOperation.json @@ -191,4 +191,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability\"].get", "source": "specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/virtualNetwork.json:1162:6" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/ParameterDescriptionRequired.json b/regression/tests/__linting_result__/v2/ParameterDescriptionRequired.json index cac732922..c3bd36cb4 100644 --- a/regression/tests/__linting_result__/v2/ParameterDescriptionRequired.json +++ b/regression/tests/__linting_result__/v2/ParameterDescriptionRequired.json @@ -695,4 +695,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}\"].get.parameters[3]", "source": "specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/compute.json:1806:10" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/ParametersOrder.json b/regression/tests/__linting_result__/v2/ParametersOrder.json index a6977a977..777d3b497 100644 --- a/regression/tests/__linting_result__/v2/ParametersOrder.json +++ b/regression/tests/__linting_result__/v2/ParametersOrder.json @@ -119,4 +119,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roles/{roleName}\"].get", "source": "specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/cloudService.json:482:6" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/PatchInOperationName.json b/regression/tests/__linting_result__/v2/PatchInOperationName.json index 398c7711a..4f4096ffb 100644 --- a/regression/tests/__linting_result__/v2/PatchInOperationName.json +++ b/regression/tests/__linting_result__/v2/PatchInOperationName.json @@ -11,4 +11,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/signatureOverrides/default\"].patch.operationId", "source": "specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/firewallPolicy.json:625:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/PathResourceProviderMatchNamespace.json b/regression/tests/__linting_result__/v2/PathResourceProviderMatchNamespace.json index fbbc6338f..1aa7adec7 100644 --- a/regression/tests/__linting_result__/v2/PathResourceProviderMatchNamespace.json +++ b/regression/tests/__linting_result__/v2/PathResourceProviderMatchNamespace.json @@ -125,4 +125,4 @@ "jsonpath": "$.paths[\"/{resourceUri}/providers/microsoft.insights/metricNamespaces\"]", "source": "specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/metricNamespaces_API.json:36:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/PathResourceProviderNamePascalCase.json b/regression/tests/__linting_result__/v2/PathResourceProviderNamePascalCase.json index 8e9620c28..d09afb6f4 100644 --- a/regression/tests/__linting_result__/v2/PathResourceProviderNamePascalCase.json +++ b/regression/tests/__linting_result__/v2/PathResourceProviderNamePascalCase.json @@ -71,4 +71,4 @@ "jsonpath": "$.paths[\"/{resourceUri}/providers/microsoft.insights/metricNamespaces\"]", "source": "specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/metricNamespaces_API.json:36:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/PathResourceTypeNameCamelCase.json b/regression/tests/__linting_result__/v2/PathResourceTypeNameCamelCase.json index 9170474ce..80eab6485 100644 --- a/regression/tests/__linting_result__/v2/PathResourceTypeNameCamelCase.json +++ b/regression/tests/__linting_result__/v2/PathResourceTypeNameCamelCase.json @@ -155,4 +155,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}\"]", "source": "specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/file.json:61:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/PostOperationIdContainsUrlVerb.json b/regression/tests/__linting_result__/v2/PostOperationIdContainsUrlVerb.json index 603cc89c3..5fa30e060 100644 --- a/regression/tests/__linting_result__/v2/PostOperationIdContainsUrlVerb.json +++ b/regression/tests/__linting_result__/v2/PostOperationIdContainsUrlVerb.json @@ -239,4 +239,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/configurations/{configurationName}\"].post.operationId", "source": "specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/configurations.json:84:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/PreviewVersionOverOneYear.json b/regression/tests/__linting_result__/v2/PreviewVersionOverOneYear.json index 42b791b01..edde2a770 100644 --- a/regression/tests/__linting_result__/v2/PreviewVersionOverOneYear.json +++ b/regression/tests/__linting_result__/v2/PreviewVersionOverOneYear.json @@ -665,4 +665,4 @@ "jsonpath": "$.info.version", "source": "specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/dataCollectionRules_API.json:6:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/PrivateEndpointResourceSchemaValidation.json b/regression/tests/__linting_result__/v2/PrivateEndpointResourceSchemaValidation.json index 22e711b52..bdc157e5a 100644 --- a/regression/tests/__linting_result__/v2/PrivateEndpointResourceSchemaValidation.json +++ b/regression/tests/__linting_result__/v2/PrivateEndpointResourceSchemaValidation.json @@ -11,4 +11,4 @@ "jsonpath": "$.definitions.PrivateLinkResourceListResult", "source": "specification/monitor/resource-manager/Microsoft.Insights/preview/2019-10-17-preview/privateLinkScopes_API.json:886:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/PutInOperationName.json b/regression/tests/__linting_result__/v2/PutInOperationName.json index da5b49961..31fcd843b 100644 --- a/regression/tests/__linting_result__/v2/PutInOperationName.json +++ b/regression/tests/__linting_result__/v2/PutInOperationName.json @@ -89,4 +89,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}\"].put.operationId", "source": "specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/compute.json:8744:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/PutRequestResponseScheme.json b/regression/tests/__linting_result__/v2/PutRequestResponseScheme.json index 94bdd4c19..9af2b31fa 100644 --- a/regression/tests/__linting_result__/v2/PutRequestResponseScheme.json +++ b/regression/tests/__linting_result__/v2/PutRequestResponseScheme.json @@ -101,4 +101,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}\"].put", "source": "specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/storagesync.json:870:6" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/RequiredDefaultResponse.json b/regression/tests/__linting_result__/v2/RequiredDefaultResponse.json index 7a60c7e5a..281fae43b 100644 --- a/regression/tests/__linting_result__/v2/RequiredDefaultResponse.json +++ b/regression/tests/__linting_result__/v2/RequiredDefaultResponse.json @@ -641,4 +641,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}/incidents\"].get.responses", "source": "specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/alertRulesIncidents_API.json:109:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/RequiredPropertiesMissingInResourceModel.json b/regression/tests/__linting_result__/v2/RequiredPropertiesMissingInResourceModel.json index e4d3b0dd5..d1220312c 100644 --- a/regression/tests/__linting_result__/v2/RequiredPropertiesMissingInResourceModel.json +++ b/regression/tests/__linting_result__/v2/RequiredPropertiesMissingInResourceModel.json @@ -17,4 +17,4 @@ "jsonpath": "$.definitions.ProxyResourceWithWritableName", "source": "specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/IPv6FirewallRules.json:264:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/RequiredReadOnlySystemData.json b/regression/tests/__linting_result__/v2/RequiredReadOnlySystemData.json index dd8f473bf..1c8080d2c 100644 --- a/regression/tests/__linting_result__/v2/RequiredReadOnlySystemData.json +++ b/regression/tests/__linting_result__/v2/RequiredReadOnlySystemData.json @@ -83,4 +83,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}\"].patch", "source": "specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/table.json:214:6" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/TopLevelResourcesListByResourceGroup.json b/regression/tests/__linting_result__/v2/TopLevelResourcesListByResourceGroup.json index 999d11dbf..7f4874072 100644 --- a/regression/tests/__linting_result__/v2/TopLevelResourcesListByResourceGroup.json +++ b/regression/tests/__linting_result__/v2/TopLevelResourcesListByResourceGroup.json @@ -5,4 +5,4 @@ "jsonpath": "$.definitions.DdosCustomPolicy", "source": "specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/ddosCustomPolicy.json:268:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/TopLevelResourcesListBySubscription.json b/regression/tests/__linting_result__/v2/TopLevelResourcesListBySubscription.json index 36c79ea5f..c4b5bc431 100644 --- a/regression/tests/__linting_result__/v2/TopLevelResourcesListBySubscription.json +++ b/regression/tests/__linting_result__/v2/TopLevelResourcesListBySubscription.json @@ -29,4 +29,4 @@ "jsonpath": "$.definitions.VirtualNetworkGatewayConnection", "source": "specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/virtualNetworkGateway.json:3495:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/TrackedResourceListByImmediateParent.json b/regression/tests/__linting_result__/v2/TrackedResourceListByImmediateParent.json index e5ffdfdfa..9d7e445d9 100644 --- a/regression/tests/__linting_result__/v2/TrackedResourceListByImmediateParent.json +++ b/regression/tests/__linting_result__/v2/TrackedResourceListByImmediateParent.json @@ -263,4 +263,4 @@ "jsonpath": "$.definitions.VirtualMachineScaleSetVM", "source": "specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/compute.json:16088:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/TrackedResourceListByResourceGroup.json b/regression/tests/__linting_result__/v2/TrackedResourceListByResourceGroup.json index 9131d718e..354bfeccd 100644 --- a/regression/tests/__linting_result__/v2/TrackedResourceListByResourceGroup.json +++ b/regression/tests/__linting_result__/v2/TrackedResourceListByResourceGroup.json @@ -41,4 +41,4 @@ "jsonpath": "$.definitions.VirtualMachineScaleSet", "source": "specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/compute.json:15517:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/TrackedResourceListBySubscription.json b/regression/tests/__linting_result__/v2/TrackedResourceListBySubscription.json index 541c43dbf..d6dcd78e9 100644 --- a/regression/tests/__linting_result__/v2/TrackedResourceListBySubscription.json +++ b/regression/tests/__linting_result__/v2/TrackedResourceListBySubscription.json @@ -11,4 +11,4 @@ "jsonpath": "$.definitions.VirtualMachineImageResource", "source": "specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/compute.json:11107:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/UniqueXmsExample.json b/regression/tests/__linting_result__/v2/UniqueXmsExample.json index 22f62e0f4..235cf2be2 100644 --- a/regression/tests/__linting_result__/v2/UniqueXmsExample.json +++ b/regression/tests/__linting_result__/v2/UniqueXmsExample.json @@ -881,4 +881,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/listIdpsFilterOptions\"].post[\"x-ms-examples\"]", "source": "specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/firewallPolicy.json:814:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/XmsEnumValidation.json b/regression/tests/__linting_result__/v2/XmsEnumValidation.json index af8c54432..ab2ac643c 100644 --- a/regression/tests/__linting_result__/v2/XmsEnumValidation.json +++ b/regression/tests/__linting_result__/v2/XmsEnumValidation.json @@ -101,4 +101,4 @@ "jsonpath": "$.definitions.UpsertManagedServerOperationStep.properties.status", "source": "specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/ManagedInstanceOperations.json:339:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v2/XmsIdentifierValidation.json b/regression/tests/__linting_result__/v2/XmsIdentifierValidation.json index 078f82bcd..f5d210621 100644 --- a/regression/tests/__linting_result__/v2/XmsIdentifierValidation.json +++ b/regression/tests/__linting_result__/v2/XmsIdentifierValidation.json @@ -1835,4 +1835,4 @@ "jsonpath": "$.definitions.operationListResult.properties.value", "source": "specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2020-05-01/ResourceHealth.json:479:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/APIVersionPattern.json b/regression/tests/__linting_result__/v3/APIVersionPattern.json index bfda5b4d7..f7c270185 100644 --- a/regression/tests/__linting_result__/v3/APIVersionPattern.json +++ b/regression/tests/__linting_result__/v3/APIVersionPattern.json @@ -5,4 +5,4 @@ "jsonpath": "$.info.version", "source": "" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/AllResourcesMustHaveDelete.json b/regression/tests/__linting_result__/v3/AllResourcesMustHaveDelete.json index a4b573bb9..a595abae6 100644 --- a/regression/tests/__linting_result__/v3/AllResourcesMustHaveDelete.json +++ b/regression/tests/__linting_result__/v3/AllResourcesMustHaveDelete.json @@ -35,4 +35,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}\"]", "source": "specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/ServerConnectionPolicies.json:19:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/AllResourcesMustHaveGetOperation.json b/regression/tests/__linting_result__/v3/AllResourcesMustHaveGetOperation.json index 6608f2549..b52c0c119 100644 --- a/regression/tests/__linting_result__/v3/AllResourcesMustHaveGetOperation.json +++ b/regression/tests/__linting_result__/v3/AllResourcesMustHaveGetOperation.json @@ -17,4 +17,4 @@ "jsonpath": "$.definitions.InboundSecurityRule", "source": "specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/networkVirtualAppliance.json:1099:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/ApiVersionParameterRequired.json b/regression/tests/__linting_result__/v3/ApiVersionParameterRequired.json index b9f7d7077..3bf3ed154 100644 --- a/regression/tests/__linting_result__/v3/ApiVersionParameterRequired.json +++ b/regression/tests/__linting_result__/v3/ApiVersionParameterRequired.json @@ -35,4 +35,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/signatureOverrides/default\"].put", "source": "specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/firewallPolicy.json:675:6" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/ArmResourcePropertiesBag.json b/regression/tests/__linting_result__/v3/ArmResourcePropertiesBag.json index c5ec940da..a8e96b412 100644 --- a/regression/tests/__linting_result__/v3/ArmResourcePropertiesBag.json +++ b/regression/tests/__linting_result__/v3/ArmResourcePropertiesBag.json @@ -41,4 +41,4 @@ "jsonpath": "$.definitions.VpnServerConfiguration", "source": "specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/virtualWan.json:7403:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/ArrayMustHaveType.json b/regression/tests/__linting_result__/v3/ArrayMustHaveType.json index 91102be88..ddc10fbde 100644 --- a/regression/tests/__linting_result__/v3/ArrayMustHaveType.json +++ b/regression/tests/__linting_result__/v3/ArrayMustHaveType.json @@ -5,4 +5,4 @@ "jsonpath": "$.definitions.ErrorResponse.properties.error.properties.details.items", "source": "specification/storageimportexport/resource-manager/Microsoft.ImportExport/preview/2021-01-01/storageimportexport.json:574:14" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/AvoidAnonymousTypes.json b/regression/tests/__linting_result__/v3/AvoidAnonymousTypes.json index 1c5a92ea5..7d5c39e0b 100644 --- a/regression/tests/__linting_result__/v3/AvoidAnonymousTypes.json +++ b/regression/tests/__linting_result__/v3/AvoidAnonymousTypes.json @@ -5,4 +5,4 @@ "jsonpath": "$.definitions.ManagedServiceIdentity.properties.userAssignedIdentities.additionalProperties", "source": "specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/network.json:221:10" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/AvoidNestedProperties.json b/regression/tests/__linting_result__/v3/AvoidNestedProperties.json index ec34420f0..10c3bea0e 100644 --- a/regression/tests/__linting_result__/v3/AvoidNestedProperties.json +++ b/regression/tests/__linting_result__/v3/AvoidNestedProperties.json @@ -341,4 +341,4 @@ "jsonpath": "$.definitions.impactedResourceStatus.properties.properties.properties", "source": "specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2020-05-01/ResourceHealth.json:267:10" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/AzureResourceTagsSchema.json b/regression/tests/__linting_result__/v3/AzureResourceTagsSchema.json index 3d53d453d..b7564a5e5 100644 --- a/regression/tests/__linting_result__/v3/AzureResourceTagsSchema.json +++ b/regression/tests/__linting_result__/v3/AzureResourceTagsSchema.json @@ -5,4 +5,4 @@ "jsonpath": "$.definitions.JobResponse", "source": "specification/storageimportexport/resource-manager/Microsoft.ImportExport/preview/2021-01-01/storageimportexport.json:823:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/BodyTopLevelProperties.json b/regression/tests/__linting_result__/v3/BodyTopLevelProperties.json index c73299b1e..3605c4d6b 100644 --- a/regression/tests/__linting_result__/v3/BodyTopLevelProperties.json +++ b/regression/tests/__linting_result__/v3/BodyTopLevelProperties.json @@ -41,4 +41,4 @@ "jsonpath": "$.definitions.VirtualMachineScaleSetVM", "source": "specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/compute.json:16088:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/ConsistentPatchProperties.json b/regression/tests/__linting_result__/v3/ConsistentPatchProperties.json index 5c7bb79ba..555ad0fd8 100644 --- a/regression/tests/__linting_result__/v3/ConsistentPatchProperties.json +++ b/regression/tests/__linting_result__/v3/ConsistentPatchProperties.json @@ -23,4 +23,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/recommendedSensitivityLabels\"].patch.parameters[\"3\"].schema", "source": "specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/SensitivityLabels.json:214:12" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/CreateOperationAsyncResponseValidation.json b/regression/tests/__linting_result__/v3/CreateOperationAsyncResponseValidation.json index 38864baa4..aa0ff2cd3 100644 --- a/regression/tests/__linting_result__/v3/CreateOperationAsyncResponseValidation.json +++ b/regression/tests/__linting_result__/v3/CreateOperationAsyncResponseValidation.json @@ -1733,4 +1733,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/storageTargets/{storageTargetName}\"].put.responses[\"202\"]", "source": "specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/storagecache.json:1023:10" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/DefaultErrorResponseSchema.json b/regression/tests/__linting_result__/v3/DefaultErrorResponseSchema.json index 95a43e5e7..d708efacc 100644 --- a/regression/tests/__linting_result__/v3/DefaultErrorResponseSchema.json +++ b/regression/tests/__linting_result__/v3/DefaultErrorResponseSchema.json @@ -869,4 +869,4 @@ "jsonpath": "$.paths[\"/{resourceUri}/providers/microsoft.insights/metricNamespaces\"].get.responses.default", "source": "specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/metricNamespaces_API.json:55:10" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/DefinitionsPropertiesNamesCamelCase.json b/regression/tests/__linting_result__/v3/DefinitionsPropertiesNamesCamelCase.json index b23cb6976..7d0c9bf1e 100644 --- a/regression/tests/__linting_result__/v3/DefinitionsPropertiesNamesCamelCase.json +++ b/regression/tests/__linting_result__/v3/DefinitionsPropertiesNamesCamelCase.json @@ -401,4 +401,4 @@ "jsonpath": "$.definitions.availabilityStatus.properties.properties.properties.resolutionETA", "source": "specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2020-05-01/ResourceHealth.json:412:12" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/DeleteInOperationName.json b/regression/tests/__linting_result__/v3/DeleteInOperationName.json index 1160a4e13..e1787d051 100644 --- a/regression/tests/__linting_result__/v3/DeleteInOperationName.json +++ b/regression/tests/__linting_result__/v3/DeleteInOperationName.json @@ -11,4 +11,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring\"].delete.operationId", "source": "specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/extensions.json:141:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/DeleteOperationAsyncResponseValidation.json b/regression/tests/__linting_result__/v3/DeleteOperationAsyncResponseValidation.json index ab6e44e5b..d9f4d2f2d 100644 --- a/regression/tests/__linting_result__/v3/DeleteOperationAsyncResponseValidation.json +++ b/regression/tests/__linting_result__/v3/DeleteOperationAsyncResponseValidation.json @@ -467,4 +467,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/storageTargets/{storageTargetName}\"].delete", "source": "specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/storagecache.json:875:6" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/DeleteOperationResponses.json b/regression/tests/__linting_result__/v3/DeleteOperationResponses.json index 5eeefeab1..d4b15c5ec 100644 --- a/regression/tests/__linting_result__/v3/DeleteOperationResponses.json +++ b/regression/tests/__linting_result__/v3/DeleteOperationResponses.json @@ -101,4 +101,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}\"].delete.responses", "source": "specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/table.json:340:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/DeleteResponseBodyEmpty.json b/regression/tests/__linting_result__/v3/DeleteResponseBodyEmpty.json index ba23d9813..e6193c9c4 100644 --- a/regression/tests/__linting_result__/v3/DeleteResponseBodyEmpty.json +++ b/regression/tests/__linting_result__/v3/DeleteResponseBodyEmpty.json @@ -17,4 +17,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}\"].delete.responses[\"200\"].schema", "source": "specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/blob.json:659:12" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/DeprecatedXmsCodeGenerationSetting.json b/regression/tests/__linting_result__/v3/DeprecatedXmsCodeGenerationSetting.json index d069e0ada..79faf823b 100644 --- a/regression/tests/__linting_result__/v3/DeprecatedXmsCodeGenerationSetting.json +++ b/regression/tests/__linting_result__/v3/DeprecatedXmsCodeGenerationSetting.json @@ -119,4 +119,4 @@ "jsonpath": "$.info[\"x-ms-code-generation-settings\"]", "source": "specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/storagesync.json:7:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/EnumInsteadOfBoolean.json b/regression/tests/__linting_result__/v3/EnumInsteadOfBoolean.json index aeb09543e..8c86ff2bf 100644 --- a/regression/tests/__linting_result__/v3/EnumInsteadOfBoolean.json +++ b/regression/tests/__linting_result__/v3/EnumInsteadOfBoolean.json @@ -3227,4 +3227,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/targets\"].get.parameters[\"9\"]", "source": "specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/JobTargetExecutions.json:87:10" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/EnumMustRespectType.json b/regression/tests/__linting_result__/v3/EnumMustRespectType.json index a7a31c956..2bb540af9 100644 --- a/regression/tests/__linting_result__/v3/EnumMustRespectType.json +++ b/regression/tests/__linting_result__/v3/EnumMustRespectType.json @@ -5,4 +5,4 @@ "jsonpath": "$.definitions.BackupShortTermRetentionPolicyProperties.properties.diffBackupIntervalInHours", "source": "specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/BackupShortTermRetentionPolicies.json:265:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/GetCollectionResponseSchema.json b/regression/tests/__linting_result__/v3/GetCollectionResponseSchema.json index 2c141024c..5469fe6db 100644 --- a/regression/tests/__linting_result__/v3/GetCollectionResponseSchema.json +++ b/regression/tests/__linting_result__/v3/GetCollectionResponseSchema.json @@ -983,4 +983,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups\"]", "source": "" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/GetInOperationName.json b/regression/tests/__linting_result__/v3/GetInOperationName.json index 65acc2a8e..9eba99509 100644 --- a/regression/tests/__linting_result__/v3/GetInOperationName.json +++ b/regression/tests/__linting_result__/v3/GetInOperationName.json @@ -29,4 +29,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability\"].get.operationId", "source": "specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/virtualNetwork.json:1163:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/GuidUsage.json b/regression/tests/__linting_result__/v3/GuidUsage.json index 98c11bb1b..37c1621c7 100644 --- a/regression/tests/__linting_result__/v3/GuidUsage.json +++ b/regression/tests/__linting_result__/v3/GuidUsage.json @@ -365,4 +365,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/targets\"].get.parameters[\"4\"].format", "source": "specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/JobTargetExecutions.json:53:12" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/ImplementPrivateEndpointAPIs.json b/regression/tests/__linting_result__/v3/ImplementPrivateEndpointAPIs.json index 20b9861d1..b2a8b4b8e 100644 --- a/regression/tests/__linting_result__/v3/ImplementPrivateEndpointAPIs.json +++ b/regression/tests/__linting_result__/v3/ImplementPrivateEndpointAPIs.json @@ -59,4 +59,4 @@ "jsonpath": "$.paths", "source": "specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/PrivateEndpointConnections.json:18:2" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/IntegerTypeMustHaveFormat.json b/regression/tests/__linting_result__/v3/IntegerTypeMustHaveFormat.json index f6d34e1c8..b858c4ca1 100644 --- a/regression/tests/__linting_result__/v3/IntegerTypeMustHaveFormat.json +++ b/regression/tests/__linting_result__/v3/IntegerTypeMustHaveFormat.json @@ -275,4 +275,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/targets\"].get.parameters[11]", "source": "specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/JobTargetExecutions.json:101:10" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/ListInOperationName.json b/regression/tests/__linting_result__/v3/ListInOperationName.json index 63704794f..a3788da8e 100644 --- a/regression/tests/__linting_result__/v3/ListInOperationName.json +++ b/regression/tests/__linting_result__/v3/ListInOperationName.json @@ -89,4 +89,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getVpnClientConnectionHealth\"].post", "source": "specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/virtualNetworkGateway.json:2216:6" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/LocationMustHaveXmsMutability.json b/regression/tests/__linting_result__/v3/LocationMustHaveXmsMutability.json index 61057bd79..229dbddeb 100644 --- a/regression/tests/__linting_result__/v3/LocationMustHaveXmsMutability.json +++ b/regression/tests/__linting_result__/v3/LocationMustHaveXmsMutability.json @@ -317,4 +317,4 @@ "jsonpath": "$.definitions.availabilityStatus.properties.location", "source": "specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2020-05-01/ResourceHealth.json:353:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/LongRunningOperationsOptionsValidator.json b/regression/tests/__linting_result__/v3/LongRunningOperationsOptionsValidator.json index fcd7ff7f5..153964bbb 100644 --- a/regression/tests/__linting_result__/v3/LongRunningOperationsOptionsValidator.json +++ b/regression/tests/__linting_result__/v3/LongRunningOperationsOptionsValidator.json @@ -137,4 +137,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/postbackup\"]", "source": "specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/storagesync.json:1496:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/LongRunningResponseStatusCode.json b/regression/tests/__linting_result__/v3/LongRunningResponseStatusCode.json index 009c036de..69a95a428 100644 --- a/regression/tests/__linting_result__/v3/LongRunningResponseStatusCode.json +++ b/regression/tests/__linting_result__/v3/LongRunningResponseStatusCode.json @@ -419,4 +419,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}\"].put", "source": "specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/compute.json:8740:6" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/LroExtension.json b/regression/tests/__linting_result__/v3/LroExtension.json index 3b36b3018..88f1cebbd 100644 --- a/regression/tests/__linting_result__/v3/LroExtension.json +++ b/regression/tests/__linting_result__/v3/LroExtension.json @@ -11,4 +11,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules\"].put", "source": "specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/FirewallRules.json:212:6" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/LroLocationHeader.json b/regression/tests/__linting_result__/v3/LroLocationHeader.json index 784f6ac8f..f0922b41a 100644 --- a/regression/tests/__linting_result__/v3/LroLocationHeader.json +++ b/regression/tests/__linting_result__/v3/LroLocationHeader.json @@ -2687,4 +2687,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/upgrade\"].post.responses[\"202\"]", "source": "specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/storagecache.json:1295:10" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/LroPatch202.json b/regression/tests/__linting_result__/v3/LroPatch202.json index d52c9eab6..2a3266d73 100644 --- a/regression/tests/__linting_result__/v3/LroPatch202.json +++ b/regression/tests/__linting_result__/v3/LroPatch202.json @@ -101,4 +101,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}\"].patch.responses", "source": "specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2021-11-01-preview/sqlvm.json:867:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/LroStatusCodesReturnTypeSchema.json b/regression/tests/__linting_result__/v3/LroStatusCodesReturnTypeSchema.json index 80938a0d7..0242ea56c 100644 --- a/regression/tests/__linting_result__/v3/LroStatusCodesReturnTypeSchema.json +++ b/regression/tests/__linting_result__/v3/LroStatusCodesReturnTypeSchema.json @@ -23,4 +23,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring\"].put.responses[\"200\"]", "source": "specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/extensions.json:79:10" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/MissingTypeObject.json b/regression/tests/__linting_result__/v3/MissingTypeObject.json index 093f93293..2069b7745 100644 --- a/regression/tests/__linting_result__/v3/MissingTypeObject.json +++ b/regression/tests/__linting_result__/v3/MissingTypeObject.json @@ -8699,4 +8699,4 @@ "jsonpath": "$.definitions.ActionGroup.properties.webhookProperties", "source": "specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/activityLogAlerts_API.json:484:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/NestedResourcesMustHaveListOperation.json b/regression/tests/__linting_result__/v3/NestedResourcesMustHaveListOperation.json index f5bb9ebf8..7498850a7 100644 --- a/regression/tests/__linting_result__/v3/NestedResourcesMustHaveListOperation.json +++ b/regression/tests/__linting_result__/v3/NestedResourcesMustHaveListOperation.json @@ -83,4 +83,4 @@ "jsonpath": "$.definitions.RestorePoint", "source": "specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/compute.json:9913:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/NonApplicationJsonType.json b/regression/tests/__linting_result__/v3/NonApplicationJsonType.json index f163c94c9..2cddc3781 100644 --- a/regression/tests/__linting_result__/v3/NonApplicationJsonType.json +++ b/regression/tests/__linting_result__/v3/NonApplicationJsonType.json @@ -17,4 +17,4 @@ "jsonpath": "$.produces[\"1\"]", "source": "specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/runCommands.json:18:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/OperationIdNounConflictingModelNames.json b/regression/tests/__linting_result__/v3/OperationIdNounConflictingModelNames.json index 6e989ec69..d94d60de2 100644 --- a/regression/tests/__linting_result__/v3/OperationIdNounConflictingModelNames.json +++ b/regression/tests/__linting_result__/v3/OperationIdNounConflictingModelNames.json @@ -353,4 +353,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages\"].get.operationId", "source": "specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/compute.json:3014:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/OperationIdNounVerb.json b/regression/tests/__linting_result__/v3/OperationIdNounVerb.json index 0dd09456d..91a31104a 100644 --- a/regression/tests/__linting_result__/v3/OperationIdNounVerb.json +++ b/regression/tests/__linting_result__/v3/OperationIdNounVerb.json @@ -119,4 +119,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/disconnectVirtualNetworkGatewayVpnConnections\"].post.operationId", "source": "specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/virtualNetworkGateway.json:2277:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/OperationSummaryOrDescription.json b/regression/tests/__linting_result__/v3/OperationSummaryOrDescription.json index 3cc5dcb33..341d3190d 100644 --- a/regression/tests/__linting_result__/v3/OperationSummaryOrDescription.json +++ b/regression/tests/__linting_result__/v3/OperationSummaryOrDescription.json @@ -5,4 +5,4 @@ "jsonpath": "$.paths[\"/providers/Microsoft.Migrate/operations\"].get", "source": "specification/resourcemover/resource-manager/Microsoft.Migrate/stable/2021-08-01/resourcemovercollection.json:881:6" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/OperationsAPIImplementation.json b/regression/tests/__linting_result__/v3/OperationsAPIImplementation.json index 6302f5e05..79972a919 100644 --- a/regression/tests/__linting_result__/v3/OperationsAPIImplementation.json +++ b/regression/tests/__linting_result__/v3/OperationsAPIImplementation.json @@ -5,4 +5,4 @@ "jsonpath": " $", "source": "specification/resources/resource-manager/Microsoft.Resources/preview/2022-03-01-preview/changes.json:1:0" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/OperationsApiResponseSchema.json b/regression/tests/__linting_result__/v3/OperationsApiResponseSchema.json index 3df7efa74..9eab4730f 100644 --- a/regression/tests/__linting_result__/v3/OperationsApiResponseSchema.json +++ b/regression/tests/__linting_result__/v3/OperationsApiResponseSchema.json @@ -65,4 +65,4 @@ "jsonpath": "$.paths[\"/providers/Microsoft.StorageSync/operations\"].get.responses[\"200\"].schema", "source": "specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/storagesync.json:43:12" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/PageableOperation.json b/regression/tests/__linting_result__/v3/PageableOperation.json index 7cbda1637..e0c01654e 100644 --- a/regression/tests/__linting_result__/v3/PageableOperation.json +++ b/regression/tests/__linting_result__/v3/PageableOperation.json @@ -191,4 +191,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability\"].get", "source": "specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/virtualNetwork.json:1162:6" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/ParameterDescription.json b/regression/tests/__linting_result__/v3/ParameterDescription.json index dbe61ab7b..73d4cfeee 100644 --- a/regression/tests/__linting_result__/v3/ParameterDescription.json +++ b/regression/tests/__linting_result__/v3/ParameterDescription.json @@ -695,4 +695,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/restore\"].post.parameters[\"3\"]", "source": "specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/file.json:502:10" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/ParameterNotDefinedInGlobalParameters.json b/regression/tests/__linting_result__/v3/ParameterNotDefinedInGlobalParameters.json index fa25dc9f5..941b9c0a1 100644 --- a/regression/tests/__linting_result__/v3/ParameterNotDefinedInGlobalParameters.json +++ b/regression/tests/__linting_result__/v3/ParameterNotDefinedInGlobalParameters.json @@ -7415,4 +7415,4 @@ "jsonpath": "$.paths[\"/{resourceUri}/providers/microsoft.insights/metricNamespaces\"].get.parameters", "source": "specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/metricNamespaces_API.json:43:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/ParametersOrder.json b/regression/tests/__linting_result__/v3/ParametersOrder.json index b5b753fa2..206969e6b 100644 --- a/regression/tests/__linting_result__/v3/ParametersOrder.json +++ b/regression/tests/__linting_result__/v3/ParametersOrder.json @@ -119,4 +119,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roles/{roleName}\"].get", "source": "specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/cloudService.json:482:6" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/PatchBodyParametersSchema.json b/regression/tests/__linting_result__/v3/PatchBodyParametersSchema.json index 95c3439dd..202fe00d1 100644 --- a/regression/tests/__linting_result__/v3/PatchBodyParametersSchema.json +++ b/regression/tests/__linting_result__/v3/PatchBodyParametersSchema.json @@ -11,4 +11,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool/diskPools/{diskPoolName}/iscsiTargets/{iscsiTargetName}\"].patch.parameters[\"4\"].schema", "source": "specification/storagepool/resource-manager/Microsoft.StoragePool/stable/2021-08-01/storagepool.json:747:10" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/PatchIdentityProperty.json b/regression/tests/__linting_result__/v3/PatchIdentityProperty.json index 2fbf5698a..ab8a5341c 100644 --- a/regression/tests/__linting_result__/v3/PatchIdentityProperty.json +++ b/regression/tests/__linting_result__/v3/PatchIdentityProperty.json @@ -47,4 +47,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}\"].patch.parameters[\"2\"]", "source": "specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2021-11-01-preview/sqlvm.json:851:10" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/PatchInOperationName.json b/regression/tests/__linting_result__/v3/PatchInOperationName.json index 398c7711a..4f4096ffb 100644 --- a/regression/tests/__linting_result__/v3/PatchInOperationName.json +++ b/regression/tests/__linting_result__/v3/PatchInOperationName.json @@ -11,4 +11,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/signatureOverrides/default\"].patch.operationId", "source": "specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/firewallPolicy.json:625:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/PatchSkuProperty.json b/regression/tests/__linting_result__/v3/PatchSkuProperty.json index e4d128b89..f9e9cb282 100644 --- a/regression/tests/__linting_result__/v3/PatchSkuProperty.json +++ b/regression/tests/__linting_result__/v3/PatchSkuProperty.json @@ -53,4 +53,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}\"].patch.parameters[\"3\"]", "source": "specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/JobAgents.json:237:10" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/PathForNestedResource.json b/regression/tests/__linting_result__/v3/PathForNestedResource.json index 78a0089c3..d16def982 100644 --- a/regression/tests/__linting_result__/v3/PathForNestedResource.json +++ b/regression/tests/__linting_result__/v3/PathForNestedResource.json @@ -47,4 +47,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindows/current\"]", "source": "specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/MaintenanceWindows.json:19:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/PathForPutOperation.json b/regression/tests/__linting_result__/v3/PathForPutOperation.json index 07ad02330..01a45860f 100644 --- a/regression/tests/__linting_result__/v3/PathForPutOperation.json +++ b/regression/tests/__linting_result__/v3/PathForPutOperation.json @@ -5,4 +5,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/providers/Microsoft.Insights/logprofiles/{logProfileName}\"]", "source": "specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/logProfiles_API.json:39:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/PathForResourceAction.json b/regression/tests/__linting_result__/v3/PathForResourceAction.json index 0250e066b..7f7c3839c 100644 --- a/regression/tests/__linting_result__/v3/PathForResourceAction.json +++ b/regression/tests/__linting_result__/v3/PathForResourceAction.json @@ -65,4 +65,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTablesSummary/{devicePath}\"]", "source": "specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/expressRouteCrossConnection.json:607:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/PathResourceProviderMatchNamespace.json b/regression/tests/__linting_result__/v3/PathResourceProviderMatchNamespace.json index fbbc6338f..1aa7adec7 100644 --- a/regression/tests/__linting_result__/v3/PathResourceProviderMatchNamespace.json +++ b/regression/tests/__linting_result__/v3/PathResourceProviderMatchNamespace.json @@ -125,4 +125,4 @@ "jsonpath": "$.paths[\"/{resourceUri}/providers/microsoft.insights/metricNamespaces\"]", "source": "specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/metricNamespaces_API.json:36:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/PathResourceProviderNamePascalCase.json b/regression/tests/__linting_result__/v3/PathResourceProviderNamePascalCase.json index 8e9620c28..d09afb6f4 100644 --- a/regression/tests/__linting_result__/v3/PathResourceProviderNamePascalCase.json +++ b/regression/tests/__linting_result__/v3/PathResourceProviderNamePascalCase.json @@ -71,4 +71,4 @@ "jsonpath": "$.paths[\"/{resourceUri}/providers/microsoft.insights/metricNamespaces\"]", "source": "specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/metricNamespaces_API.json:36:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/PathResourceTypeNameCamelCase.json b/regression/tests/__linting_result__/v3/PathResourceTypeNameCamelCase.json index 9170474ce..80eab6485 100644 --- a/regression/tests/__linting_result__/v3/PathResourceTypeNameCamelCase.json +++ b/regression/tests/__linting_result__/v3/PathResourceTypeNameCamelCase.json @@ -155,4 +155,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}\"]", "source": "specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/file.json:61:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/PostOperationAsyncResponseValidation.json b/regression/tests/__linting_result__/v3/PostOperationAsyncResponseValidation.json index c27243ad5..eb7a705c2 100644 --- a/regression/tests/__linting_result__/v3/PostOperationAsyncResponseValidation.json +++ b/regression/tests/__linting_result__/v3/PostOperationAsyncResponseValidation.json @@ -671,4 +671,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/upgrade\"].post.responses[\"201\"]", "source": "specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/storagecache.json:1292:10" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/PostOperationIdContainsUrlVerb.json b/regression/tests/__linting_result__/v3/PostOperationIdContainsUrlVerb.json index fd48a769e..118e90538 100644 --- a/regression/tests/__linting_result__/v3/PostOperationIdContainsUrlVerb.json +++ b/regression/tests/__linting_result__/v3/PostOperationIdContainsUrlVerb.json @@ -335,4 +335,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTablesSummary/{devicePath}\"].post.operationId", "source": "specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/expressRouteCrossConnection.json:612:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/PreviewVersionOverOneYear.json b/regression/tests/__linting_result__/v3/PreviewVersionOverOneYear.json index 42b791b01..edde2a770 100644 --- a/regression/tests/__linting_result__/v3/PreviewVersionOverOneYear.json +++ b/regression/tests/__linting_result__/v3/PreviewVersionOverOneYear.json @@ -665,4 +665,4 @@ "jsonpath": "$.info.version", "source": "specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/dataCollectionRules_API.json:6:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/PrivateEndpointResourceSchemaValidation.json b/regression/tests/__linting_result__/v3/PrivateEndpointResourceSchemaValidation.json index 9824a4cf7..a82b5402f 100644 --- a/regression/tests/__linting_result__/v3/PrivateEndpointResourceSchemaValidation.json +++ b/regression/tests/__linting_result__/v3/PrivateEndpointResourceSchemaValidation.json @@ -11,4 +11,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/privateLinkResources\"].get.responses[\"200\"]", "source": "specification/monitor/resource-manager/Microsoft.Insights/preview/2019-10-17-preview/privateLinkScopes_API.json:325:10" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/ProvisioningStateValidation.json b/regression/tests/__linting_result__/v3/ProvisioningStateValidation.json index fec086ed2..687b76d28 100644 --- a/regression/tests/__linting_result__/v3/ProvisioningStateValidation.json +++ b/regression/tests/__linting_result__/v3/ProvisioningStateValidation.json @@ -83,4 +83,4 @@ "jsonpath": "$.definitions.StorageTargetProperties.properties.provisioningState", "source": "specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/storagecache.json:2249:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/PutGetPatchResponseSchema.json b/regression/tests/__linting_result__/v3/PutGetPatchResponseSchema.json index dd706d4aa..50839f57f 100644 --- a/regression/tests/__linting_result__/v3/PutGetPatchResponseSchema.json +++ b/regression/tests/__linting_result__/v3/PutGetPatchResponseSchema.json @@ -41,4 +41,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules\"]", "source": "specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/FirewallRules.json:171:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/PutInOperationName.json b/regression/tests/__linting_result__/v3/PutInOperationName.json index e8f830d5a..34b1ef1e3 100644 --- a/regression/tests/__linting_result__/v3/PutInOperationName.json +++ b/regression/tests/__linting_result__/v3/PutInOperationName.json @@ -95,4 +95,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey\"].put.operationId", "source": "specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/virtualNetworkGateway.json:1469:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/PutRequestResponseScheme.json b/regression/tests/__linting_result__/v3/PutRequestResponseScheme.json index b9ad96f43..1cecbdc8c 100644 --- a/regression/tests/__linting_result__/v3/PutRequestResponseScheme.json +++ b/regression/tests/__linting_result__/v3/PutRequestResponseScheme.json @@ -485,4 +485,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}\"].put", "source": "specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/WorkloadGroups.json:67:6" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/RepeatedPathInfo.json b/regression/tests/__linting_result__/v3/RepeatedPathInfo.json index 5c33170cb..2045e4d47 100644 --- a/regression/tests/__linting_result__/v3/RepeatedPathInfo.json +++ b/regression/tests/__linting_result__/v3/RepeatedPathInfo.json @@ -65,4 +65,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}\"].put.parameters[\"5\"]", "source": "specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/table.json:195:10" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/RequiredDefaultResponse.json b/regression/tests/__linting_result__/v3/RequiredDefaultResponse.json index 7a60c7e5a..281fae43b 100644 --- a/regression/tests/__linting_result__/v3/RequiredDefaultResponse.json +++ b/regression/tests/__linting_result__/v3/RequiredDefaultResponse.json @@ -641,4 +641,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}/incidents\"].get.responses", "source": "specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/alertRulesIncidents_API.json:109:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/RequiredPropertiesMissingInResourceModel.json b/regression/tests/__linting_result__/v3/RequiredPropertiesMissingInResourceModel.json index 0367f32a7..c0f896662 100644 --- a/regression/tests/__linting_result__/v3/RequiredPropertiesMissingInResourceModel.json +++ b/regression/tests/__linting_result__/v3/RequiredPropertiesMissingInResourceModel.json @@ -509,4 +509,4 @@ "jsonpath": "$.definitions.WebApplicationFirewallPolicy", "source": "specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/webapplicationfirewall.json:295:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/RequiredReadOnlySystemData.json b/regression/tests/__linting_result__/v3/RequiredReadOnlySystemData.json index 90a3978a0..a9de5b7a7 100644 --- a/regression/tests/__linting_result__/v3/RequiredReadOnlySystemData.json +++ b/regression/tests/__linting_result__/v3/RequiredReadOnlySystemData.json @@ -2975,4 +2975,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}\"].get", "source": "specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/WorkloadGroups.json:20:6" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/ResourceNameRestriction.json b/regression/tests/__linting_result__/v3/ResourceNameRestriction.json index edaabf219..1dc6c154e 100644 --- a/regression/tests/__linting_result__/v3/ResourceNameRestriction.json +++ b/regression/tests/__linting_result__/v3/ResourceNameRestriction.json @@ -8309,4 +8309,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}\"]", "source": "specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/WorkloadClassifiers.json:19:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/SchemaDescriptionOrTitle.json b/regression/tests/__linting_result__/v3/SchemaDescriptionOrTitle.json index fc02f2f4b..507b36ead 100644 --- a/regression/tests/__linting_result__/v3/SchemaDescriptionOrTitle.json +++ b/regression/tests/__linting_result__/v3/SchemaDescriptionOrTitle.json @@ -383,4 +383,4 @@ "jsonpath": "$.definitions.VMScaleSetConvertToSinglePlacementGroupInput", "source": "specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/compute.json:16691:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/SubscriptionsAndResourceGroupCasing.json b/regression/tests/__linting_result__/v3/SubscriptionsAndResourceGroupCasing.json index 8e5ed6e57..4033a0834 100644 --- a/regression/tests/__linting_result__/v3/SubscriptionsAndResourceGroupCasing.json +++ b/regression/tests/__linting_result__/v3/SubscriptionsAndResourceGroupCasing.json @@ -143,4 +143,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}/incidents/{incidentName}\"]", "source": "specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/alertRulesIncidents_API.json:39:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/TopLevelResourcesListByResourceGroup.json b/regression/tests/__linting_result__/v3/TopLevelResourcesListByResourceGroup.json index 999d11dbf..7f4874072 100644 --- a/regression/tests/__linting_result__/v3/TopLevelResourcesListByResourceGroup.json +++ b/regression/tests/__linting_result__/v3/TopLevelResourcesListByResourceGroup.json @@ -5,4 +5,4 @@ "jsonpath": "$.definitions.DdosCustomPolicy", "source": "specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/ddosCustomPolicy.json:268:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/TopLevelResourcesListBySubscription.json b/regression/tests/__linting_result__/v3/TopLevelResourcesListBySubscription.json index 186a5253f..374ad18af 100644 --- a/regression/tests/__linting_result__/v3/TopLevelResourcesListBySubscription.json +++ b/regression/tests/__linting_result__/v3/TopLevelResourcesListBySubscription.json @@ -65,4 +65,4 @@ "jsonpath": "$.definitions.VirtualNetworkGatewayConnection", "source": "specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/virtualNetworkGateway.json:3495:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/TrackedResourceBeyondsThirdLevel.json b/regression/tests/__linting_result__/v3/TrackedResourceBeyondsThirdLevel.json index 064cbae64..526fc38b8 100644 --- a/regression/tests/__linting_result__/v3/TrackedResourceBeyondsThirdLevel.json +++ b/regression/tests/__linting_result__/v3/TrackedResourceBeyondsThirdLevel.json @@ -23,4 +23,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}\"]", "source": "specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/compute.json:2308:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/TrackedResourcePatchOperation.json b/regression/tests/__linting_result__/v3/TrackedResourcePatchOperation.json index b2d6d22b1..c0d91a919 100644 --- a/regression/tests/__linting_result__/v3/TrackedResourcePatchOperation.json +++ b/regression/tests/__linting_result__/v3/TrackedResourcePatchOperation.json @@ -149,4 +149,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}\"]", "source": "specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/webapplicationfirewall.json:122:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/TrackedResourcesMustHavePut.json b/regression/tests/__linting_result__/v3/TrackedResourcesMustHavePut.json index 8c47b65d2..fea4ee372 100644 --- a/regression/tests/__linting_result__/v3/TrackedResourcesMustHavePut.json +++ b/regression/tests/__linting_result__/v3/TrackedResourcesMustHavePut.json @@ -77,4 +77,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}\"].put", "source": "specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/compute.json:2308:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/UnSupportedPatchProperties.json b/regression/tests/__linting_result__/v3/UnSupportedPatchProperties.json index d2793d786..073e6315d 100644 --- a/regression/tests/__linting_result__/v3/UnSupportedPatchProperties.json +++ b/regression/tests/__linting_result__/v3/UnSupportedPatchProperties.json @@ -335,4 +335,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}\"].patch.parameters[\"4\"]", "source": "specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/storagecache.json:528:10" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/UniqueXmsExample.json b/regression/tests/__linting_result__/v3/UniqueXmsExample.json index 6c39288ee..3c3cade1f 100644 --- a/regression/tests/__linting_result__/v3/UniqueXmsExample.json +++ b/regression/tests/__linting_result__/v3/UniqueXmsExample.json @@ -503,4 +503,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/listIdpsFilterOptions\"].post[\"x-ms-examples\"]", "source": "specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/firewallPolicy.json:814:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/XmsEnumValidation.json b/regression/tests/__linting_result__/v3/XmsEnumValidation.json index 3da71c24f..73601dd79 100644 --- a/regression/tests/__linting_result__/v3/XmsEnumValidation.json +++ b/regression/tests/__linting_result__/v3/XmsEnumValidation.json @@ -101,4 +101,4 @@ "jsonpath": "$.definitions.UpsertManagedServerOperationStep.properties.status", "source": "specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/ManagedInstanceOperations.json:339:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/XmsExamplesRequired.json b/regression/tests/__linting_result__/v3/XmsExamplesRequired.json index 57aaaaa5e..d111ac150 100644 --- a/regression/tests/__linting_result__/v3/XmsExamplesRequired.json +++ b/regression/tests/__linting_result__/v3/XmsExamplesRequired.json @@ -17,4 +17,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/remoteDesktopFile\"].get", "source": "specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/cloudService.json:428:6" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/XmsIdentifierValidation.json b/regression/tests/__linting_result__/v3/XmsIdentifierValidation.json index 84b4273c8..049f81941 100644 --- a/regression/tests/__linting_result__/v3/XmsIdentifierValidation.json +++ b/regression/tests/__linting_result__/v3/XmsIdentifierValidation.json @@ -1853,4 +1853,4 @@ "jsonpath": "$.definitions.operationListResult.properties.value", "source": "specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2020-05-01/ResourceHealth.json:479:8" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/XmsLongRunningOperationOptions.json b/regression/tests/__linting_result__/v3/XmsLongRunningOperationOptions.json index 654b76eaa..bd8d581a9 100644 --- a/regression/tests/__linting_result__/v3/XmsLongRunningOperationOptions.json +++ b/regression/tests/__linting_result__/v3/XmsLongRunningOperationOptions.json @@ -1667,4 +1667,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/storageTargets/{storageTargetName}\"].put", "source": "specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/storagecache.json:978:6" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/XmsParameterLocation.json b/regression/tests/__linting_result__/v3/XmsParameterLocation.json index 056b74bf1..7dc56b577 100644 --- a/regression/tests/__linting_result__/v3/XmsParameterLocation.json +++ b/regression/tests/__linting_result__/v3/XmsParameterLocation.json @@ -311,4 +311,4 @@ "jsonpath": "$.parameters.subscriptionId", "source": "specification/storageimportexport/resource-manager/Microsoft.ImportExport/preview/2021-01-01/storageimportexport.json:1292:4" } -] \ No newline at end of file +] diff --git a/regression/tests/__linting_result__/v3/XmsResourceInPutResponse.json b/regression/tests/__linting_result__/v3/XmsResourceInPutResponse.json index a0a3c3234..8b1fd04b9 100644 --- a/regression/tests/__linting_result__/v3/XmsResourceInPutResponse.json +++ b/regression/tests/__linting_result__/v3/XmsResourceInPutResponse.json @@ -5,4 +5,4 @@ "jsonpath": "$.paths[\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}\"].put", "source": "specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/networkWatcher.json:611:6" } -] \ No newline at end of file +] diff --git a/regression/tests/utils/previous-linting.ts b/regression/tests/utils/previous-linting.ts index 73327aa45..dfdbe688d 100644 --- a/regression/tests/utils/previous-linting.ts +++ b/regression/tests/utils/previous-linting.ts @@ -11,14 +11,14 @@ function getRelativePath(issuePath: string) { return issuePath.substring(issuePath.indexOf("specification/")) } -function getJsonPathFromRef(jsonRef:string) { - const index = jsonRef.indexOf(" "); - return jsonRef.substring(index + 2,jsonRef.length -1) +function getJsonPathFromRef(jsonRef: string) { + const index = jsonRef.indexOf(" ") + return jsonRef.substring(index + 2, jsonRef.length - 1) } -function getSourcePathFromRef(jsonRef:string) { - const index = jsonRef.indexOf(" "); - return jsonRef.substring(0,index) +function getSourcePathFromRef(jsonRef: string) { + const index = jsonRef.indexOf(" ") + return jsonRef.substring(0, index) } export async function runLinter(readme: string) { @@ -28,16 +28,15 @@ export async function runLinter(readme: string) { if (linterErrors.indexOf('{\n "type": "') !== -1) { linterErrors = cleanUpContent(linterErrors) const errorJsonStr = "[" + linterErrors + "]" - const errorJson = JSON.parse(errorJsonStr) - .map((issue:any) => { - if (issue.sources) { - issue.source = getSourcePathFromRef(getRelativePath(issue.sources[0])) - } - if (issue["json-path"]) { - issue["jsonpath"] = getJsonPathFromRef(getRelativePath(issue["json-path"])) - } - return _.pick(issue,["code","message","jsonpath","source"]) - }) + const errorJson = JSON.parse(errorJsonStr).map((issue: any) => { + if (issue.sources) { + issue.source = getSourcePathFromRef(getRelativePath(issue.sources[0])) + } + if (issue["json-path"]) { + issue["jsonpath"] = getJsonPathFromRef(getRelativePath(issue["json-path"])) + } + return _.pick(issue, ["code", "message", "jsonpath", "source"]) + }) toMatchSnapshotForEachCode(errorJson) } else { expect(linterErrors).toMatchSnapshot("returned empty results") @@ -48,8 +47,8 @@ export async function runLinter(readme: string) { } // runs the command on a given swagger spec. -async function runCmd(cmd:string) { - const { stdout, stderr } = await new Promise(res => +async function runCmd(cmd: string) { + const { stdout, stderr } = await new Promise((res) => exec(cmd, { encoding: "utf8", maxBuffer: 1024 * 1024 * 64 }, (err, stdout, stderr) => res({ stdout, stderr })) ) let resultString = "" @@ -65,7 +64,7 @@ async function runCmd(cmd:string) { return resultString } -function stripCharsBeforeAfterJson(s:string) { +function stripCharsBeforeAfterJson(s: string) { let resultString = "" resultString = s .substring(s.indexOf('{\n "type": "')) @@ -80,13 +79,12 @@ function stripCharsBeforeAfterJson(s:string) { return resultString } -function cleanUpContent(s:string) { - - const start = s.indexOf('{\n "type": "'); +function cleanUpContent(s: string) { + const start = s.indexOf('{\n "type": "') let resultString = s.substring(start) resultString = resultString.replace(/}\nProcessing batch task - {"package-(.*).\n{/g, "},{") resultString = resultString.replace(/{"package-(.*)} .\n/, "") - resultString = resultString.replace(/AutoRest core version selected from configuration/,"") + resultString = resultString.replace(/AutoRest core version selected from configuration/, "") resultString = resultString.replace(/\nProcessing batch task(.*)./g, "") resultString = resultString.replace(/}{/, "},{") resultString = resultString.replace(/}\n{/, "},{") @@ -96,9 +94,6 @@ function cleanUpContent(s:string) { /** * reverse a string. */ -function reverse(s:string) { - return s - .split("") - .reverse() - .join("") +function reverse(s: string) { + return s.split("").reverse().join("") }