Skip to content

Commit

Permalink
generate apiview mapping (#2504)
Browse files Browse the repository at this point in the history
  • Loading branch information
iscai-msft authored Apr 22, 2024
1 parent c58781d commit ca27260
Show file tree
Hide file tree
Showing 130 changed files with 2,597 additions and 5 deletions.
16 changes: 16 additions & 0 deletions packages/autorest.python/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Release

## 2024-04-22 - 6.13.13

| Library | Min Version |
| ----------------------------------------------------------------------- | ----------- |
| `@autorest/core` | `3.9.2` |
| `@autorest/modelerfour` | `4.24.3` |
| `azure-core` dep of generated code | `1.30.0` |
| `isodate` dep of generated code | `0.6.1` |
| `msrest` dep of generated code (If generating legacy code) | `0.7.1` |
| `azure-mgmt-core` dep of generated code (If generating mgmt plane code) | `1.3.2` |
| `typing-extensions` dep of generated code (If generating with constants)| `4.0.1` |

**Other Changes**

- Generate apiview mapping for all azure generations #2504

## 2024-04-12 - 6.13.12

| Library | Min Version |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ def _serialize_and_write_top_level_folder(
)
if self.code_model.options.get("emit_cross_language_definition_file"):
self.write_file(
namespace_path / Path("apiview_mapping_python.json"),
Path("./apiview_mapping_python.json"),
general_serializer.serialize_cross_language_definition_file(),
)

Expand Down
3 changes: 2 additions & 1 deletion packages/typespec-python/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release

## 2023-04-15 - 0.23.4
## 2023-04-22 - 0.23.4

| Library | Min Version |
| ----------------------------------------------------------------------- | ------------- |
Expand All @@ -19,6 +19,7 @@
**Other Changes**

- Bump `@azure-tools/typespec-client-generator-core` to `0.41.2` #2521
- Generate apiview mapping for all azure generations #2504

## 2023-04-12 - 0.23.3

Expand Down
2 changes: 1 addition & 1 deletion packages/typespec-python/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@azure-tools/typespec-python",
"version": "0.23.3",
"version": "0.23.4",
"author": "Microsoft Corporation",
"description": "TypeSpec emitter for Python SDKs",
"homepage": "https://github.com/Azure/autorest.python",
Expand Down
3 changes: 3 additions & 0 deletions packages/typespec-python/src/emitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ export async function $onEmit(context: EmitContext<PythonEmitterOptions>) {
if (sdkContext.arm === true) {
commandArgs.push("--azure-arm=true");
}
if (resolvedOptions.flavor === "azure") {
commandArgs.push("--emit-cross-language-definition-file=true");
}
commandArgs.push("--from-typespec=true");
if (!program.compilerOptions.noEmit && !program.hasError()) {
execFileSync(process.execPath, commandArgs);
Expand Down
2 changes: 0 additions & 2 deletions packages/typespec-python/src/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export interface PythonEmitterOptions {
"company-name"?: string;
"debug"?: boolean;
"flavor"?: "azure";
"emit-cross-language-definition-file"?: boolean;
}

export interface PythonSdkContext<TServiceOperation extends SdkServiceOperation>
Expand All @@ -41,7 +40,6 @@ const EmitterOptionsSchema: JSONSchemaType<PythonEmitterOptions> = {
"company-name": { type: "string", nullable: true },
"debug": { type: "boolean", nullable: true },
"flavor": { type: "string", nullable: true },
"emit-cross-language-definition-file": { type: "boolean", nullable: true },
},
required: [],
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"CrossLanguagePackageId": "Authentication.ApiKey",
"CrossLanguageDefinitionId": {
"authentication.apikey.models.InvalidAuth": "Authentication.ApiKey.InvalidAuth",
"authentication.apikey.ApiKeyClient.valid": "valid",
"authentication.apikey.ApiKeyClient.invalid": "invalid"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"CrossLanguagePackageId": "Authentication.ApiKey",
"CrossLanguageDefinitionId": {
"authentication.apikey.models.InvalidAuth": "Authentication.ApiKey.InvalidAuth",
"authentication.apikey.ApiKeyClient.valid": "valid",
"authentication.apikey.ApiKeyClient.invalid": "invalid"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"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"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"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"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"CrossLanguagePackageId": "Authentication.OAuth2",
"CrossLanguageDefinitionId": {
"authentication.oauth2.models.InvalidAuth": "Authentication.OAuth2.InvalidAuth",
"authentication.oauth2.OAuth2Client.valid": "valid",
"authentication.oauth2.OAuth2Client.invalid": "invalid"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"CrossLanguagePackageId": "Authentication.OAuth2",
"CrossLanguageDefinitionId": {
"authentication.oauth2.models.InvalidAuth": "Authentication.OAuth2.InvalidAuth",
"authentication.oauth2.OAuth2Client.valid": "valid",
"authentication.oauth2.OAuth2Client.invalid": "invalid"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"CrossLanguagePackageId": "Authentication.Union",
"CrossLanguageDefinitionId": {
"authentication.union.UnionClient.valid_key": "validKey",
"authentication.union.UnionClient.valid_token": "validToken"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"CrossLanguagePackageId": "Authentication.Union",
"CrossLanguageDefinitionId": {
"authentication.union.UnionClient.valid_key": "validKey",
"authentication.union.UnionClient.valid_token": "validToken"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"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"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"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"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"CrossLanguagePackageId": "Type.Model.Flatten",
"CrossLanguageDefinitionId": {
"type.model.flatten.models.ChildFlattenModel": "Type.Model.Flatten.ChildFlattenModel",
"type.model.flatten.models.ChildModel": "Type.Model.Flatten.ChildModel",
"type.model.flatten.models.FlattenModel": "Type.Model.Flatten.FlattenModel",
"type.model.flatten.models.NestedFlattenModel": "Type.Model.Flatten.NestedFlattenModel",
"type.model.flatten.FlattenClient.put_flatten_model": "putFlattenModel",
"type.model.flatten.FlattenClient.put_nested_flatten_model": "putNestedFlattenModel"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"CrossLanguagePackageId": "Type.Model.Flatten",
"CrossLanguageDefinitionId": {
"type.model.flatten.models.ChildFlattenModel": "Type.Model.Flatten.ChildFlattenModel",
"type.model.flatten.models.ChildModel": "Type.Model.Flatten.ChildModel",
"type.model.flatten.models.FlattenModel": "Type.Model.Flatten.FlattenModel",
"type.model.flatten.models.NestedFlattenModel": "Type.Model.Flatten.NestedFlattenModel",
"type.model.flatten.FlattenClient.put_flatten_model": "putFlattenModel",
"type.model.flatten.FlattenClient.put_nested_flatten_model": "putNestedFlattenModel"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"CrossLanguagePackageId": "_Specs_.Azure.ClientGenerator.Core.Usage",
"CrossLanguageDefinitionId": {
"specs.azure.clientgenerator.core.usage.models.InputModel": "_Specs_.Azure.ClientGenerator.Core.Usage.ModelInOperation.InputModel",
"specs.azure.clientgenerator.core.usage.models.OrphanModel": "_Specs_.Azure.ClientGenerator.Core.Usage.OrphanModel",
"specs.azure.clientgenerator.core.usage.models.OutputModel": "_Specs_.Azure.ClientGenerator.Core.Usage.ModelInOperation.OutputModel",
"specs.azure.clientgenerator.core.usage.UsageClient.model_in_operation.input_to_input_output": "inputToInputOutput",
"specs.azure.clientgenerator.core.usage.UsageClient.model_in_operation.output_to_input_output": "outputToInputOutput"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"CrossLanguagePackageId": "_Specs_.Azure.ClientGenerator.Core.Usage",
"CrossLanguageDefinitionId": {
"specs.azure.clientgenerator.core.usage.models.InputModel": "_Specs_.Azure.ClientGenerator.Core.Usage.ModelInOperation.InputModel",
"specs.azure.clientgenerator.core.usage.models.OrphanModel": "_Specs_.Azure.ClientGenerator.Core.Usage.OrphanModel",
"specs.azure.clientgenerator.core.usage.models.OutputModel": "_Specs_.Azure.ClientGenerator.Core.Usage.ModelInOperation.OutputModel",
"specs.azure.clientgenerator.core.usage.UsageClient.model_in_operation.input_to_input_output": "inputToInputOutput",
"specs.azure.clientgenerator.core.usage.UsageClient.model_in_operation.output_to_input_output": "outputToInputOutput"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"CrossLanguagePackageId": "_Specs_.Azure.Core.Basic",
"CrossLanguageDefinitionId": {
"specs.azure.core.basic.models.FirstItem": "_Specs_.Azure.Core.Basic.FirstItem",
"specs.azure.core.basic.models.ListItemInputBody": "_Specs_.Azure.Core.Basic.ListItemInputBody",
"specs.azure.core.basic.models.SecondItem": "_Specs_.Azure.Core.Basic.SecondItem",
"specs.azure.core.basic.models.User": "_Specs_.Azure.Core.Basic.User",
"specs.azure.core.basic.models.UserListResults": "_Specs_.Azure.Core.Basic.CustomPageModel",
"specs.azure.core.basic.models.UserOrder": "_Specs_.Azure.Core.Basic.UserOrder",
"specs.azure.core.basic.models.ListItemInputExtensibleEnum": "_Specs_.Azure.Core.Basic.ListItemInputExtensibleEnum",
"specs.azure.core.basic.BasicClient.two_models_as_page_item.list_first_item": "listFirstItem",
"specs.azure.core.basic.BasicClient.two_models_as_page_item.list_second_item": "listSecondItem",
"specs.azure.core.basic.BasicClient.create_or_update": "createOrUpdate",
"specs.azure.core.basic.BasicClient.create_or_replace": "createOrReplace",
"specs.azure.core.basic.BasicClient.get": "get",
"specs.azure.core.basic.BasicClient.list": "list",
"specs.azure.core.basic.BasicClient.list_with_page": "listWithPage",
"specs.azure.core.basic.BasicClient.list_with_parameters": "listWithParameters",
"specs.azure.core.basic.BasicClient.list_with_custom_page_model": "listWithCustomPageModel",
"specs.azure.core.basic.BasicClient.delete": "delete",
"specs.azure.core.basic.BasicClient.export": "export"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"CrossLanguagePackageId": "_Specs_.Azure.Core.Basic",
"CrossLanguageDefinitionId": {
"specs.azure.core.basic.models.FirstItem": "_Specs_.Azure.Core.Basic.FirstItem",
"specs.azure.core.basic.models.ListItemInputBody": "_Specs_.Azure.Core.Basic.ListItemInputBody",
"specs.azure.core.basic.models.SecondItem": "_Specs_.Azure.Core.Basic.SecondItem",
"specs.azure.core.basic.models.User": "_Specs_.Azure.Core.Basic.User",
"specs.azure.core.basic.models.UserListResults": "_Specs_.Azure.Core.Basic.CustomPageModel",
"specs.azure.core.basic.models.UserOrder": "_Specs_.Azure.Core.Basic.UserOrder",
"specs.azure.core.basic.models.ListItemInputExtensibleEnum": "_Specs_.Azure.Core.Basic.ListItemInputExtensibleEnum",
"specs.azure.core.basic.BasicClient.two_models_as_page_item.list_first_item": "listFirstItem",
"specs.azure.core.basic.BasicClient.two_models_as_page_item.list_second_item": "listSecondItem",
"specs.azure.core.basic.BasicClient.create_or_update": "createOrUpdate",
"specs.azure.core.basic.BasicClient.create_or_replace": "createOrReplace",
"specs.azure.core.basic.BasicClient.get": "get",
"specs.azure.core.basic.BasicClient.list": "list",
"specs.azure.core.basic.BasicClient.list_with_page": "listWithPage",
"specs.azure.core.basic.BasicClient.list_with_parameters": "listWithParameters",
"specs.azure.core.basic.BasicClient.list_with_custom_page_model": "listWithCustomPageModel",
"specs.azure.core.basic.BasicClient.delete": "delete",
"specs.azure.core.basic.BasicClient.export": "export"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"CrossLanguagePackageId": "_Specs_.Azure.Core.Lro.Standard",
"CrossLanguageDefinitionId": {
"specs.azure.core.lro.standard.models.ExportedUser": "_Specs_.Azure.Core.Lro.Standard.ExportedUser",
"specs.azure.core.lro.standard.models.User": "_Specs_.Azure.Core.Lro.Standard.User",
"specs.azure.core.lro.standard.StandardClient.begin_create_or_replace": "createOrReplace",
"specs.azure.core.lro.standard.StandardClient.begin_delete": "delete",
"specs.azure.core.lro.standard.StandardClient.begin_export": "export"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"CrossLanguagePackageId": "_Specs_.Azure.Core.Lro.Standard",
"CrossLanguageDefinitionId": {
"specs.azure.core.lro.standard.models.ExportedUser": "_Specs_.Azure.Core.Lro.Standard.ExportedUser",
"specs.azure.core.lro.standard.models.User": "_Specs_.Azure.Core.Lro.Standard.User",
"specs.azure.core.lro.standard.StandardClient.begin_create_or_replace": "createOrReplace",
"specs.azure.core.lro.standard.StandardClient.begin_delete": "delete",
"specs.azure.core.lro.standard.StandardClient.begin_export": "export"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"CrossLanguagePackageId": "_Specs_.Azure.Core.Scalar",
"CrossLanguageDefinitionId": {
"specs.azure.core.scalar.models.AzureLocationModel": "_Specs_.Azure.Core.Scalar.AzureLocationModel",
"specs.azure.core.scalar.ScalarClient.azure_location_scalar.get": "get",
"specs.azure.core.scalar.ScalarClient.azure_location_scalar.put": "put",
"specs.azure.core.scalar.ScalarClient.azure_location_scalar.post": "post",
"specs.azure.core.scalar.ScalarClient.azure_location_scalar.header": "header",
"specs.azure.core.scalar.ScalarClient.azure_location_scalar.query": "query"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"CrossLanguagePackageId": "_Specs_.Azure.Core.Scalar",
"CrossLanguageDefinitionId": {
"specs.azure.core.scalar.models.AzureLocationModel": "_Specs_.Azure.Core.Scalar.AzureLocationModel",
"specs.azure.core.scalar.ScalarClient.azure_location_scalar.get": "get",
"specs.azure.core.scalar.ScalarClient.azure_location_scalar.put": "put",
"specs.azure.core.scalar.ScalarClient.azure_location_scalar.post": "post",
"specs.azure.core.scalar.ScalarClient.azure_location_scalar.header": "header",
"specs.azure.core.scalar.ScalarClient.azure_location_scalar.query": "query"
}
}
Loading

0 comments on commit ca27260

Please sign in to comment.