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

update version of MGC to adopt new typespec version 0.63.0 #47602

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/Packages.Data.props
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@
</ItemGroup>

<ItemGroup Condition="'$(IsGeneratorLibrary)' == 'true'">
<PackageReference Update="Microsoft.Generator.CSharp.ClientModel" Version="1.0.0-alpha.20241215.1" />
<PackageReference Update="Microsoft.Generator.CSharp.ClientModel" Version="1.0.0-alpha.20241217.2" />
</ItemGroup>

<!--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ public static class EnumMember
{
public static InputEnumTypeValue Int32(string name, int value)
{
return new InputEnumTypeValue(name, value, InputPrimitiveType.Int32, $"{name} description");
return new InputEnumTypeValue(name, value, InputPrimitiveType.Int32, null, $"{name} description");
}

public static InputEnumTypeValue Float32(string name, float value)
{
return new InputEnumTypeValue(name, value, InputPrimitiveType.Float32, $"{name} description");
return new InputEnumTypeValue(name, value, InputPrimitiveType.Float32, null, $"{name} description");
}

public static InputEnumTypeValue String(string name, string value)
{
return new InputEnumTypeValue(name, value, InputPrimitiveType.String, $"{name} description");
return new InputEnumTypeValue(name, value, InputPrimitiveType.String, null, $"{name} description");
}
}

Expand Down Expand Up @@ -87,6 +87,7 @@ public static InputParameter Parameter(
return new InputParameter(
name,
nameInRequest ?? name,
null,
$"{name} description",
type,
location,
Expand Down Expand Up @@ -127,10 +128,11 @@ public static InputEnumType Enum(
name,
access,
null,
null,
$"{name} description",
usage,
underlyingType,
values is null ? [new InputEnumTypeValue("Value", 1, InputPrimitiveType.Int32, "Value description")] : [.. values],
values is null ? [new InputEnumTypeValue("Value", 1, InputPrimitiveType.Int32, null, "Value description")] : [.. values],
isExtensible);
}

Expand All @@ -141,11 +143,13 @@ public static InputModelProperty Property(
bool isReadOnly = false,
bool isDiscriminator = false,
string? wireName = null,
string? summary = null,
string? description = null)
{
return new InputModelProperty(
name,
wireName ?? name,
summary,
description ?? $"Description for {name}",
type,
isRequired,
Expand All @@ -171,6 +175,7 @@ public static InputModelType Model(
name,
access,
null,
null,
$"{name} description",
usage,
[.. propertiesList],
Expand Down Expand Up @@ -208,6 +213,7 @@ public static InputOperation Operation(
return new InputOperation(
name,
null,
null,
$"{name} description",
null,
access,
Expand Down Expand Up @@ -242,6 +248,7 @@ public static InputClient Client(string name, IEnumerable<InputOperation>? opera
{
return new InputClient(
name,
null,
$"{name} description",
operations is null ? [] : [.. operations],
parameters is null ? [] : [.. parameters],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ internal class ClientProviderTests
private const string KeyAuthCategory = "WithKeyAuth";
private const string OAuth2Category = "WithOAuth2";
private const string TestClientName = "TestClient";
private static readonly InputClient _animalClient = new("animal", "AnimalClient description", [], [], TestClientName);
private static readonly InputClient _dogClient = new("dog", "DogClient description", [], [], _animalClient.Name);
private static readonly InputClient _huskyClient = new("husky", "HuskyClient description", [], [], _dogClient.Name);
private static readonly InputClient _animalClient = new("animal", null, "AnimalClient description", [], [], TestClientName);
private static readonly InputClient _dogClient = new("dog", null, "DogClient description", [], [], _animalClient.Name);
private static readonly InputClient _huskyClient = new("husky", null, "HuskyClient description", [], [], _dogClient.Name);

private bool _containsSubClients;
private bool _hasKeyAuth;
Expand Down
Loading
Loading