This commit is contained in:
Yuchao Yan 2024-08-23 06:27:51 +08:00 коммит произвёл GitHub
Родитель 414977934f
Коммит 3ab2a26535
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
85 изменённых файлов: 575 добавлений и 831 удалений

Просмотреть файл

@ -0,0 +1,7 @@
---
changeKind: internal
packages:
- "@azure-tools/typespec-python"
---
Enable lint check in CI

Просмотреть файл

@ -0,0 +1,7 @@
---
changeKind: internal
packages:
- "@autorest/python"
---
update ci to use npm

1
.gitignore поставляемый
Просмотреть файл

@ -126,3 +126,4 @@ node_modules/
# Generated test folders
test/services/*/_generated
**/autorest.python/generator
**/autorest.python/scripts/eng

Просмотреть файл

@ -5,3 +5,4 @@ pytest==8.3.2
tox==4.18.0
coverage==7.6.1
black==24.8.0
setuptools==69.2.0

Просмотреть файл

@ -3,11 +3,10 @@ parameters:
installTypeSpec: false
installCadlRanch: false
folderName: ""
pythonCodeChecks: false
pythonFolderName: ""
regenerate: false
checkChange: true
updateToLatestTypespec: false
unitTest: false
steps:
- checkout: self
@ -55,12 +54,6 @@ steps:
workingDirectory: $(Build.SourcesDirectory)/autorest.python/
condition: and(succeeded(), eq(${{ parameters.updateToLatestTypespec }}, false))
# - script: pnpm change verify
# displayName: Check changelog
# workingDirectory: $(Build.SourcesDirectory)/autorest.python/
# condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/heads/publish/')), not(startsWith(variables['Build.SourceBranch'], 'refs/heads/dependabot/')))
# continueOnError: true
- script: pnpm list
displayName: Pnpm list
workingDirectory: $(Build.SourcesDirectory)/autorest.python/packages/typespec-python
@ -81,46 +74,39 @@ steps:
displayName: List installed packages
workingDirectory: $(Build.SourcesDirectory)/autorest.python/packages/${{parameters.folderName}}
- script: pylint ${{parameters.pythonFolderName}}
- script: pnpm run lint --command pylint
displayName: Pylint
workingDirectory: $(Build.SourcesDirectory)/autorest.python/packages/${{parameters.folderName}}
condition: and(succeeded(), ${{ parameters.pythonCodeChecks }})
- script: mypy ${{parameters.pythonFolderName}}
- script: pnpm run lint --command mypy
displayName: Mypy
workingDirectory: $(Build.SourcesDirectory)/autorest.python/packages/${{parameters.folderName}}
condition: and(succeeded(), ${{ parameters.pythonCodeChecks }})
- script: pyright ${{parameters.pythonFolderName}}
- script: pnpm run lint --command pyright
displayName: Pyright
workingDirectory: $(Build.SourcesDirectory)/autorest.python/packages/${{parameters.folderName}}
condition: and(succeeded(), ${{ parameters.pythonCodeChecks }})
- script: black $(Build.SourcesDirectory)/autorest.python
- script: pnpm run format
displayName: Black
workingDirectory: $(Build.SourcesDirectory)/autorest.python/packages/${{parameters.folderName}}
condition: and(succeeded(), ${{ parameters.pythonCodeChecks }})
- script: node ./eng/scripts/check-for-changed-files.js
displayName: Fail on black autorest diff
workingDirectory: $(Build.SourcesDirectory)/autorest.python/
condition: and(succeeded(), ${{ parameters.pythonCodeChecks }})
- script: |
cd test/unittests
tox run -e ci
displayName: Unit tests
workingDirectory: $(Build.SourcesDirectory)/autorest.python/packages/${{parameters.folderName}}/
condition: and(succeeded(), ${{ parameters.pythonCodeChecks }})
condition: and(succeeded(), ${{ parameters.unitTest }})
- script: inv regenerate
displayName: "Regenerate Code"
workingDirectory: $(Build.SourcesDirectory)/autorest.python/packages/${{parameters.folderName}}/
condition: and(succeeded(), ${{ parameters.regenerate }}, eq('${{parameters.folderName}}', 'autorest.python'))
- script: |
find test/azure/generated -type f ! -name '*apiview_mapping_python.json*' -delete
npm run regenerate
- script: npm run regenerate
displayName: "Regenerate Code"
workingDirectory: $(Build.SourcesDirectory)/autorest.python/packages/${{parameters.folderName}}/
condition: and(succeeded(), ${{ parameters.regenerate }}, eq('${{parameters.folderName}}', 'typespec-python'))

Просмотреть файл

@ -78,8 +78,7 @@ jobs:
parameters:
installAutorest: true
folderName: "autorest.python"
pythonCodeChecks: true
pythonFolderName: autorest
unitTest: true
regenerate: true
- script: |

Просмотреть файл

@ -12,11 +12,17 @@ from subprocess import check_call, CalledProcessError
import os
import logging
import sys
from util import run_check, AUTOREST_PACKAGE_DIR
from util import run_check
logging.getLogger().setLevel(logging.INFO)
config_file_location = os.path.join(AUTOREST_PACKAGE_DIR, "mypy.ini")
def get_config_file_location():
mypy_ini_path = os.path.join(os.getcwd(), "../../scripts/eng/mypy.ini")
if os.path.exists(mypy_ini_path):
return mypy_ini_path
else:
return os.path.join(os.getcwd(), "../../../scripts/eng/mypy.ini")
def _single_dir_mypy(mod):
@ -28,7 +34,7 @@ def _single_dir_mypy(mod):
"-m",
"mypy",
"--config-file",
config_file_location,
get_config_file_location(),
"--ignore-missing",
str(inner_class.absolute()),
]

Просмотреть файл

@ -12,11 +12,17 @@ from subprocess import check_call, CalledProcessError
import os
import logging
import sys
from util import run_check, AUTOREST_PACKAGE_DIR
from util import run_check
logging.getLogger().setLevel(logging.INFO)
rfc_file_location = os.path.join(AUTOREST_PACKAGE_DIR, "pylintrc")
def get_rfc_file_location():
rfc_file_location = os.path.join(os.getcwd(), "../../scripts/eng/pylintrc")
if os.path.exists(rfc_file_location):
return rfc_file_location
else:
return os.path.join(os.getcwd(), "../../../scripts/eng/pylintrc")
def _single_dir_pylint(mod):
@ -27,7 +33,7 @@ def _single_dir_pylint(mod):
sys.executable,
"-m",
"pylint",
"--rcfile={}".format(rfc_file_location),
"--rcfile={}".format(get_rfc_file_location()),
"--load-plugins=pylint_guidelines_checker",
"--output-format=parseable",
str(inner_class.absolute()),

Просмотреть файл

@ -8,15 +8,24 @@
# This script is used to execute pyright within a tox environment. Depending on which package is being executed against,
# a failure may be suppressed.
import os
from subprocess import check_output, CalledProcessError
import logging
import sys
import time
from util import run_check, AUTOREST_PACKAGE_DIR
from util import run_check
logging.getLogger().setLevel(logging.INFO)
def get_pyright_config_file_location():
pyright_config = os.path.join(os.getcwd(), "../../scripts/eng/pyrightconfig.json")
if os.path.exists(pyright_config):
return pyright_config
else:
return os.path.join(os.getcwd(), "../../../scripts/eng/pyrightconfig.json")
def _single_dir_pyright(mod):
inner_class = next(d for d in mod.iterdir() if d.is_dir() and not str(d).endswith("egg-info"))
retries = 3
@ -28,7 +37,7 @@ def _single_dir_pyright(mod):
"-m",
"pyright",
"-p",
str(AUTOREST_PACKAGE_DIR),
get_pyright_config_file_location(),
str(inner_class.absolute()),
],
text=True,

Просмотреть файл

@ -5,10 +5,12 @@
"scripts": {
"start": "node ./scripts/run-python3.js ./scripts/start.py",
"prepare": "node ./scripts/run-python3.js ./scripts/prepare.py",
"build": "node ./scripts/copy-generator.js --force",
"install": "node ./scripts/copy-generator.js && node ./scripts/run-python3.js ./scripts/install.py",
"build": "tsx ./scripts/copy-generator.ts --force",
"install": "tsx ./scripts/copy-generator.ts && node ./scripts/run-python3.js ./scripts/install.py",
"debug": "node ./scripts/run-python3.js ./scripts/start.py --debug",
"test": "tsx ./scripts/run-tests.ts"
"test": "tsx ./scripts/eng/run-tests.ts --validFolders azure/legacy azure/version-tolerant vanilla/legacy vanilla/version-tolerant dpg/version-tolerant",
"lint": "tsx ./scripts/eng/lint.ts --folderName autorest",
"format": "tsx ./scripts/eng/format.ts --folderName autorest"
},
"main": "index.js",
"repository": {
@ -34,7 +36,8 @@
"devDependencies": {
"@microsoft.azure/autorest.testserver": "^3.3.46",
"typescript": "~5.1.3",
"@azure-tools/typespec-python": "workspace:^"
"@azure-tools/typespec-python": "workspace:^",
"chalk": "5.3.0"
},
"files": [
"autorest/**/*.py",

Просмотреть файл

@ -1,19 +0,0 @@
const fs = require("fs-extra");
const path = require("path");
const force = process.argv[2] === "--force" ? true : false;
const typespecModulePath = path.join(__dirname, "..", "node_modules", "@azure-tools", "typespec-python");
// Define the source and destination directories
const sourceDir = path.join(typespecModulePath, "generator");
const destDir = path.join(__dirname, "..", "generator");
// Delete the destination directory if it exists
if (fs.existsSync(destDir)) {
if (force) fs.removeSync(destDir);
else process.exit(0);
}
// Copy the source directory to the destination directory
fs.copySync(sourceDir, destDir);

Просмотреть файл

@ -0,0 +1,24 @@
import { copyFileSync, readdirSync } from "fs";
import { existsSync, removeSync, copySync } from "fs-extra";
import { join } from "path";
const force: boolean = process.argv[2] === "--force";
function copyAndCreateDir(sourceDir: string, destDir: string) {
// Delete the destination directory if it exists
if (existsSync(destDir)) {
if (force) removeSync(destDir);
else process.exit(0);
}
// Copy the source directory to the destination directory
copySync(sourceDir, destDir);
}
const typespecModulePath: string = join(__dirname, "..", "node_modules", "@azure-tools", "typespec-python");
// Copy the generator directory
copyAndCreateDir(join(typespecModulePath, "generator"), join(__dirname, "..", "generator"));
// Copy the scripts directory
copyAndCreateDir(join(typespecModulePath, "scripts", "eng"), join(__dirname, "..", "scripts", "eng"));

Просмотреть файл

@ -33,3 +33,6 @@ ignore_missing_imports = True
[mypy-pygen.*]
ignore_missing_imports = True
[mypy-yaml.*]
ignore_missing_imports = True

Просмотреть файл

@ -0,0 +1,25 @@
// This script wraps logic in @azure-tools/extension to resolve
// the path to Python 3 so that a Python script file can be run
// from an npm script in package.json. It uses the same Python 3
// path resolution algorithm as AutoRest so that the behavior
// is fully consistent (and also supports AUTOREST_PYTHON_EXE).
//
// Invoke it like so: "tsx run-python3.ts script.py"
import cp from "child_process";
import { patchPythonPath } from "./system-requirements.js";
async function runPython3(...args: string[]) {
const command = await patchPythonPath(["python", ...args], {
version: ">=3.8",
environmentVariable: "AUTOREST_PYTHON_EXE",
});
cp.execSync(command.join(" "), {
stdio: [0, 1, 2],
});
}
runPython3(...process.argv.slice(2)).catch((err) => {
console.error(err.toString()); // eslint-disable-line no-console
process.exit(1);
});

Просмотреть файл

@ -0,0 +1,253 @@
import { SpawnOptions, ChildProcess, spawn } from "child_process";
import { coerce, satisfies } from "semver";
/*
* Copied from @autorest/system-requirements
*/
const execute = (command: string, cmdlineargs: Array<string>, options: MoreOptions = {}): Promise<ExecResult> => {
return new Promise((resolve, reject) => {
const cp = spawn(command, cmdlineargs, { ...options, stdio: "pipe", shell: true });
if (options.onCreate) {
options.onCreate(cp);
}
options.onStdOutData ? cp.stdout.on("data", options.onStdOutData) : cp;
options.onStdErrData ? cp.stderr.on("data", options.onStdErrData) : cp;
let err = "";
let out = "";
let all = "";
cp.stderr.on("data", (chunk) => {
err += chunk;
all += chunk;
});
cp.stdout.on("data", (chunk) => {
out += chunk;
all += chunk;
});
cp.on("error", (err) => {
reject(err);
});
cp.on("close", (code, signal) =>
resolve({
stdout: out,
stderr: err,
log: all,
error: code ? new Error("Process Failed.") : null,
code,
}),
);
});
};
const versionIsSatisfied = (version: string, requirement: string): boolean => {
const cleanedVersion = coerce(version);
if (!cleanedVersion) {
throw new Error(`Invalid version ${version}.`);
}
return satisfies(cleanedVersion, requirement, true);
};
/**
* Validate the provided system requirement resolution is satisfying the version requirement if applicable.
* @param resolution Command resolution.
* @param actualVersion Version for that resolution.
* @param requirement Requirement.
* @returns the resolution if it is valid or an @see SystemRequirementError if not.
*/
const validateVersionRequirement = (
resolution: SystemRequirementResolution,
actualVersion: string,
requirement: SystemRequirement,
): SystemRequirementResolution | SystemRequirementError => {
if (!requirement.version) {
return resolution; // No version requirement.
}
try {
if (versionIsSatisfied(actualVersion, requirement.version)) {
return resolution;
}
return {
...resolution,
error: true,
message: `'${resolution.command}' version is '${actualVersion}' but doesn't satisfy requirement '${requirement.version}'. Please update.`,
actualVersion: actualVersion,
neededVersion: requirement.version,
};
} catch {
return {
...resolution,
error: true,
message: `Couldn't parse the version ${actualVersion}. This is not a valid semver version.`,
actualVersion: actualVersion,
neededVersion: requirement.version,
};
}
};
const tryPython = async (
requirement: SystemRequirement,
command: string,
additionalArgs: string[] = [],
): Promise<SystemRequirementResolution | SystemRequirementError> => {
const resolution: SystemRequirementResolution = {
name: PythonRequirement,
command,
additionalArgs: additionalArgs.length > 0 ? additionalArgs : undefined,
};
try {
const result = await execute(command, [...additionalArgs, "-c", `"${PRINT_PYTHON_VERSION_SCRIPT}"`]);
return validateVersionRequirement(resolution, result.stdout.trim(), requirement);
} catch (e) {
return {
error: true,
...resolution,
message: `'${command}' command line is not found in the path. Make sure to have it installed.`,
};
}
};
/**
* Returns the path to the executable as asked in the requirement.
* @param requirement System requirement definition.
* @returns If the requirement provide an environment variable for the path returns the value of that environment variable. undefined otherwise.
*/
const getExecutablePath = (requirement: SystemRequirement): string | undefined =>
requirement.environmentVariable && process.env[requirement.environmentVariable];
const createPythonErrorMessage = (
requirement: SystemRequirement,
errors: SystemRequirementError[],
): SystemRequirementError => {
const versionReq = requirement.version ?? "*";
const lines = [
`Couldn't find a valid python interpreter satisfying the requirement (version: ${versionReq}). Tried:`,
...errors.map((x) => ` - ${x.command} (${x.message})`),
];
return {
error: true,
name: "python",
command: "python",
message: lines.join("\n"),
};
};
const resolvePythonRequirement = async (
requirement: SystemRequirement,
): Promise<SystemRequirementResolution | SystemRequirementError> => {
// Hardcoding AUTOREST_PYTHON_EXE is for backward compatibility
const path = getExecutablePath(requirement) ?? process.env["AUTOREST_PYTHON_EXE"];
if (path) {
return await tryPython(requirement, path);
}
const errors: SystemRequirementError[] = [];
// On windows try `py` executable with `-3` flag.
if (process.platform === "win32") {
const pyResult = await tryPython(requirement, "py", ["-3"]);
if ("error" in pyResult) {
errors.push(pyResult);
} else {
return pyResult;
}
}
const python3Result = await tryPython(requirement, "python3");
if ("error" in python3Result) {
errors.push(python3Result);
} else {
return python3Result;
}
const pythonResult = await tryPython(requirement, "python");
if ("error" in pythonResult) {
errors.push(pythonResult);
} else {
return pythonResult;
}
return createPythonErrorMessage(requirement, errors);
};
/**
* @param command list of the command and arguments. First item in array must be a python exe @see KnownPythonExe. (e.g. ["python", "mypythonfile.py"]
* @param requirement
*/
export const patchPythonPath = async (
command: PythonCommandLine,
requirement: SystemRequirement,
): Promise<string[]> => {
const [_, ...args] = command;
const resolution = await resolvePythonRequirement(requirement);
if ("error" in resolution) {
throw new Error(`Failed to find compatible python version. ${resolution.message}`);
}
return [resolution.command, ...(resolution.additionalArgs ?? []), ...args];
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// TYPES
const PythonRequirement = "python";
const PRINT_PYTHON_VERSION_SCRIPT = "import sys; print('.'.join(map(str, sys.version_info[:3])))";
type KnownPythonExe = "python.exe" | "python3.exe" | "python" | "python3";
type PythonCommandLine = [KnownPythonExe, ...string[]];
interface MoreOptions extends SpawnOptions {
onCreate?(cp: ChildProcess): void;
onStdOutData?(chunk: any): void;
onStdErrData?(chunk: any): void;
}
interface SystemRequirement {
version?: string;
/**
* Name of an environment variable where the user could provide the path to the exe.
* @example "AUTOREST_PYTHON_PATH"
*/
environmentVariable?: string;
}
interface SystemRequirementResolution {
/**
* Name of the requirement.
* @example python, java, etc.
*/
name: string;
/**
* Name of the command
* @example python3, /home/myuser/python39/python, java, etc.
*/
command: string;
/**
* List of additional arguments to pass to this command.
* @example '-3' for 'py' to specify to use python 3
*/
additionalArgs?: string[];
}
interface ExecResult {
stdout: string;
stderr: string;
/**
* Union of stdout and stderr.
*/
log: string;
error: Error | null;
code: number | null;
}
interface SystemRequirementError extends SystemRequirementResolution {
error: true;
message: string;
neededVersion?: string;
actualVersion?: string;
}

Просмотреть файл

@ -6,7 +6,6 @@
import logging
from pathlib import Path
import os
from typing import Any, Dict
import black
from black.report import NothingChanged
@ -19,7 +18,7 @@ _BLACK_MODE = black.Mode() # pyright: ignore [reportPrivateImportUsage]
_BLACK_MODE.line_length = 120
class BlackScriptPlugin(Plugin): # pylint: disable=abstract-method
class BlackScriptPlugin(Plugin):
def __init__(self, **kwargs):
super().__init__(**kwargs)
output_folder = self.options.get("output_folder", str(self.output_folder))
@ -57,7 +56,7 @@ class BlackScriptPlugin(Plugin): # pylint: disable=abstract-method
file_content = black.format_file_contents(file_content, fast=True, mode=_BLACK_MODE)
except NothingChanged:
pass
except: # pylint: disable=bare-except
except:
_LOGGER.error("Error: failed to format %s", file)
raise
else:

Просмотреть файл

@ -51,7 +51,7 @@ class CombinedType(BaseType):
def client_default_value(self) -> Any:
return self.yaml_data.get("clientDefaultValue")
def description(self, *, is_operation_file: bool) -> str: # pylint: disable=unused-argument
def description(self, *, is_operation_file: bool) -> str:
if len(self.types) == 2:
return f"Is either a {self.types[0].type_description} type or a {self.types[1].type_description} type."
return f"Is one of the following types: {', '.join([t.type_description for t in self.types])}"

Просмотреть файл

@ -106,7 +106,7 @@ CredentialPolicyType = TypeVar(
)
class CredentialType(Generic[CredentialPolicyType], BaseType): # pylint:disable=abstract-method
class CredentialType(Generic[CredentialPolicyType], BaseType):
"""Store info about the type of the credential. Can be either an KeyCredential or a TokenCredential"""
def __init__(
@ -118,7 +118,7 @@ class CredentialType(Generic[CredentialPolicyType], BaseType): # pylint:disable
super().__init__(yaml_data, code_model)
self.policy = policy
def description(self, *, is_operation_file: bool) -> str: # pylint: disable=unused-argument
def description(self, *, is_operation_file: bool) -> str:
return ""
def get_json_template_representation(
@ -146,11 +146,7 @@ class CredentialType(Generic[CredentialPolicyType], BaseType): # pylint:disable
)
class TokenCredentialType(
CredentialType[ # pylint: disable=unsubscriptable-object
Union[BearerTokenCredentialPolicyType, ARMChallengeAuthenticationPolicyType]
]
):
class TokenCredentialType(CredentialType[Union[BearerTokenCredentialPolicyType, ARMChallengeAuthenticationPolicyType]]):
"""Type of a token credential. Used by BearerAuth and ARMChallenge policies"""
def type_annotation(self, **kwargs: Any) -> str:
@ -194,23 +190,20 @@ class TokenCredentialType(
return "hasattr({}, 'get_token')"
class KeyCredentialType(
# pylint: disable=unsubscriptable-object
CredentialType[KeyCredentialPolicyType]
):
class KeyCredentialType(CredentialType[KeyCredentialPolicyType]):
"""Type for an KeyCredential"""
def docstring_type(self, **kwargs: Any) -> str: # pylint: disable=unused-argument
def docstring_type(self, **kwargs: Any) -> str:
return f"~{self.code_model.core_library}.credentials.{self.policy.credential_name}"
def type_annotation(self, **kwargs: Any) -> str: # pylint: disable=unused-argument
def type_annotation(self, **kwargs: Any) -> str:
return self.policy.credential_name
@property
def instance_check_template(self) -> str:
return "isinstance({}, " + f"{self.policy.credential_name})"
def imports(self, **kwargs: Any) -> FileImport: # pylint: disable=unused-argument
def imports(self, **kwargs: Any) -> FileImport:
file_import = super().imports(**kwargs)
file_import.add_submodule_import(
"credentials",

Просмотреть файл

@ -137,7 +137,7 @@ class EnumType(BaseType):
"""
return self.value_type.serialization_type
def description(self, *, is_operation_file: bool) -> str: # pylint: disable=unused-argument
def description(self, *, is_operation_file: bool) -> str:
possible_values = [self.get_declaration(v.value) for v in self.values]
if not possible_values:
return ""

Просмотреть файл

@ -1,4 +1,3 @@
# pylint: disable=multiple-statements
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for

Просмотреть файл

@ -21,7 +21,7 @@ class LROPagingOperation(LROOperationBase[LROPagingResponse], PagingOperationBas
return "lropaging"
def cls_type_annotation(self, *, async_mode: bool) -> str:
return f"ClsType[{Response.type_annotation(self.responses[0], async_mode=async_mode)}]" # pylint: disable=no-member
return f"ClsType[{Response.type_annotation(self.responses[0], async_mode=async_mode)}]"
def imports(self, async_mode: bool, **kwargs: Any) -> FileImport:
lro_imports = LROOperationBase.imports(self, async_mode, **kwargs)

Просмотреть файл

@ -17,9 +17,9 @@ from .property import Property
from .imports import FileImport, ImportType, TypingSection
if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
from typing import Literal
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
from typing_extensions import Literal # type: ignore
if TYPE_CHECKING:
from .code_model import CodeModel
@ -50,9 +50,7 @@ def _get_properties(type: "ModelType", properties: List[Property]) -> List[Prope
return properties
class ModelType( # pylint: disable=abstract-method
BaseType
): # pylint: disable=too-many-instance-attributes, too-many-public-methods
class ModelType(BaseType): # pylint: disable=too-many-instance-attributes, too-many-public-methods
"""Represents a class ready to be serialized in Python.
:param str name: The name of the class.
@ -89,7 +87,7 @@ class ModelType( # pylint: disable=abstract-method
@property
def is_usage_output(self) -> bool:
return self.usage & UsageFlags.Output.value
return bool(self.usage & UsageFlags.Output.value)
@property
def flattened_property(self) -> Optional[Property]:
@ -284,7 +282,7 @@ class JSONModelType(ModelType):
return file_import
class GeneratedModelType(ModelType): # pylint: disable=abstract-method
class GeneratedModelType(ModelType):
def type_annotation(self, **kwargs: Any) -> str:
is_operation_file = kwargs.pop("is_operation_file", False)
skip_quote = kwargs.get("skip_quote", False)

Просмотреть файл

@ -1,4 +1,3 @@
# pylint: disable=multiple-statements
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for

Просмотреть файл

@ -261,8 +261,7 @@ class _ParameterListBase(
)
class _ParameterList(_ParameterListBase[Parameter, BodyParameter]): # pylint: disable=unsubscriptable-object
"""Base Parameter class for the two operation ParameterLists"""
class _ParameterList(_ParameterListBase[Parameter, BodyParameter]):
@staticmethod
def parameter_creator() -> Callable[[Dict[str, Any], "CodeModel"], Parameter]:
@ -285,9 +284,7 @@ class ParameterList(_ParameterList):
"""ParameterList is the parameter list for Operation classes"""
class _RequestBuilderParameterList(
_ParameterListBase[RequestBuilderParameter, RequestBuilderBodyParameter] # pylint: disable=unsubscriptable-object
):
class _RequestBuilderParameterList(_ParameterListBase[RequestBuilderParameter, RequestBuilderBodyParameter]):
"""_RequestBuilderParameterList is base parameter list for RequestBuilder classes"""
@staticmethod

Просмотреть файл

@ -22,8 +22,8 @@ class RawString(object):
return "r'{}'".format(self.string.replace("'", "\\'"))
class PrimitiveType(BaseType): # pylint: disable=abstract-method
def description(self, *, is_operation_file: bool) -> str: # pylint: disable=unused-argument
class PrimitiveType(BaseType):
def description(self, *, is_operation_file: bool) -> str:
return ""
def type_annotation(self, **kwargs: Any) -> str:
@ -188,7 +188,7 @@ class AnyObjectType(PrimitiveType):
return "JSON"
class NumberType(PrimitiveType): # pylint: disable=abstract-method
class NumberType(PrimitiveType):
def __init__(self, yaml_data: Dict[str, Any], code_model: "CodeModel") -> None:
super().__init__(yaml_data=yaml_data, code_model=code_model)
self.precision: Optional[int] = yaml_data.get("precision")

Просмотреть файл

@ -66,7 +66,7 @@ def _sample_output_path(source_file_path: str) -> Path:
return Path("")
class JinjaSerializer(ReaderAndWriter): # pylint: disable=abstract-method
class JinjaSerializer(ReaderAndWriter):
def __init__(
self,
code_model: CodeModel,

Просмотреть файл

@ -1,4 +1,4 @@
# pylint: disable=too-many-lines,multiple-statements
# pylint: disable=too-many-lines
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
@ -23,7 +23,6 @@ from ..models import (
BinaryType,
BodyParameter,
ParameterMethodLocation,
RequestBuilderBodyParameter,
OverloadedRequestBuilder,
Property,
RequestBuilderType,
@ -218,7 +217,7 @@ def is_json_model_type(parameters: ParameterListType) -> bool:
)
class _BuilderBaseSerializer(Generic[BuilderType]): # pylint: disable=abstract-method
class _BuilderBaseSerializer(Generic[BuilderType]):
def __init__(self, code_model: CodeModel, async_mode: bool) -> None:
self.code_model = code_model
self.async_mode = async_mode
@ -391,7 +390,7 @@ class _BuilderBaseSerializer(Generic[BuilderType]): # pylint: disable=abstract-
############################## REQUEST BUILDERS ##############################
class RequestBuilderSerializer(_BuilderBaseSerializer[RequestBuilderType]): # pylint: disable=abstract-method
class RequestBuilderSerializer(_BuilderBaseSerializer[RequestBuilderType]):
def description_and_summary(self, builder: RequestBuilderType) -> List[str]:
retval = super().description_and_summary(builder)
retval += [
@ -517,7 +516,7 @@ class RequestBuilderSerializer(_BuilderBaseSerializer[RequestBuilderType]): # p
############################## NORMAL OPERATIONS ##############################
class _OperationSerializer(_BuilderBaseSerializer[OperationType]): # pylint: disable=abstract-method
class _OperationSerializer(_BuilderBaseSerializer[OperationType]):
def description_and_summary(self, builder: OperationType) -> List[str]:
retval = super().description_and_summary(builder)
if builder.deprecated:
@ -842,14 +841,14 @@ class _OperationSerializer(_BuilderBaseSerializer[OperationType]): # pylint: di
elif request_builder.overloads:
seen_body_params = set()
for overload in request_builder.overloads:
body_param = cast(RequestBuilderBodyParameter, overload.parameters.body_parameter)
body_param = overload.parameters.body_parameter
if body_param.client_name in seen_body_params:
continue
seen_body_params.add(body_param.client_name)
retval.append(f" {body_param.client_name}={body_param.name_in_high_level_operation},")
elif request_builder.parameters.has_body:
body_param = cast(RequestBuilderBodyParameter, request_builder.parameters.body_parameter)
body_param = request_builder.parameters.body_parameter
retval.append(f" {body_param.client_name}={body_param.name_in_high_level_operation},")
retval.append(" headers=_headers,")
retval.append(" params=_params,")
@ -871,7 +870,7 @@ class _OperationSerializer(_BuilderBaseSerializer[OperationType]): # pylint: di
)
return retval
def _call_request_builder_helper( # pylint: disable=too-many-statements
def _call_request_builder_helper(
self,
builder: OperationType,
request_builder: RequestBuilderType,
@ -1031,7 +1030,7 @@ class _OperationSerializer(_BuilderBaseSerializer[OperationType]): # pylint: di
retval.append("deserialized = None")
if builder.any_response_has_headers:
retval.append("response_headers = {}")
if builder.has_response_body or builder.any_response_has_headers:
if builder.has_response_body or builder.any_response_has_headers: # pylint: disable=too-many-nested-blocks
if len(builder.responses) > 1:
status_codes, res_headers, res_deserialization = [], [], []
for status_code in builder.success_status_codes:
@ -1173,7 +1172,7 @@ class OperationSerializer(_OperationSerializer[Operation]): ...
PagingOperationType = TypeVar("PagingOperationType", bound=Union[PagingOperation, LROPagingOperation])
class _PagingOperationSerializer(_OperationSerializer[PagingOperationType]): # pylint: disable=abstract-method
class _PagingOperationSerializer(_OperationSerializer[PagingOperationType]):
def __init__(self, code_model: CodeModel, async_mode: bool) -> None:
# for pylint reasons need to redefine init
# probably because inheritance is going too deep
@ -1458,7 +1457,7 @@ class LROOperationSerializer(_LROOperationSerializer[LROOperation]): ...
class LROPagingOperationSerializer(
_LROOperationSerializer[LROPagingOperation],
_PagingOperationSerializer[LROPagingOperation],
): # pylint: disable=abstract-method
):
@property
def _call_method(self) -> str:
return "await " if self.async_mode else ""

Просмотреть файл

@ -1,4 +1,3 @@
# pylint: disable=too-many-lines
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
@ -22,7 +21,6 @@ from ..models import (
FileImport,
)
from .utils import get_namespace_config, get_namespace_from_package_name
from ...utils import to_snake_case
_LOGGER = logging.getLogger(__name__)

Просмотреть файл

@ -27,7 +27,7 @@ class GeneratorRenderer(m2r2.RestRenderer):
return f":code:`{html}`"
class M2R(YamlUpdatePlugin): # pylint: disable=abstract-method
class M2R(YamlUpdatePlugin):
"""A plugin to convert any description and summary from MD to RST."""
def update_yaml(self, yaml_data: Dict[str, Any]) -> None:

Просмотреть файл

@ -3,7 +3,7 @@
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
from typing import Tuple, Any, Dict
from typing import Tuple, Any
from pathlib import Path
import os
import shutil
@ -28,7 +28,7 @@ def format_file(file: Path, file_content: str) -> str:
return file_content
class PostProcessPlugin(Plugin): # pylint: disable=abstract-method
class PostProcessPlugin(Plugin):
def __init__(self, **kwargs: Any):
super().__init__(**kwargs)
output_folder_uri = self.options["outputFolderUri"]

Просмотреть файл

@ -52,9 +52,7 @@ def create(
return builder.context
def python_run( # pylint: disable=inconsistent-return-statements
venv_context, module, command, directory=_ROOT_DIR
) -> Optional[str]:
def python_run(venv_context, module, command, directory=_ROOT_DIR) -> Optional[str]:
try:
cmd_line = [
venv_context.env_exe,

Просмотреть файл

@ -163,7 +163,7 @@ def has_multi_part_content_type(yaml_data: Dict[str, Any]) -> bool:
return any(ct for ct in yaml_data.get("contentTypes", []) if ct == "multipart/form-data")
class PreProcessPlugin(YamlUpdatePlugin): # pylint: disable=abstract-method
class PreProcessPlugin(YamlUpdatePlugin):
"""Add Python naming information."""
@property

Просмотреть файл

@ -82,9 +82,7 @@ def parse_args(
return value
unknown_args_ret = {
ua.strip("--").split("=", maxsplit=1)[0]: _get_value( # pylint: disable=bad-str-strip-call
ua.strip("--").split("=", maxsplit=1)[1] # pylint: disable=bad-str-strip-call
)
ua.strip("--").split("=", maxsplit=1)[0]: _get_value(ua.strip("--").split("=", maxsplit=1)[1])
for ua in unknown_args
}
return args, unknown_args_ret

Просмотреть файл

@ -15,7 +15,7 @@ from setuptools import setup, find_packages
# Version extraction inspired from 'requests'
with open(os.path.join("pygen", "_version.py"), "r") as fd:
version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1)
version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) # type: ignore
if not version:
raise RuntimeError("Cannot find version information")

Просмотреть файл

@ -30,12 +30,13 @@
"clean": "rimraf ./dist ./temp ./venv ./node_modules",
"build": "tsc -p .",
"watch": "tsc -p . --watch",
"lint": "eslint . --ext .ts --max-warnings=0",
"lint": "eslint . --ext .ts --max-warnings=0 && tsx ./scripts/eng/lint.ts",
"lint:fix": "eslint . --fix --ext .ts",
"format": "npx prettier **/*.ts --write && tsx ./scripts/eng/format.ts",
"install": "tsx ./scripts/run-python3.ts ./scripts/install.py",
"prepare": "tsx ./scripts/run-python3.ts ./scripts/prepare.py",
"regenerate": "tsx ./scripts/regenerate.ts",
"test": "tsx ./scripts/run-tests.ts"
"regenerate": "tsx ./scripts/eng/regenerate.ts",
"test": "tsx ./scripts/eng/run-tests.ts"
},
"files": [
"dist/**",
@ -82,6 +83,7 @@
"@typespec/rest": "~0.59.0",
"@typespec/versioning": "~0.59.0",
"@azure-tools/typespec-azure-rulesets": "0.45.0",
"yargs": "~17.2.1"
"yargs": "~17.2.1",
"chalk": "5.3.0"
}
}

Просмотреть файл

@ -0,0 +1,5 @@
/* eslint-disable no-console */
import { runCommand } from "./utils.js";
runCommand("black .", "black");

Просмотреть файл

@ -0,0 +1,50 @@
/* eslint-disable no-console */
import yargs from "yargs";
import { hideBin } from "yargs/helpers";
import { runCommand } from "./utils.js";
interface Arguments {
folderName: string;
command?: "pylint" | "mypy" | "pyright";
}
const validCommands = ["pylint", "mypy", "pyright"];
// PARSE INPUT ARGUMENTS
const argv = yargs(hideBin(process.argv))
.option("folderName", {
type: "string",
choices: ["generator", "autorest"],
description: "Specify the flavor",
default: "generator",
})
.option("command", {
alias: "c",
type: "string",
choices: validCommands,
description: "Specify the command to run",
}).argv as Arguments;
export function pylint() {
runCommand(`pylint ${argv.folderName}/ --rcfile ./scripts/eng/pylintrc`, "pylint");
}
export function mypy() {
runCommand(`mypy ${argv.folderName}/ --config-file ./scripts/eng/mypy.ini`, "mypy");
}
export function pyright() {
runCommand(`pyright ${argv.folderName}/ -p ./scripts/eng/pyrightconfig.json`, "pyright");
}
if (argv.command === "pylint") {
pylint();
} else if (argv.command === "mypy") {
mypy();
} else if (argv.command === "pyright") {
pyright();
} else {
pylint();
mypy();
pyright();
}

Просмотреть файл

@ -0,0 +1,38 @@
# global configurations
[mypy]
python_version = 3.8
# module level configuratiohns
[mypy-jsonrpc.*]
ignore_missing_imports = True
[mypy-ptvsd.*]
ignore_missing_imports = True
[mypy-debugpy.*]
ignore_missing_imports = True
[mypy-m2r2.*]
ignore_missing_imports = True
[mypy-autorest.common.utils.*]
ignore_missing_imports = True
[mypy-autorest.common.python_mappings.*]
ignore_missing_imports = True
[mypy-pygen.codegen.models.*]
ignore_missing_imports = True
[mypy-setuptools]
ignore_missing_imports = True
[mypy-*._patch]
ignore_missing_imports = True
[mypy-pygen.*]
ignore_missing_imports = True
[mypy-yaml.*]
ignore_missing_imports = True

Просмотреть файл

@ -4,14 +4,14 @@ import { promisify } from "util";
import yargs from "yargs";
import { hideBin } from "yargs/helpers";
import { dirname, join, relative, resolve } from "path";
import { promises } from "fs";
import { promises, rm } from "fs";
import { fileURLToPath } from "url";
// Promisify the exec function
const exec = promisify(execCallback);
// Get the directory of the current file
const PLUGIN_DIR = resolve(fileURLToPath(import.meta.url), "../../");
const PLUGIN_DIR = resolve(fileURLToPath(import.meta.url), "../../../");
const CADL_RANCH_DIR = resolve(PLUGIN_DIR, "node_modules/@azure-tools/cadl-ranch-specs/http");
const EMITTER_OPTIONS: Record<string, Record<string, string> | Record<string, string>[]> = {
@ -206,8 +206,13 @@ function defaultPackageName(spec: string): string {
.toLowerCase();
}
function addOptions(spec: string, generatedFolder: string, flags: RegenerateFlags): string[] {
const emitterConfigs: string[] = [];
interface EmitterConfig {
optionsStr: string;
outputDir: string;
}
function addOptions(spec: string, generatedFolder: string, flags: RegenerateFlags): EmitterConfig[] {
const emitterConfigs: EmitterConfig[] = [];
for (const config of getEmitterOption(spec)) {
const options: Record<string, string> = { ...config };
options["flavor"] = flags.flavor;
@ -228,7 +233,10 @@ function addOptions(spec: string, generatedFolder: string, flags: RegenerateFlag
const configs = Object.entries(options).flatMap(([k, v]) => {
return `--option @azure-tools/typespec-python.${k}=${v}`;
});
emitterConfigs.push(configs.join(" "));
emitterConfigs.push({
optionsStr: configs.join(" "),
outputDir: options["emitter-output-dir"],
});
}
return emitterConfigs;
}
@ -237,9 +245,12 @@ async function _regenerateSingle(spec: string, flags: RegenerateFlags): Promise<
// Perform some asynchronous operation here
const options = addOptions(spec, PLUGIN_DIR, flags);
const commandPromises = options.map((option) => {
const command = `tsp compile ${spec} --emit=${toPosix(PLUGIN_DIR)} ${option}`;
console.log(command);
return executeCommand(command);
// delete the folder, then regenerate into it
rm(option.outputDir, () => {
const command = `tsp compile ${spec} --emit=${toPosix(PLUGIN_DIR)} ${option.optionsStr}`;
console.log(command);
return executeCommand(command);
});
});
await Promise.all(commandPromises);
}

Просмотреть файл

@ -4,28 +4,27 @@ import { readFileSync } from "fs";
import { join } from "path";
import yargs from "yargs";
import { hideBin } from "yargs/helpers";
import { fileURLToPath } from "url";
interface Arguments {
validFolders: string[];
folder?: string;
command?: string;
}
const validFolders = [
"azure/legacy",
"azure/version-tolerant",
"vanilla/legacy",
"vanilla/version-tolerant",
"dpg/version-tolerant",
];
const validCommands = ["ci", "lint", "mypy", "pyright", "apiview"];
// Parse command-line arguments using yargs
const argv = yargs(hideBin(process.argv))
.option("validFolders", {
alias: "vf",
describe: "Specify the valid folders",
type: "array",
default: ["azure", "unbranded"],
})
.option("folder", {
alias: "f",
describe: "Specify the folder to use",
choices: validFolders,
type: "string",
})
.option("command", {
@ -35,7 +34,7 @@ const argv = yargs(hideBin(process.argv))
type: "string",
}).argv as Arguments;
const foldersToProcess = argv.folder ? [argv.folder] : validFolders;
const foldersToProcess = argv.folder ? [argv.folder] : argv.validFolders;
const commandToRun = argv.command || "all";
@ -45,7 +44,7 @@ function getCommand(command: string, folder: string) {
}
function sectionExistsInToxIni(command: string, folder: string): boolean {
const toxIniPath = join(__dirname, `../test/${folder}/tox.ini`);
const toxIniPath = join(fileURLToPath(import.meta.url), `../../../test/${folder}/tox.ini`);
const toxIniContent = readFileSync(toxIniPath, "utf-8");
const sectionHeader = `[testenv:${command}]`;
return toxIniContent.includes(sectionHeader);

Просмотреть файл

@ -0,0 +1,30 @@
/* eslint-disable no-console */
import { exec } from "child_process";
import { existsSync } from "fs";
import { dirname, join } from "path";
import { fileURLToPath } from "url";
import chalk from "chalk";
// Function to run a command and log the output
export function runCommand(command: string, prettyName: string) {
let pythonPath = join(dirname(fileURLToPath(import.meta.url)), "..", "..", "venv/");
if (existsSync(join(pythonPath, "bin"))) {
pythonPath = join(pythonPath, "bin", "python");
} else if (existsSync(join(pythonPath, "Scripts"))) {
pythonPath = join(pythonPath, "Scripts", "python");
} else {
throw new Error(pythonPath);
}
command = `${pythonPath} -m ${command}`;
exec(command, (error, stdout, stderr) => {
if (error) {
console.error(chalk.red(`Error executing ${command}: ${stderr || stdout}`));
return;
}
if (stderr) {
// Process stderr output
console.log(chalk.yellow(`${command}:\n${stderr}`));
}
console.log(chalk.green(`${prettyName} passed`));
});
}

Просмотреть файл

@ -1,57 +0,0 @@
/* eslint-disable no-console */
import { execSync } from "child_process";
import yargs from "yargs";
import { hideBin } from "yargs/helpers";
interface Arguments {
folder?: string;
command?: string;
}
const validFolders = ["azure", "unbranded"];
const validCommands = ["ci", "lint", "mypy", "pyright", "apiview"];
// Parse command-line arguments using yargs
const argv = yargs(hideBin(process.argv))
.option("folder", {
alias: "f",
describe: "Specify the folder to use",
choices: validFolders,
type: "string",
})
.option("command", {
alias: "c",
describe: "Specify the command to run",
choices: validCommands,
type: "string",
}).argv as Arguments;
const foldersToProcess = argv.folder ? [argv.folder] : validFolders;
const commandToRun = argv.command || "all";
function getCommand(command: string, folder: string) {
if (!validCommands.includes(command)) throw new Error(`Unknown command '${command}'.`);
return `FOLDER=${folder} tox -c ./test/${folder}/tox.ini -e ${command}`;
}
foldersToProcess.forEach((folder) => {
try {
if (commandToRun === "all") {
for (const key of validCommands) {
console.log(`Running ${key} for folder ${folder}...`);
execSync(getCommand(key, folder), { stdio: "inherit" });
}
} else if (getCommand(commandToRun, folder)) {
console.log(`Running ${commandToRun} for folder ${folder}...`);
execSync(getCommand(commandToRun, folder), { stdio: "inherit" });
} else {
console.error(`Error: Unknown command '${commandToRun}'.`);
process.exit(1);
}
} catch (error) {
console.error(`Error executing command for folder ${folder}: ${(error as Error).message}`);
process.exit(1);
}
});

Просмотреть файл

@ -1,8 +0,0 @@
{
"CrossLanguagePackageId": "Authentication.ApiKey",
"CrossLanguageDefinitionId": {
"authentication.apikey.models.InvalidAuth": "Authentication.ApiKey.InvalidAuth",
"authentication.apikey.ApiKeyClient.valid": "valid",
"authentication.apikey.ApiKeyClient.invalid": "invalid"
}
}

Просмотреть файл

@ -1,8 +0,0 @@
{
"CrossLanguagePackageId": "Authentication.Http.Custom",
"CrossLanguageDefinitionId": {
"authentication.http.custom.models.InvalidAuth": "Authentication.Http.Custom.InvalidAuth",
"authentication.http.custom.CustomClient.valid": "valid",
"authentication.http.custom.CustomClient.invalid": "invalid"
}
}

Просмотреть файл

@ -1,8 +0,0 @@
{
"CrossLanguagePackageId": "Authentication.OAuth2",
"CrossLanguageDefinitionId": {
"authentication.oauth2.models.InvalidAuth": "Authentication.OAuth2.InvalidAuth",
"authentication.oauth2.OAuth2Client.valid": "valid",
"authentication.oauth2.OAuth2Client.invalid": "invalid"
}
}

Просмотреть файл

@ -1,19 +0,0 @@
{
"CrossLanguagePackageId": "_Specs_.Azure.ClientGenerator.Core.Access",
"CrossLanguageDefinitionId": {
"specs.azure.clientgenerator.core.access.models.AbstractModel": "_Specs_.Azure.ClientGenerator.Core.Access.RelativeModelInOperation.AbstractModel",
"specs.azure.clientgenerator.core.access.models.BaseModel": "_Specs_.Azure.ClientGenerator.Core.Access.RelativeModelInOperation.BaseModel",
"specs.azure.clientgenerator.core.access.models.InnerModel": "_Specs_.Azure.ClientGenerator.Core.Access.RelativeModelInOperation.InnerModel",
"specs.azure.clientgenerator.core.access.models.InternalDecoratorModelInInternal": "_Specs_.Azure.ClientGenerator.Core.Access.InternalOperation.InternalDecoratorModelInInternal",
"specs.azure.clientgenerator.core.access.models.NoDecoratorModelInInternal": "_Specs_.Azure.ClientGenerator.Core.Access.InternalOperation.NoDecoratorModelInInternal",
"specs.azure.clientgenerator.core.access.models.NoDecoratorModelInPublic": "_Specs_.Azure.ClientGenerator.Core.Access.PublicOperation.NoDecoratorModelInPublic",
"specs.azure.clientgenerator.core.access.models.OuterModel": "_Specs_.Azure.ClientGenerator.Core.Access.RelativeModelInOperation.OuterModel",
"specs.azure.clientgenerator.core.access.models.PublicDecoratorModelInInternal": "_Specs_.Azure.ClientGenerator.Core.Access.InternalOperation.PublicDecoratorModelInInternal",
"specs.azure.clientgenerator.core.access.models.PublicDecoratorModelInPublic": "_Specs_.Azure.ClientGenerator.Core.Access.PublicOperation.PublicDecoratorModelInPublic",
"specs.azure.clientgenerator.core.access.models.RealModel": "_Specs_.Azure.ClientGenerator.Core.Access.RelativeModelInOperation.RealModel",
"specs.azure.clientgenerator.core.access.models.SharedModel": "_Specs_.Azure.ClientGenerator.Core.Access.SharedModelInOperation.SharedModel",
"specs.azure.clientgenerator.core.access.AccessClient.public_operation.no_decorator_in_public": "noDecoratorInPublic",
"specs.azure.clientgenerator.core.access.AccessClient.public_operation.public_decorator_in_public": "publicDecoratorInPublic",
"specs.azure.clientgenerator.core.access.AccessClient.shared_model_in_operation.public": "public"
}
}

Просмотреть файл

@ -1,23 +0,0 @@
{
"CrossLanguagePackageId": "Client.Naming",
"CrossLanguageDefinitionId": {
"client.naming.models.ClientModel": "Client.Naming.Model.ModelWithClientClientName",
"client.naming.models.ClientNameAndJsonEncodedNameModel": "Client.Naming.Property.ClientNameAndJsonEncodedNameModel",
"client.naming.models.ClientNameModel": "Client.Naming.Property.ClientNameModel",
"client.naming.models.LanguageClientNameModel": "Client.Naming.Property.LanguageClientNameModel",
"client.naming.models.PythonModel": "Client.Naming.Model.ModelWithLanguageClientName",
"client.naming.models.ClientExtensibleEnum": "Client.Naming.UnionEnum.ServerExtensibleEnum",
"client.naming.models.ExtensibleEnum": "Client.Naming.UnionEnum.ExtensibleEnum",
"client.naming.NamingClient.model.client": "client",
"client.naming.NamingClient.model.language": "language",
"client.naming.NamingClient.union_enum.union_enum_name": "unionEnumName",
"client.naming.NamingClient.union_enum.union_enum_member_name": "unionEnumMemberName",
"client.naming.NamingClient.client_name": "clientName",
"client.naming.NamingClient.parameter": "parameter",
"client.naming.NamingClient.client": "client",
"client.naming.NamingClient.language": "language",
"client.naming.NamingClient.compatible_with_encoded_name": "compatibleWithEncodedName",
"client.naming.NamingClient.request": "request",
"client.naming.NamingClient.response": "response"
}
}

Просмотреть файл

@ -1,12 +0,0 @@
{
"CrossLanguagePackageId": "Client.Structure.Service",
"CrossLanguageDefinitionId": {
"client.structure.renamedoperation.models.ClientType": "Client.Structure.Service.ClientType",
"client.structure.renamedoperation.RenamedOperationClient.group.renamed_two": "renamedTwo",
"client.structure.renamedoperation.RenamedOperationClient.group.renamed_four": "renamedFour",
"client.structure.renamedoperation.RenamedOperationClient.group.renamed_six": "renamedSix",
"client.structure.renamedoperation.RenamedOperationClient.renamed_one": "renamedOne",
"client.structure.renamedoperation.RenamedOperationClient.renamed_three": "renamedThree",
"client.structure.renamedoperation.RenamedOperationClient.renamed_five": "renamedFive"
}
}

Просмотреть файл

@ -1,12 +0,0 @@
{
"CrossLanguagePackageId": "Client.Structure.Service",
"CrossLanguageDefinitionId": {
"client.structure.twooperationgroup.models.ClientType": "Client.Structure.Service.ClientType",
"client.structure.twooperationgroup.TwoOperationGroupClient.group1.one": "one",
"client.structure.twooperationgroup.TwoOperationGroupClient.group1.three": "three",
"client.structure.twooperationgroup.TwoOperationGroupClient.group1.four": "four",
"client.structure.twooperationgroup.TwoOperationGroupClient.group2.two": "two",
"client.structure.twooperationgroup.TwoOperationGroupClient.group2.five": "five",
"client.structure.twooperationgroup.TwoOperationGroupClient.group2.six": "six"
}
}

Просмотреть файл

@ -1,29 +0,0 @@
{
"CrossLanguagePackageId": "Encode.Datetime",
"CrossLanguageDefinitionId": {
"encode.datetime.models.DefaultDatetimeProperty": "Encode.Datetime.DefaultDatetimeProperty",
"encode.datetime.models.Rfc3339DatetimeProperty": "Encode.Datetime.Rfc3339DatetimeProperty",
"encode.datetime.models.Rfc7231DatetimeProperty": "Encode.Datetime.Rfc7231DatetimeProperty",
"encode.datetime.models.UnixTimestampArrayDatetimeProperty": "Encode.Datetime.UnixTimestampArrayDatetimeProperty",
"encode.datetime.models.UnixTimestampDatetimeProperty": "Encode.Datetime.UnixTimestampDatetimeProperty",
"encode.datetime.DatetimeClient.query.default": "default",
"encode.datetime.DatetimeClient.query.rfc3339": "rfc3339",
"encode.datetime.DatetimeClient.query.rfc7231": "rfc7231",
"encode.datetime.DatetimeClient.query.unix_timestamp": "unixTimestamp",
"encode.datetime.DatetimeClient.query.unix_timestamp_array": "unixTimestampArray",
"encode.datetime.DatetimeClient.property.default": "default",
"encode.datetime.DatetimeClient.property.rfc3339": "rfc3339",
"encode.datetime.DatetimeClient.property.rfc7231": "rfc7231",
"encode.datetime.DatetimeClient.property.unix_timestamp": "unixTimestamp",
"encode.datetime.DatetimeClient.property.unix_timestamp_array": "unixTimestampArray",
"encode.datetime.DatetimeClient.header.default": "default",
"encode.datetime.DatetimeClient.header.rfc3339": "rfc3339",
"encode.datetime.DatetimeClient.header.rfc7231": "rfc7231",
"encode.datetime.DatetimeClient.header.unix_timestamp": "unixTimestamp",
"encode.datetime.DatetimeClient.header.unix_timestamp_array": "unixTimestampArray",
"encode.datetime.DatetimeClient.response_header.default": "default",
"encode.datetime.DatetimeClient.response_header.rfc3339": "rfc3339",
"encode.datetime.DatetimeClient.response_header.rfc7231": "rfc7231",
"encode.datetime.DatetimeClient.response_header.unix_timestamp": "unixTimestamp"
}
}

Просмотреть файл

@ -1,25 +0,0 @@
{
"CrossLanguagePackageId": "Encode.Duration",
"CrossLanguageDefinitionId": {
"encode.duration.models.DefaultDurationProperty": "Encode.Duration.Property.DefaultDurationProperty",
"encode.duration.models.FloatSecondsDurationArrayProperty": "Encode.Duration.Property.FloatSecondsDurationArrayProperty",
"encode.duration.models.FloatSecondsDurationProperty": "Encode.Duration.Property.FloatSecondsDurationProperty",
"encode.duration.models.Int32SecondsDurationProperty": "Encode.Duration.Property.Int32SecondsDurationProperty",
"encode.duration.models.ISO8601DurationProperty": "Encode.Duration.Property.ISO8601DurationProperty",
"encode.duration.DurationClient.query.default": "default",
"encode.duration.DurationClient.query.iso8601": "iso8601",
"encode.duration.DurationClient.query.int32_seconds": "int32Seconds",
"encode.duration.DurationClient.query.float_seconds": "floatSeconds",
"encode.duration.DurationClient.query.int32_seconds_array": "int32SecondsArray",
"encode.duration.DurationClient.property.default": "default",
"encode.duration.DurationClient.property.iso8601": "iso8601",
"encode.duration.DurationClient.property.int32_seconds": "int32Seconds",
"encode.duration.DurationClient.property.float_seconds": "floatSeconds",
"encode.duration.DurationClient.property.float_seconds_array": "floatSecondsArray",
"encode.duration.DurationClient.header.default": "default",
"encode.duration.DurationClient.header.iso8601": "iso8601",
"encode.duration.DurationClient.header.iso8601_array": "iso8601Array",
"encode.duration.DurationClient.header.int32_seconds": "int32Seconds",
"encode.duration.DurationClient.header.float_seconds": "floatSeconds"
}
}

Просмотреть файл

@ -1,12 +0,0 @@
{
"CrossLanguagePackageId": "Type.Model.Visibility",
"CrossLanguageDefinitionId": {
"headasbooleanfalse.models.VisibilityModel": "Type.Model.Visibility.VisibilityModel",
"headasbooleanfalse.VisibilityClient.get_model": "getModel",
"headasbooleanfalse.VisibilityClient.head_model": "headModel",
"headasbooleanfalse.VisibilityClient.put_model": "putModel",
"headasbooleanfalse.VisibilityClient.patch_model": "patchModel",
"headasbooleanfalse.VisibilityClient.post_model": "postModel",
"headasbooleanfalse.VisibilityClient.delete_model": "deleteModel"
}
}

Просмотреть файл

@ -1,12 +0,0 @@
{
"CrossLanguagePackageId": "Type.Model.Visibility",
"CrossLanguageDefinitionId": {
"headasbooleantrue.models.VisibilityModel": "Type.Model.Visibility.VisibilityModel",
"headasbooleantrue.VisibilityClient.get_model": "getModel",
"headasbooleantrue.VisibilityClient.head_model": "headModel",
"headasbooleantrue.VisibilityClient.put_model": "putModel",
"headasbooleantrue.VisibilityClient.patch_model": "patchModel",
"headasbooleantrue.VisibilityClient.post_model": "postModel",
"headasbooleantrue.VisibilityClient.delete_model": "deleteModel"
}
}

Просмотреть файл

@ -1,10 +0,0 @@
{
"CrossLanguagePackageId": "Parameters.BodyOptionality",
"CrossLanguageDefinitionId": {
"parameters.bodyoptionality.models.BodyModel": "Parameters.BodyOptionality.BodyModel",
"parameters.bodyoptionality.BodyOptionalityClient.optional_explicit.set": "set",
"parameters.bodyoptionality.BodyOptionalityClient.optional_explicit.omit": "omit",
"parameters.bodyoptionality.BodyOptionalityClient.required_explicit": "requiredExplicit",
"parameters.bodyoptionality.BodyOptionalityClient.required_implicit": "requiredImplicit"
}
}

Просмотреть файл

@ -1,11 +0,0 @@
{
"CrossLanguagePackageId": "Parameters.CollectionFormat",
"CrossLanguageDefinitionId": {
"parameters.collectionformat.CollectionFormatClient.query.multi": "multi",
"parameters.collectionformat.CollectionFormatClient.query.ssv": "ssv",
"parameters.collectionformat.CollectionFormatClient.query.tsv": "tsv",
"parameters.collectionformat.CollectionFormatClient.query.pipes": "pipes",
"parameters.collectionformat.CollectionFormatClient.query.csv": "csv",
"parameters.collectionformat.CollectionFormatClient.header.csv": "csv"
}
}

Просмотреть файл

@ -1,13 +0,0 @@
{
"CrossLanguagePackageId": "Parameters.Spread",
"CrossLanguageDefinitionId": {
"parameters.spread.models.BodyParameter": "Parameters.Spread.Model.BodyParameter",
"parameters.spread.models.SpreadAsRequestBodyRequest": "Parameters.Spread.Alias.",
"parameters.spread.models.SpreadAsRequestParameterRequest": "",
"parameters.spread.models.SpreadWithMultipleParametersRequest": "",
"parameters.spread.SpreadClient.model.spread_as_request_body": "spreadAsRequestBody",
"parameters.spread.SpreadClient.alias.spread_as_request_body": "spreadAsRequestBody",
"parameters.spread.SpreadClient.alias.spread_as_request_parameter": "spreadAsRequestParameter",
"parameters.spread.SpreadClient.alias.spread_with_multiple_parameters": "spreadWithMultipleParameters"
}
}

Просмотреть файл

@ -1,10 +0,0 @@
{
"CrossLanguagePackageId": "Payload.ContentNegotiation",
"CrossLanguageDefinitionId": {
"payload.contentnegotiation.models.PngImageAsJson": "Payload.ContentNegotiation.DifferentBody.PngImageAsJson",
"payload.contentnegotiation.ContentNegotiationClient.same_body.get_avatar_as_png": "getAvatarAsPng",
"payload.contentnegotiation.ContentNegotiationClient.same_body.get_avatar_as_jpeg": "getAvatarAsJpeg",
"payload.contentnegotiation.ContentNegotiationClient.different_body.get_avatar_as_png": "getAvatarAsPng",
"payload.contentnegotiation.ContentNegotiationClient.different_body.get_avatar_as_json": "getAvatarAsJson"
}
}

Просмотреть файл

@ -1,11 +0,0 @@
{
"CrossLanguagePackageId": "Payload.JsonMergePatch",
"CrossLanguageDefinitionId": {
"payload.jsonmergepatch.models.InnerModel": "Payload.JsonMergePatch.InnerModel",
"payload.jsonmergepatch.models.Resource": "Payload.JsonMergePatch.Resource",
"payload.jsonmergepatch.models.ResourcePatch": "Payload.JsonMergePatch.ResourcePatch",
"payload.jsonmergepatch.JsonMergePatchClient.create_resource": "createResource",
"payload.jsonmergepatch.JsonMergePatchClient.update_resource": "updateResource",
"payload.jsonmergepatch.JsonMergePatchClient.update_optional_resource": "updateOptionalResource"
}
}

Просмотреть файл

@ -1,9 +0,0 @@
{
"CrossLanguagePackageId": "Payload.MediaType",
"CrossLanguageDefinitionId": {
"payload.mediatype.MediaTypeClient.string_body.send_as_text": "sendAsText",
"payload.mediatype.MediaTypeClient.string_body.get_as_text": "getAsText",
"payload.mediatype.MediaTypeClient.string_body.send_as_json": "sendAsJson",
"payload.mediatype.MediaTypeClient.string_body.get_as_json": "getAsJson"
}
}

Просмотреть файл

@ -1,8 +0,0 @@
{
"CrossLanguagePackageId": "Resiliency.ServiceDriven",
"CrossLanguageDefinitionId": {
"resiliency.srv.driven1.ResiliencyServiceDrivenClient.from_none": "fromNone",
"resiliency.srv.driven1.ResiliencyServiceDrivenClient.from_one_required": "fromOneRequired",
"resiliency.srv.driven1.ResiliencyServiceDrivenClient.from_one_optional": "fromOneOptional"
}
}

Просмотреть файл

@ -1,9 +0,0 @@
{
"CrossLanguagePackageId": "Resiliency.ServiceDriven",
"CrossLanguageDefinitionId": {
"resiliency.srv.driven2.ResiliencyServiceDrivenClient.add_operation": "addOperation",
"resiliency.srv.driven2.ResiliencyServiceDrivenClient.from_none": "fromNone",
"resiliency.srv.driven2.ResiliencyServiceDrivenClient.from_one_required": "fromOneRequired",
"resiliency.srv.driven2.ResiliencyServiceDrivenClient.from_one_optional": "fromOneOptional"
}
}

Просмотреть файл

@ -1,8 +0,0 @@
{
"CrossLanguagePackageId": "Serialization.EncodedName.Json",
"CrossLanguageDefinitionId": {
"serialization.encodedname.json.models.JsonEncodedNameModel": "Serialization.EncodedName.Json.Property.JsonEncodedNameModel",
"serialization.encodedname.json.JsonClient.property.send": "send",
"serialization.encodedname.json.JsonClient.property.get": "get"
}
}

Просмотреть файл

@ -1,6 +0,0 @@
{
"CrossLanguagePackageId": "Server.Endpoint.NotDefined",
"CrossLanguageDefinitionId": {
"server.endpoint.notdefined.NotDefinedClient.valid": "valid"
}
}

Просмотреть файл

@ -1,8 +0,0 @@
{
"CrossLanguagePackageId": "Server.Path.Multiple",
"CrossLanguageDefinitionId": {
"server.path.multiple.models.Versions": "Server.Path.Multiple.Versions",
"server.path.multiple.MultipleClient.no_operation_params": "noOperationParams",
"server.path.multiple.MultipleClient.with_operation_path_param": "withOperationPathParam"
}
}

Просмотреть файл

@ -1,6 +0,0 @@
{
"CrossLanguagePackageId": "Server.Path.Single",
"CrossLanguageDefinitionId": {
"server.path.single.SingleClient.my_op": "myOp"
}
}

Просмотреть файл

@ -1,8 +0,0 @@
{
"CrossLanguagePackageId": "Server.Versions.NotVersioned",
"CrossLanguageDefinitionId": {
"server.versions.notversioned.NotVersionedClient.without_api_version": "withoutApiVersion",
"server.versions.notversioned.NotVersionedClient.with_query_api_version": "withQueryApiVersion",
"server.versions.notversioned.NotVersionedClient.with_path_api_version": "withPathApiVersion"
}
}

Просмотреть файл

@ -1,7 +0,0 @@
{
"CrossLanguagePackageId": "SpecialHeaders.ConditionalRequest",
"CrossLanguageDefinitionId": {
"specialheaders.conditionalrequest.ConditionalRequestClient.post_if_match": "postIfMatch",
"specialheaders.conditionalrequest.ConditionalRequestClient.post_if_none_match": "postIfNoneMatch"
}
}

Просмотреть файл

@ -1,6 +0,0 @@
{
"CrossLanguagePackageId": "SpecialHeaders.Repeatability",
"CrossLanguageDefinitionId": {
"specialheaders.repeatability.RepeatabilityClient.immediate_success": "immediateSuccess"
}
}

Просмотреть файл

@ -1,26 +0,0 @@
{
"CrossLanguagePackageId": "Type.Array",
"CrossLanguageDefinitionId": {
"typetest.array.models.InnerModel": "Type.Array.InnerModel",
"typetest.array.ArrayClient.int32_value.get": "get",
"typetest.array.ArrayClient.int32_value.put": "put",
"typetest.array.ArrayClient.int64_value.get": "get",
"typetest.array.ArrayClient.int64_value.put": "put",
"typetest.array.ArrayClient.boolean_value.get": "get",
"typetest.array.ArrayClient.boolean_value.put": "put",
"typetest.array.ArrayClient.string_value.get": "get",
"typetest.array.ArrayClient.string_value.put": "put",
"typetest.array.ArrayClient.float32_value.get": "get",
"typetest.array.ArrayClient.float32_value.put": "put",
"typetest.array.ArrayClient.datetime_value.get": "get",
"typetest.array.ArrayClient.datetime_value.put": "put",
"typetest.array.ArrayClient.duration_value.get": "get",
"typetest.array.ArrayClient.duration_value.put": "put",
"typetest.array.ArrayClient.unknown_value.get": "get",
"typetest.array.ArrayClient.unknown_value.put": "put",
"typetest.array.ArrayClient.model_value.get": "get",
"typetest.array.ArrayClient.model_value.put": "put",
"typetest.array.ArrayClient.nullable_float_value.get": "get",
"typetest.array.ArrayClient.nullable_float_value.put": "put"
}
}

Просмотреть файл

@ -1,28 +0,0 @@
{
"CrossLanguagePackageId": "Type.Dictionary",
"CrossLanguageDefinitionId": {
"typetest.dictionary.models.InnerModel": "Type.Dictionary.InnerModel",
"typetest.dictionary.DictionaryClient.int32_value.get": "get",
"typetest.dictionary.DictionaryClient.int32_value.put": "put",
"typetest.dictionary.DictionaryClient.int64_value.get": "get",
"typetest.dictionary.DictionaryClient.int64_value.put": "put",
"typetest.dictionary.DictionaryClient.boolean_value.get": "get",
"typetest.dictionary.DictionaryClient.boolean_value.put": "put",
"typetest.dictionary.DictionaryClient.string_value.get": "get",
"typetest.dictionary.DictionaryClient.string_value.put": "put",
"typetest.dictionary.DictionaryClient.float32_value.get": "get",
"typetest.dictionary.DictionaryClient.float32_value.put": "put",
"typetest.dictionary.DictionaryClient.datetime_value.get": "get",
"typetest.dictionary.DictionaryClient.datetime_value.put": "put",
"typetest.dictionary.DictionaryClient.duration_value.get": "get",
"typetest.dictionary.DictionaryClient.duration_value.put": "put",
"typetest.dictionary.DictionaryClient.unknown_value.get": "get",
"typetest.dictionary.DictionaryClient.unknown_value.put": "put",
"typetest.dictionary.DictionaryClient.model_value.get": "get",
"typetest.dictionary.DictionaryClient.model_value.put": "put",
"typetest.dictionary.DictionaryClient.recursive_model_value.get": "get",
"typetest.dictionary.DictionaryClient.recursive_model_value.put": "put",
"typetest.dictionary.DictionaryClient.nullable_float_value.get": "get",
"typetest.dictionary.DictionaryClient.nullable_float_value.put": "put"
}
}

Просмотреть файл

@ -1,10 +0,0 @@
{
"CrossLanguagePackageId": "Type.Enum.Extensible",
"CrossLanguageDefinitionId": {
"typetest.enum.extensible.models.DaysOfWeekExtensibleEnum": "Type.Enum.Extensible.DaysOfWeekExtensibleEnum",
"typetest.enum.extensible.ExtensibleClient.string.get_known_value": "getKnownValue",
"typetest.enum.extensible.ExtensibleClient.string.get_unknown_value": "getUnknownValue",
"typetest.enum.extensible.ExtensibleClient.string.put_known_value": "putKnownValue",
"typetest.enum.extensible.ExtensibleClient.string.put_unknown_value": "putUnknownValue"
}
}

Просмотреть файл

@ -1,11 +0,0 @@
{
"CrossLanguagePackageId": "Type.Model.Empty",
"CrossLanguageDefinitionId": {
"typetest.model.empty.models.EmptyInput": "Type.Model.Empty.EmptyInput",
"typetest.model.empty.models.EmptyInputOutput": "Type.Model.Empty.EmptyInputOutput",
"typetest.model.empty.models.EmptyOutput": "Type.Model.Empty.EmptyOutput",
"typetest.model.empty.EmptyClient.put_empty": "putEmpty",
"typetest.model.empty.EmptyClient.get_empty": "getEmpty",
"typetest.model.empty.EmptyClient.post_round_trip_empty": "postRoundTripEmpty"
}
}

Просмотреть файл

@ -1,16 +0,0 @@
{
"CrossLanguagePackageId": "Type.Model.Inheritance.NestedDiscriminator",
"CrossLanguageDefinitionId": {
"typetest.model.nesteddiscriminator.models.Fish": "Type.Model.Inheritance.NestedDiscriminator.Fish",
"typetest.model.nesteddiscriminator.models.Shark": "Type.Model.Inheritance.NestedDiscriminator.Shark",
"typetest.model.nesteddiscriminator.models.GoblinShark": "Type.Model.Inheritance.NestedDiscriminator.GoblinShark",
"typetest.model.nesteddiscriminator.models.Salmon": "Type.Model.Inheritance.NestedDiscriminator.Salmon",
"typetest.model.nesteddiscriminator.models.SawShark": "Type.Model.Inheritance.NestedDiscriminator.SawShark",
"typetest.model.nesteddiscriminator.NestedDiscriminatorClient.get_model": "getModel",
"typetest.model.nesteddiscriminator.NestedDiscriminatorClient.put_model": "putModel",
"typetest.model.nesteddiscriminator.NestedDiscriminatorClient.get_recursive_model": "getRecursiveModel",
"typetest.model.nesteddiscriminator.NestedDiscriminatorClient.put_recursive_model": "putRecursiveModel",
"typetest.model.nesteddiscriminator.NestedDiscriminatorClient.get_missing_discriminator": "getMissingDiscriminator",
"typetest.model.nesteddiscriminator.NestedDiscriminatorClient.get_wrong_discriminator": "getWrongDiscriminator"
}
}

Просмотреть файл

@ -1,11 +0,0 @@
{
"CrossLanguagePackageId": "Type.Model.Inheritance.NotDiscriminated",
"CrossLanguageDefinitionId": {
"typetest.model.notdiscriminated.models.Pet": "Type.Model.Inheritance.NotDiscriminated.Pet",
"typetest.model.notdiscriminated.models.Cat": "Type.Model.Inheritance.NotDiscriminated.Cat",
"typetest.model.notdiscriminated.models.Siamese": "Type.Model.Inheritance.NotDiscriminated.Siamese",
"typetest.model.notdiscriminated.NotDiscriminatedClient.post_valid": "postValid",
"typetest.model.notdiscriminated.NotDiscriminatedClient.get_valid": "getValid",
"typetest.model.notdiscriminated.NotDiscriminatedClient.put_valid": "putValid"
}
}

Просмотреть файл

@ -1,9 +0,0 @@
{
"CrossLanguagePackageId": "Type.Model.Inheritance.Recursive",
"CrossLanguageDefinitionId": {
"typetest.model.recursive.models.Element": "Type.Model.Inheritance.Recursive.Element",
"typetest.model.recursive.models.Extension": "Type.Model.Inheritance.Recursive.Extension",
"typetest.model.recursive.RecursiveClient.put": "put",
"typetest.model.recursive.RecursiveClient.get": "get"
}
}

Просмотреть файл

@ -1,19 +0,0 @@
{
"CrossLanguagePackageId": "Type.Model.Inheritance.SingleDiscriminator",
"CrossLanguageDefinitionId": {
"typetest.model.singlediscriminator.models.Bird": "Type.Model.Inheritance.SingleDiscriminator.Bird",
"typetest.model.singlediscriminator.models.Dinosaur": "Type.Model.Inheritance.SingleDiscriminator.Dinosaur",
"typetest.model.singlediscriminator.models.Eagle": "Type.Model.Inheritance.SingleDiscriminator.Eagle",
"typetest.model.singlediscriminator.models.Goose": "Type.Model.Inheritance.SingleDiscriminator.Goose",
"typetest.model.singlediscriminator.models.SeaGull": "Type.Model.Inheritance.SingleDiscriminator.SeaGull",
"typetest.model.singlediscriminator.models.Sparrow": "Type.Model.Inheritance.SingleDiscriminator.Sparrow",
"typetest.model.singlediscriminator.models.TRex": "Type.Model.Inheritance.SingleDiscriminator.TRex",
"typetest.model.singlediscriminator.SingleDiscriminatorClient.get_model": "getModel",
"typetest.model.singlediscriminator.SingleDiscriminatorClient.put_model": "putModel",
"typetest.model.singlediscriminator.SingleDiscriminatorClient.get_recursive_model": "getRecursiveModel",
"typetest.model.singlediscriminator.SingleDiscriminatorClient.put_recursive_model": "putRecursiveModel",
"typetest.model.singlediscriminator.SingleDiscriminatorClient.get_missing_discriminator": "getMissingDiscriminator",
"typetest.model.singlediscriminator.SingleDiscriminatorClient.get_wrong_discriminator": "getWrongDiscriminator",
"typetest.model.singlediscriminator.SingleDiscriminatorClient.get_legacy_model": "getLegacyModel"
}
}

Просмотреть файл

@ -1,11 +0,0 @@
{
"CrossLanguagePackageId": "Type.Model.Usage",
"CrossLanguageDefinitionId": {
"typetest.model.usage.models.InputOutputRecord": "Type.Model.Usage.InputOutputRecord",
"typetest.model.usage.models.InputRecord": "Type.Model.Usage.InputRecord",
"typetest.model.usage.models.OutputRecord": "Type.Model.Usage.OutputRecord",
"typetest.model.usage.UsageClient.input": "input",
"typetest.model.usage.UsageClient.output": "output",
"typetest.model.usage.UsageClient.input_and_output": "inputAndOutput"
}
}

Просмотреть файл

@ -1,12 +0,0 @@
{
"CrossLanguagePackageId": "Type.Model.Visibility",
"CrossLanguageDefinitionId": {
"typetest.model.visibility.models.VisibilityModel": "Type.Model.Visibility.VisibilityModel",
"typetest.model.visibility.VisibilityClient.get_model": "getModel",
"typetest.model.visibility.VisibilityClient.head_model": "headModel",
"typetest.model.visibility.VisibilityClient.put_model": "putModel",
"typetest.model.visibility.VisibilityClient.patch_model": "patchModel",
"typetest.model.visibility.VisibilityClient.post_model": "postModel",
"typetest.model.visibility.VisibilityClient.delete_model": "deleteModel"
}
}

Просмотреть файл

@ -1,36 +0,0 @@
{
"CrossLanguagePackageId": "Type.Property.Nullable",
"CrossLanguageDefinitionId": {
"typetest.property.nullable.models.BytesProperty": "Type.Property.Nullable.BytesProperty",
"typetest.property.nullable.models.CollectionsByteProperty": "Type.Property.Nullable.CollectionsByteProperty",
"typetest.property.nullable.models.CollectionsModelProperty": "Type.Property.Nullable.CollectionsModelProperty",
"typetest.property.nullable.models.DatetimeProperty": "Type.Property.Nullable.DatetimeProperty",
"typetest.property.nullable.models.DurationProperty": "Type.Property.Nullable.DurationProperty",
"typetest.property.nullable.models.InnerModel": "Type.Property.Nullable.InnerModel",
"typetest.property.nullable.models.StringProperty": "Type.Property.Nullable.StringProperty",
"typetest.property.nullable.NullableClient.string.get_non_null": "getNonNull",
"typetest.property.nullable.NullableClient.string.get_null": "getNull",
"typetest.property.nullable.NullableClient.string.patch_non_null": "patchNonNull",
"typetest.property.nullable.NullableClient.string.patch_null": "patchNull",
"typetest.property.nullable.NullableClient.bytes.get_non_null": "getNonNull",
"typetest.property.nullable.NullableClient.bytes.get_null": "getNull",
"typetest.property.nullable.NullableClient.bytes.patch_non_null": "patchNonNull",
"typetest.property.nullable.NullableClient.bytes.patch_null": "patchNull",
"typetest.property.nullable.NullableClient.datetime.get_non_null": "getNonNull",
"typetest.property.nullable.NullableClient.datetime.get_null": "getNull",
"typetest.property.nullable.NullableClient.datetime.patch_non_null": "patchNonNull",
"typetest.property.nullable.NullableClient.datetime.patch_null": "patchNull",
"typetest.property.nullable.NullableClient.duration.get_non_null": "getNonNull",
"typetest.property.nullable.NullableClient.duration.get_null": "getNull",
"typetest.property.nullable.NullableClient.duration.patch_non_null": "patchNonNull",
"typetest.property.nullable.NullableClient.duration.patch_null": "patchNull",
"typetest.property.nullable.NullableClient.collections_byte.get_non_null": "getNonNull",
"typetest.property.nullable.NullableClient.collections_byte.get_null": "getNull",
"typetest.property.nullable.NullableClient.collections_byte.patch_non_null": "patchNonNull",
"typetest.property.nullable.NullableClient.collections_byte.patch_null": "patchNull",
"typetest.property.nullable.NullableClient.collections_model.get_non_null": "getNonNull",
"typetest.property.nullable.NullableClient.collections_model.get_null": "getNull",
"typetest.property.nullable.NullableClient.collections_model.patch_non_null": "patchNonNull",
"typetest.property.nullable.NullableClient.collections_model.patch_null": "patchNull"
}
}

Просмотреть файл

@ -1,75 +0,0 @@
{
"CrossLanguagePackageId": "Type.Property.Optional",
"CrossLanguageDefinitionId": {
"typetest.property.optional.models.BooleanLiteralProperty": "Type.Property.Optional.BooleanLiteralProperty",
"typetest.property.optional.models.BytesProperty": "Type.Property.Optional.BytesProperty",
"typetest.property.optional.models.CollectionsByteProperty": "Type.Property.Optional.CollectionsByteProperty",
"typetest.property.optional.models.CollectionsModelProperty": "Type.Property.Optional.CollectionsModelProperty",
"typetest.property.optional.models.DatetimeProperty": "Type.Property.Optional.DatetimeProperty",
"typetest.property.optional.models.DurationProperty": "Type.Property.Optional.DurationProperty",
"typetest.property.optional.models.FloatLiteralProperty": "Type.Property.Optional.FloatLiteralProperty",
"typetest.property.optional.models.IntLiteralProperty": "Type.Property.Optional.IntLiteralProperty",
"typetest.property.optional.models.RequiredAndOptionalProperty": "Type.Property.Optional.RequiredAndOptionalProperty",
"typetest.property.optional.models.StringLiteralProperty": "Type.Property.Optional.StringLiteralProperty",
"typetest.property.optional.models.StringProperty": "Type.Property.Optional.StringProperty",
"typetest.property.optional.models.UnionFloatLiteralProperty": "Type.Property.Optional.UnionFloatLiteralProperty",
"typetest.property.optional.models.UnionIntLiteralProperty": "Type.Property.Optional.UnionIntLiteralProperty",
"typetest.property.optional.models.UnionStringLiteralProperty": "Type.Property.Optional.UnionStringLiteralProperty",
"typetest.property.optional.OptionalClient.string.get_all": "getAll",
"typetest.property.optional.OptionalClient.string.get_default": "getDefault",
"typetest.property.optional.OptionalClient.string.put_all": "putAll",
"typetest.property.optional.OptionalClient.string.put_default": "putDefault",
"typetest.property.optional.OptionalClient.bytes.get_all": "getAll",
"typetest.property.optional.OptionalClient.bytes.get_default": "getDefault",
"typetest.property.optional.OptionalClient.bytes.put_all": "putAll",
"typetest.property.optional.OptionalClient.bytes.put_default": "putDefault",
"typetest.property.optional.OptionalClient.datetime.get_all": "getAll",
"typetest.property.optional.OptionalClient.datetime.get_default": "getDefault",
"typetest.property.optional.OptionalClient.datetime.put_all": "putAll",
"typetest.property.optional.OptionalClient.datetime.put_default": "putDefault",
"typetest.property.optional.OptionalClient.duration.get_all": "getAll",
"typetest.property.optional.OptionalClient.duration.get_default": "getDefault",
"typetest.property.optional.OptionalClient.duration.put_all": "putAll",
"typetest.property.optional.OptionalClient.duration.put_default": "putDefault",
"typetest.property.optional.OptionalClient.collections_byte.get_all": "getAll",
"typetest.property.optional.OptionalClient.collections_byte.get_default": "getDefault",
"typetest.property.optional.OptionalClient.collections_byte.put_all": "putAll",
"typetest.property.optional.OptionalClient.collections_byte.put_default": "putDefault",
"typetest.property.optional.OptionalClient.collections_model.get_all": "getAll",
"typetest.property.optional.OptionalClient.collections_model.get_default": "getDefault",
"typetest.property.optional.OptionalClient.collections_model.put_all": "putAll",
"typetest.property.optional.OptionalClient.collections_model.put_default": "putDefault",
"typetest.property.optional.OptionalClient.string_literal.get_all": "getAll",
"typetest.property.optional.OptionalClient.string_literal.get_default": "getDefault",
"typetest.property.optional.OptionalClient.string_literal.put_all": "putAll",
"typetest.property.optional.OptionalClient.string_literal.put_default": "putDefault",
"typetest.property.optional.OptionalClient.int_literal.get_all": "getAll",
"typetest.property.optional.OptionalClient.int_literal.get_default": "getDefault",
"typetest.property.optional.OptionalClient.int_literal.put_all": "putAll",
"typetest.property.optional.OptionalClient.int_literal.put_default": "putDefault",
"typetest.property.optional.OptionalClient.float_literal.get_all": "getAll",
"typetest.property.optional.OptionalClient.float_literal.get_default": "getDefault",
"typetest.property.optional.OptionalClient.float_literal.put_all": "putAll",
"typetest.property.optional.OptionalClient.float_literal.put_default": "putDefault",
"typetest.property.optional.OptionalClient.boolean_literal.get_all": "getAll",
"typetest.property.optional.OptionalClient.boolean_literal.get_default": "getDefault",
"typetest.property.optional.OptionalClient.boolean_literal.put_all": "putAll",
"typetest.property.optional.OptionalClient.boolean_literal.put_default": "putDefault",
"typetest.property.optional.OptionalClient.union_string_literal.get_all": "getAll",
"typetest.property.optional.OptionalClient.union_string_literal.get_default": "getDefault",
"typetest.property.optional.OptionalClient.union_string_literal.put_all": "putAll",
"typetest.property.optional.OptionalClient.union_string_literal.put_default": "putDefault",
"typetest.property.optional.OptionalClient.union_int_literal.get_all": "getAll",
"typetest.property.optional.OptionalClient.union_int_literal.get_default": "getDefault",
"typetest.property.optional.OptionalClient.union_int_literal.put_all": "putAll",
"typetest.property.optional.OptionalClient.union_int_literal.put_default": "putDefault",
"typetest.property.optional.OptionalClient.union_float_literal.get_all": "getAll",
"typetest.property.optional.OptionalClient.union_float_literal.get_default": "getDefault",
"typetest.property.optional.OptionalClient.union_float_literal.put_all": "putAll",
"typetest.property.optional.OptionalClient.union_float_literal.put_default": "putDefault",
"typetest.property.optional.OptionalClient.required_and_optional.get_all": "getAll",
"typetest.property.optional.OptionalClient.required_and_optional.get_required_only": "getRequiredOnly",
"typetest.property.optional.OptionalClient.required_and_optional.put_all": "putAll",
"typetest.property.optional.OptionalClient.required_and_optional.put_required_only": "putRequiredOnly"
}
}

Просмотреть файл

@ -1,21 +0,0 @@
{
"CrossLanguagePackageId": "Type.Scalar",
"CrossLanguageDefinitionId": {
"typetest.scalar.ScalarClient.string.get": "get",
"typetest.scalar.ScalarClient.string.put": "put",
"typetest.scalar.ScalarClient.boolean.get": "get",
"typetest.scalar.ScalarClient.boolean.put": "put",
"typetest.scalar.ScalarClient.unknown.get": "get",
"typetest.scalar.ScalarClient.unknown.put": "put",
"typetest.scalar.ScalarClient.decimal_type.response_body": "responseBody",
"typetest.scalar.ScalarClient.decimal_type.request_body": "requestBody",
"typetest.scalar.ScalarClient.decimal_type.request_parameter": "requestParameter",
"typetest.scalar.ScalarClient.decimal128_type.response_body": "responseBody",
"typetest.scalar.ScalarClient.decimal128_type.request_body": "requestBody",
"typetest.scalar.ScalarClient.decimal128_type.request_parameter": "requestParameter",
"typetest.scalar.ScalarClient.decimal_verify.prepare_verify": "prepareVerify",
"typetest.scalar.ScalarClient.decimal_verify.verify": "verify",
"typetest.scalar.ScalarClient.decimal128_verify.prepare_verify": "prepareVerify",
"typetest.scalar.ScalarClient.decimal128_verify.verify": "verify"
}
}

Просмотреть файл

@ -1,52 +0,0 @@
{
"CrossLanguagePackageId": "Type.Union",
"CrossLanguageDefinitionId": {
"typetest.union.models.Cat": "Type.Union.Cat",
"typetest.union.models.Dog": "Type.Union.Dog",
"typetest.union.models.EnumsOnlyCases": "Type.Union.EnumsOnlyCases",
"typetest.union.models.GetResponse": "Type.Union.",
"typetest.union.models.GetResponse1": "Type.Union.",
"typetest.union.models.GetResponse2": "Type.Union.",
"typetest.union.models.GetResponse3": "Type.Union.",
"typetest.union.models.GetResponse4": "Type.Union.",
"typetest.union.models.GetResponse5": "Type.Union.",
"typetest.union.models.GetResponse6": "Type.Union.",
"typetest.union.models.GetResponse7": "Type.Union.",
"typetest.union.models.GetResponse8": "Type.Union.",
"typetest.union.models.GetResponse9": "Type.Union.",
"typetest.union.models.MixedLiteralsCases": "Type.Union.MixedLiteralsCases",
"typetest.union.models.MixedTypesCases": "Type.Union.MixedTypesCases",
"typetest.union.models.SendRequest": "Type.Union.",
"typetest.union.models.SendRequest1": "Type.Union.",
"typetest.union.models.SendRequest2": "Type.Union.",
"typetest.union.models.SendRequest3": "Type.Union.",
"typetest.union.models.SendRequest4": "Type.Union.",
"typetest.union.models.SendRequest5": "Type.Union.",
"typetest.union.models.SendRequest6": "Type.Union.",
"typetest.union.models.SendRequest7": "Type.Union.",
"typetest.union.models.SendRequest8": "Type.Union.",
"typetest.union.models.SendRequest9": "Type.Union.",
"typetest.union.models.StringAndArrayCases": "Type.Union.StringAndArrayCases",
"typetest.union.models.StringExtensibleNamedUnion": "Type.Union.StringExtensibleNamedUnion",
"typetest.union.UnionClient.strings_only.get": "get",
"typetest.union.UnionClient.strings_only.send": "send",
"typetest.union.UnionClient.string_extensible.get": "get",
"typetest.union.UnionClient.string_extensible.send": "send",
"typetest.union.UnionClient.string_extensible_named.get": "get",
"typetest.union.UnionClient.string_extensible_named.send": "send",
"typetest.union.UnionClient.ints_only.get": "get",
"typetest.union.UnionClient.ints_only.send": "send",
"typetest.union.UnionClient.floats_only.get": "get",
"typetest.union.UnionClient.floats_only.send": "send",
"typetest.union.UnionClient.models_only.get": "get",
"typetest.union.UnionClient.models_only.send": "send",
"typetest.union.UnionClient.enums_only.get": "get",
"typetest.union.UnionClient.enums_only.send": "send",
"typetest.union.UnionClient.string_and_array.get": "get",
"typetest.union.UnionClient.string_and_array.send": "send",
"typetest.union.UnionClient.mixed_literals.get": "get",
"typetest.union.UnionClient.mixed_literals.send": "send",
"typetest.union.UnionClient.mixed_types.get": "get",
"typetest.union.UnionClient.mixed_types.send": "send"
}
}

Просмотреть файл

@ -66,6 +66,9 @@ importers:
'@microsoft.azure/autorest.testserver':
specifier: ^3.3.46
version: 3.3.46(encoding@0.1.13)
chalk:
specifier: 5.3.0
version: 5.3.0
typescript:
specifier: ~5.1.3
version: 5.1.3
@ -139,6 +142,9 @@ importers:
c8:
specifier: ~7.13.0
version: 7.13.0
chalk:
specifier: 5.3.0
version: 5.3.0
rimraf:
specifier: ~5.0.0
version: 5.0.0
@ -1292,6 +1298,10 @@ packages:
resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==}
engines: {node: '>=10'}
chalk@5.3.0:
resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==}
engines: {node: ^12.17.0 || ^14.13 || >=16.0.0}
change-case@5.4.4:
resolution: {integrity: sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==}
@ -5144,6 +5154,8 @@ snapshots:
ansi-styles: 4.3.0
supports-color: 7.2.0
chalk@5.3.0: {}
change-case@5.4.4: {}
chownr@2.0.0: {}