Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(http-client-csharp): bump to tcgc 0.47.4 #4939

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

archerzz
Copy link
Member

@archerzz archerzz commented Nov 1, 2024

  • upgrade tcgc to 0.47.4
  • upgrade cadl-ranch to latest version

resolve #4938

- upgrade tcgc to 0.47.4
- upgrade cadl-ranch to latest version

resolve microsoft#4938
@archerzz archerzz added the emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp label Nov 1, 2024
"crossLanguageDefinitionId": "TypeSpec.float32",
"decorators": []
}
"$ref": "215"
Copy link
Member Author

@archerzz archerzz Nov 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type id 215 is the same type:

"valueType": {
  "$id": "215",
  "kind": "nullable",
  "type": {
  "$id": "216",
  "kind": "float32",
  "name": "float32",
  "crossLanguageDefinitionId": "TypeSpec.float32",
  "decorators": []
}

TCGC is improved in avoiding duplicated type definitions.

"crossLanguageDefinitionId": "TypeSpec.float32",
"decorators": []
}
"$ref": "256"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

}
],
"decorators": []
"$ref": "58"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type id 58 is actually the same:

{
  "$id": "58",
  "kind": "union",
  "name": "MixedTypesCasesModel",
  "variantTypes": [
    {
      "$id": "59", // note it's referenced in the deleted definition
      "kind": "model",
      "name": "Cat",
      "crossLanguageDefinitionId": "Type.Union.Cat",
      "usage": "Input,Output,Json",
      "decorators": [],
      "properties": [
        {
          "$id": "60",
          "kind": "property",
          "name": "name",
          "serializedName": "name",
          "type": {
            "$id": "61",
            "kind": "string",
            "name": "string",
            "crossLanguageDefinitionId": "TypeSpec.string",
            "decorators": []
          },
          "optional": false,
          "readOnly": false,
          "discriminator": false,
          "flatten": false,
          "decorators": [],
          "crossLanguageDefinitionId": "Type.Union.Cat.name"
        }
      ]
    },
    {
      "$id": "62",
      "kind": "constant",
      "valueType": {
        "$id": "63",
        "kind": "string",
        "name": "string",
        "crossLanguageDefinitionId": "TypeSpec.string",
        "decorators": []
      },
      "value": "a",
      "decorators": []
    },
    {
      "$id": "64",
      "kind": "int32",
      "name": "int32",
      "crossLanguageDefinitionId": "TypeSpec.int32",
      "decorators": []
    },
    {
      "$id": "65",
      "kind": "boolean",
      "name": "boolean",
      "crossLanguageDefinitionId": "TypeSpec.boolean",
      "decorators": []
    }
  ],
  "decorators": []
}

@archerzz
Copy link
Member Author

archerzz commented Nov 1, 2024

double confirmed that tcgc 0.47.4 fixes duplicated nullable types and union types.

archerzz pushed a commit to archerzz/autorest.csharp that referenced this pull request Nov 1, 2024
- bumpt latest emitter
- bump tcgc to 0.47.4

resolve microsoft/typespec#4939
@azure-sdk
Copy link
Collaborator

API change check

API changes are not detected in this pull request.

@archerzz
Copy link
Member Author

archerzz commented Nov 4, 2024

This PR is blocked by problematic typespec definition of Language.Conversation service. I've notified the service team to fix the problem

@archerzz
Copy link
Member Author

archerzz commented Nov 5, 2024

PR to fix the spec: Azure/azure-rest-api-specs#31416

# Conflicts:
#	packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/tspCodeModel.json
#	packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/tspCodeModel.json
#	packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/tspCodeModel.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(http-client-csharp): bump tcgc 0.47.4
3 participants