Skip to content
This repository was archived by the owner on May 12, 2026. It is now read-only.

Commit 3b6c14c

Browse files
Update System.CommandLine and update nullability to be set based on required
1 parent 0e9bf14 commit 3b6c14c

32 files changed

Lines changed: 469 additions & 592 deletions

.github/dependabot.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ updates:
99
nuget:
1010
patterns:
1111
- "*"
12+
ignore:
13+
- dependency-name: "Microsoft.CodeAnalysis.CSharp"
14+
- dependency-name: "Microsoft.CodeAnalysis.Analyzers"
1215
- package-ecosystem: github-actions
1316
directory: "/"
1417
schedule:

.vscode/launch.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Debug ReQuesty",
6+
"type": "dotnet",
7+
"request": "launch",
8+
"projectPath": "${workspaceFolder}/ReQuesty/ReQuesty.csproj"
9+
}
10+
]
11+
}

ReQuesty.Builder/CodeDOM/CodeIndexer.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
namespace ReQuesty.Builder.CodeDOM;
22
public class CodeIndexer : CodeTerminal, IDocumentedElement, IDeprecableElement, ICloneable
33
{
4-
#nullable disable // exposing property is required
5-
private CodeTypeBase returnType;
6-
#nullable enable
4+
private CodeTypeBase? returnType;
75
public required CodeTypeBase ReturnType
86
{
9-
get => returnType; set
7+
get => returnType!;
8+
set
109
{
1110
ArgumentNullException.ThrowIfNull(value);
1211
EnsureElementsAreChildren(value);
1312
returnType = value;
1413
}
1514
}
16-
#nullable disable // exposing property is required
17-
private CodeParameter indexParameter;
18-
#nullable enable
15+
16+
private CodeParameter? indexParameter;
1917
/// <summary>
20-
/// The parameter to use for the indexer.
18+
/// The parameter to use for the indexer.
2119
/// </summary>
2220
public required CodeParameter IndexParameter
2321
{
24-
get => indexParameter; set
22+
get => indexParameter!;
23+
set
2524
{
2625
ArgumentNullException.ThrowIfNull(value);
2726
EnsureElementsAreChildren(value);
2827
indexParameter = value;
2928
}
3029
}
30+
3131
public CodeDocumentation Documentation { get; set; } = new();
3232
/// <summary>
3333
/// The Path segment to use for the method name when using back-compatible methods.

ReQuesty.Builder/CodeDOM/CodeMethod.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,18 +141,19 @@ public void AddAcceptedResponsesTypes(IEnumerable<string> types)
141141
public bool ShouldAddAcceptHeader => AcceptedResponseTypes.Any();
142142
public string AcceptHeaderValue => string.Join(", ", AcceptedResponseTypes);
143143
public AccessModifier Access { get; set; } = AccessModifier.Public;
144-
#nullable disable // exposing property is required
145-
private CodeTypeBase returnType;
146-
#nullable enable
144+
145+
private CodeTypeBase? returnType;
147146
public required CodeTypeBase ReturnType
148147
{
149-
get => returnType; set
148+
get => returnType!;
149+
set
150150
{
151151
ArgumentNullException.ThrowIfNull(value);
152152
EnsureElementsAreChildren(value);
153153
returnType = value;
154154
}
155155
}
156+
156157
private readonly ConcurrentDictionary<string, CodeParameter> parameters = new();
157158
public void RemoveParametersByKind(params CodeParameterKind[] kinds)
158159
{

ReQuesty.Builder/CodeDOM/CodeParameter.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,11 @@ public enum CodeParameterKind
6363

6464
public class CodeParameter : CodeTerminalWithKind<CodeParameterKind>, ICloneable, IDocumentedElement, IDeprecableElement
6565
{
66-
#nullable disable // exposing property is required
67-
private CodeTypeBase type;
68-
#nullable enable
66+
private CodeTypeBase? type;
6967
public required CodeTypeBase Type
7068
{
71-
get => type; set
69+
get => type!;
70+
set
7271
{
7372
ArgumentNullException.ThrowIfNull(value);
7473
EnsureElementsAreChildren(value);

ReQuesty.Builder/CodeDOM/CodeTypeBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public bool ActionOf
1717
{
1818
get; set;
1919
}
20-
public bool IsNullable { get; set; } = true;
20+
public bool IsNullable { get; set; }
2121
public CodeTypeCollectionKind CollectionKind { get; set; } = CodeTypeCollectionKind.None;
2222
public bool IsCollection
2323
{

ReQuesty.Builder/CodeDOM/CodeUsing.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
public class CodeUsing : CodeElement, ICloneable
33
{
44
private CodeType? declaration;
5+
56
public CodeType? Declaration
67
{
78
get => declaration; set
@@ -10,15 +11,19 @@ public CodeType? Declaration
1011
declaration = value;
1112
}
1213
}
14+
1315
public bool IsExternal
1416
{
1517
get => Declaration?.IsExternal ?? true;
1618
}
19+
1720
public bool IsErasable
1821
{
1922
get; set;
2023
}
24+
2125
public string Alias { get; set; } = string.Empty;
26+
2227
public object Clone()
2328
{
2429
return new CodeUsing

ReQuesty.Builder/Extensions/OpenApiUrlTreeNodeExtensions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@ public static string GetNodeNamespaceFromPath(this OpenApiUrlTreeNode currentNod
4141
//{id}, name(idParam={id}), name(idParam='{id}'), name(idParam='{id}',idParam2='{id2}')
4242
[GeneratedRegex(@"(?<prefix>\w+)?(?<equals>=?)'?\{(?<paramName>\w+)\}'?,?", RegexOptions.Singleline, 500)]
4343
private static partial Regex PathParametersRegex();
44+
4445
// microsoft.graph.getRoleScopeTagsByIds(ids=@ids)
4546
[GeneratedRegex(@"=@(\w+)", RegexOptions.Singleline, 500)]
4647
private static partial Regex AtSignPathParameterRegex();
48+
4749
private const char RequestParametersChar = '{';
4850
private const char RequestParametersEndChar = '}';
4951
private const string RequestParametersSectionChar = "(";

ReQuesty.Builder/LanguageInformation.cs

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,7 @@ public record LanguageDependency : IOpenApiSerializable
9797
{
9898
public string Name { get; set; } = string.Empty;
9999
public string Version { get; set; } = string.Empty;
100-
[JsonPropertyName("Type")]
101-
public DependencyType? DependencyType
102-
{
103-
get; set;
104-
}
105-
private const string TypePropertyName = "type";
100+
106101
public void SerializeAsV2(IOpenApiWriter writer) => SerializeAsV31(writer);
107102
public void SerializeAsV3(IOpenApiWriter writer) => SerializeAsV31(writer);
108103
public void SerializeAsV31(IOpenApiWriter writer)
@@ -111,10 +106,6 @@ public void SerializeAsV31(IOpenApiWriter writer)
111106
writer.WriteStartObject();
112107
writer.WriteProperty(nameof(Name).ToFirstCharacterLowerCase(), Name);
113108
writer.WriteProperty(nameof(Version).ToFirstCharacterLowerCase(), Version);
114-
if (DependencyType is not null)
115-
{
116-
writer.WriteProperty(TypePropertyName, DependencyType.ToString());
117-
}
118109
writer.WriteEndObject();
119110
}
120111
public static LanguageDependency Parse(JsonNode source)
@@ -135,10 +126,6 @@ public static LanguageDependency Parse(JsonNode source)
135126
{
136127
extension.Version = versionValue;
137128
}
138-
if (rawObject.TryGetPropertyValue(TypePropertyName, out JsonNode? typeNode) && typeNode is JsonValue typeJsonValue && typeJsonValue.TryGetValue<string>(out string? typeValue) && Enum.TryParse<DependencyType>(typeValue, true, out DependencyType parsedTypeValue))
139-
{
140-
extension.DependencyType = parsedTypeValue;
141-
}
142129
return extension;
143130
}
144131
}
@@ -156,13 +143,3 @@ public enum SupportExperience
156143
Microsoft,
157144
Community
158145
}
159-
160-
public enum DependencyType
161-
{
162-
Abstractions,
163-
Serialization,
164-
Authentication,
165-
Http,
166-
Bundle,
167-
Additional
168-
}

ReQuesty.Builder/ReQuesty.Builder.csproj

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<ItemGroup>
2626
<PackageReference Include="AsyncKeyedLock" Version="7.1.6" />
2727
<PackageReference Include="DotNet.Glob" Version="3.1.3" />
28-
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.6" />
28+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.8" />
2929
<PackageReference Include="ReQuesty.Runtime" Version="0.0.3" />
3030
<PackageReference Include="Microsoft.OpenApi" Version="2.0.0" />
3131
<PackageReference Include="Microsoft.OpenApi.ApiManifest" Version="2.0.0-preview5" />
@@ -38,12 +38,6 @@
3838
<PackageReference Include="YamlDotNet" Version="16.3.0" />
3939
<ProjectReference Include="..\ReQuesty.Generated\ReQuestyGenerated.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
4040
</ItemGroup>
41-
<ItemGroup>
42-
<AdditionalFiles Include="*.g.cs" />
43-
</ItemGroup>
44-
<ItemGroup>
45-
<None Include="../README.md" Pack="true" PackagePath="" />
46-
</ItemGroup>
4741
<ItemGroup>
4842
<EmbeddedResource Include="Resources\AdaptiveCardTemplate.json" />
4943
</ItemGroup>

0 commit comments

Comments
 (0)