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

[Generation] Untyped node support #4095

Merged
merged 36 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
f8a5009
Fixes broken tests
Jan 30, 2024
a7af5dc
Merge remote-tracking branch 'origin/main' into andrueastman/untypedN…
Jan 30, 2024
75d7f38
WIP. Tests
Jan 30, 2024
8f6b6d9
Merge remote-tracking branch 'origin/main' into andrueastman/untypedN…
Jan 30, 2024
5adcf8a
Merge remote-tracking branch 'origin/main' into andrueastman/untypedN…
Jan 31, 2024
785f50c
Bring back missing properties
Jan 31, 2024
dda4ef6
Merge remote-tracking branch 'origin/main' into andrueastman/untypedN…
Jan 31, 2024
2b994c4
Fix typo
Jan 31, 2024
bcea41c
Format
Jan 31, 2024
6f9977b
Merge remote-tracking branch 'origin/main' into andrueastman/untypedN…
Feb 8, 2024
a135d49
Java fixes
Feb 8, 2024
824deb4
Merge remote-tracking branch 'origin/main' into andrueastman/untypedN…
Feb 9, 2024
e5bc01b
Merge remote-tracking branch 'origin/main' into andrueastman/untypedN…
Feb 9, 2024
ba81f41
Merge remote-tracking branch 'origin/main' into andrueastman/untypedN…
Feb 27, 2024
bcacb18
Todo testing
Feb 27, 2024
a64207c
Merge remote-tracking branch 'origin/main' into andrueastman/untypedN…
Feb 28, 2024
b0b2dd5
Merge remote-tracking branch 'origin/main' into andrueastman/untypedN…
Feb 28, 2024
7dd40a1
Merge remote-tracking branch 'origin/main' into andrueastman/untypedN…
Feb 28, 2024
6d5afc6
CLI does not need it.
Feb 28, 2024
0f81eaa
Adds CI for intergration tests.
Feb 28, 2024
270486e
Add intergration test for validation
Feb 28, 2024
3a892b5
Fix golang compilation
Feb 29, 2024
d8e4bb0
Merge remote-tracking branch 'origin/main' into andrueastman/untypedN…
Feb 29, 2024
fcb9830
Cleanup go runnability
Feb 29, 2024
5c8b5fd
Merge remote-tracking branch 'origin/main' into andrueastman/untypedN…
Feb 29, 2024
619611e
Merge remote-tracking branch 'origin/main' into andrueastman/untypedN…
Mar 4, 2024
a4664e1
Fix missing imports.
Mar 4, 2024
0377e2e
Merge remote-tracking branch 'origin/main' into andrueastman/untypedN…
Mar 4, 2024
87c9412
Adds more tests
Mar 4, 2024
2f66e4f
Merge remote-tracking branch 'origin/main' into andrueastman/untypedN…
Mar 5, 2024
f3d1ca4
Merge remote-tracking branch 'origin/main' into andrueastman/untypedN…
Mar 20, 2024
5bccb1e
Adds changelog entry.
Mar 20, 2024
a6f7650
Apply suggestions from code review
baywet Mar 20, 2024
12adc03
Merge branch 'main' into andrueastman/untypedNodes
andrueastman Mar 21, 2024
d9edd0b
Fix intergrations tests updates.
Mar 21, 2024
83b26e5
Merge remote-tracking branch 'origin/main' into andrueastman/untypedN…
Mar 21, 2024
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: 2 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ jobs:
- "apisguru::twilio.com:api"
- "apisguru::docusign.net"
- "apisguru::github.com:api.github.com"
- "apisguru::apis.guru"

steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
Expand Down
12 changes: 4 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- Added a warning message in the CLI when using preview languages. [#4316](https://github.com/microsoft/kiota/issues/4316)
- Added support for handling untyped Json content in C#,Golang, TypeScript and Java[#2319](https://github.com/microsoft/kiota/issues/2319)
baywet marked this conversation as resolved.
Show resolved Hide resolved

### Changed

Expand Down Expand Up @@ -642,9 +643,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed a bug where path parameters would be missing if no operation was present at the segment the parameter is defined. [#1940](https://github.com/microsoft/kiota/issues/1940)
- Fixed a bug where nested classes with long names caused compilation errors for java generated libraries. [#1949](https://github.com/microsoft/kiota/issues/1949)
- Removed use of anonymous classes in java generated libraries to reduce the number of java classes created at compilation time. [#1980](https://github.com/microsoft/kiota/pull/1980)
- Fixed a bug where generation would result in wrong indentation in some classes for Python [#1996]((https://github.com/microsoft/kiota/issues/1996).
- Fixed a bug where error class modules were hardcoded for Python [#1999]((https://github.com/microsoft/kiota/issues/1999)
- Fixed a bug where generation would sometimes result in wrong original names for query parameters in Python [#2000]((https://github.com/microsoft/kiota/issues/2000).
- Fixed a bug where generation would result in wrong indentation in some classes for Python [#1996]((<https://github.com/microsoft/kiota/issues/1996>).
baywet marked this conversation as resolved.
Show resolved Hide resolved
- Fixed a bug where error class modules were hardcoded for Python [#1999]((<https://github.com/microsoft/kiota/issues/1999>)
baywet marked this conversation as resolved.
Show resolved Hide resolved
- Fixed a bug where generation would sometimes result in wrong original names for query parameters in Python [#2000]((<https://github.com/microsoft/kiota/issues/2000>).
baywet marked this conversation as resolved.
Show resolved Hide resolved
- Fixed a bug where Java would fail to compile for endpoints that return collections.

## [0.7.1] - 2022-11-01
Expand Down Expand Up @@ -1283,8 +1284,3 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- Initial GitHub release





6 changes: 6 additions & 0 deletions it/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -339,5 +339,11 @@
"Rationale": "https://github.com/microsoft/kiota/issues/1812"
}
]
},
"apisguru::apis.guru": {
"Suppressions": [
],
"IdempotencySuppressions": [
]
}
}
14 changes: 8 additions & 6 deletions src/Kiota.Builder/KiotaBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@
private const string CoreInterfaceType = "IRequestAdapter";
private const string RequestAdapterParameterName = "requestAdapter";
private const string ConstructorMethodName = "constructor";
internal const string UntypedNodeName = "UntypedNode";
/// <summary>
/// Create a CodeClass instance that is a request builder class for the OpenApiUrlTreeNode
/// </summary>
Expand Down Expand Up @@ -975,7 +976,7 @@

if (!"string".Equals(parameter.Type.Name, StringComparison.OrdinalIgnoreCase) && config.IncludeBackwardCompatible)
{ // adding a second indexer for the string version of the parameter so we keep backward compatibility
//TODO remove for v2

Check warning on line 979 in src/Kiota.Builder/KiotaBuilder.cs

View workflow job for this annotation

GitHub Actions / Build

Complete the task associated to this 'TODO' comment. (https://rules.sonarsource.com/csharp/RSPEC-1135)
var backCompatibleValue = (CodeIndexer)result[0].Clone();
backCompatibleValue.Name += "-string";
backCompatibleValue.IndexParameter.Type = DefaultIndexerParameterType;
Expand Down Expand Up @@ -1038,7 +1039,7 @@
if (typeSchema?.OneOf?.Any() ?? false)
typeNames.AddRange(typeSchema.OneOf.Select(x => x.Type)); // double is sometimes an oneof string, number and enum
// first value that's not null, and not "object" for primitive collections, the items type matters
var typeName = typeNames.FirstOrDefault(static x => !string.IsNullOrEmpty(x) && !typeNamesToSkip.Contains(x));
var typeName = typeNames.Find(static x => !string.IsNullOrEmpty(x) && !typeNamesToSkip.Contains(x));

var isExternal = false;
if (typeSchema?.Items?.IsEnum() ?? false)
Expand Down Expand Up @@ -1129,7 +1130,7 @@
var suffix = $"{operationType}Response";
var modelType = CreateModelDeclarations(currentNode, schema, operation, parentClass, suffix);
if (modelType is not null && config.IncludeBackwardCompatible && config.Language is GenerationLanguage.CSharp or GenerationLanguage.Go && modelType.Name.EndsWith(suffix, StringComparison.Ordinal))
{ //TODO remove for v2

Check warning on line 1133 in src/Kiota.Builder/KiotaBuilder.cs

View workflow job for this annotation

GitHub Actions / Build

Complete the task associated to this 'TODO' comment. (https://rules.sonarsource.com/csharp/RSPEC-1135)
var obsoleteTypeName = modelType.Name[..^suffix.Length] + "Response";
if (modelType is CodeType codeType &&
codeType.TypeDefinition is CodeClass codeClass)
Expand Down Expand Up @@ -1262,7 +1263,7 @@
executorMethod.AddParameter(cancellationParam);// Add cancellation token parameter

if (returnTypes.Item2 is not null && config.IncludeBackwardCompatible)
{ //TODO remove for v2

Check warning on line 1266 in src/Kiota.Builder/KiotaBuilder.cs

View workflow job for this annotation

GitHub Actions / Build

Complete the task associated to this 'TODO' comment. (https://rules.sonarsource.com/csharp/RSPEC-1135)
var additionalExecutorMethod = (CodeMethod)executorMethod.Clone();
additionalExecutorMethod.ReturnType = returnTypes.Item2;
additionalExecutorMethod.OriginalMethod = executorMethod;
Expand Down Expand Up @@ -1617,7 +1618,7 @@
}
return unionType;
}
private CodeTypeBase? CreateModelDeclarations(OpenApiUrlTreeNode currentNode, OpenApiSchema schema, OpenApiOperation? operation, CodeElement parentElement, string suffixForInlineSchema, OpenApiResponse? response = default, string typeNameForInlineSchema = "", bool isRequestBody = false)
private CodeTypeBase CreateModelDeclarations(OpenApiUrlTreeNode currentNode, OpenApiSchema schema, OpenApiOperation? operation, CodeElement parentElement, string suffixForInlineSchema, OpenApiResponse? response = default, string typeNameForInlineSchema = "", bool isRequestBody = false)
{
var (codeNamespace, responseValue, suffix) = schema.IsReferencedSchema() switch
{
Expand Down Expand Up @@ -1662,13 +1663,13 @@
}

if (!string.IsNullOrEmpty(schema.Type) || !string.IsNullOrEmpty(schema.Format))
return GetPrimitiveType(schema, string.Empty);
return GetPrimitiveType(schema, string.Empty) ?? new CodeType { Name = UntypedNodeName, IsExternal = true };
if ((schema.AnyOf.Any() || schema.OneOf.Any() || schema.AllOf.Any()) &&
(schema.AnyOf.FirstOrDefault(static x => x.IsSemanticallyMeaningful(true)) ?? schema.OneOf.FirstOrDefault(static x => x.IsSemanticallyMeaningful(true)) ?? schema.AllOf.FirstOrDefault(static x => x.IsSemanticallyMeaningful(true))) is { } childSchema) // we have an empty node because of some local override for schema properties and need to unwrap it.
return CreateModelDeclarations(currentNode, childSchema, operation, parentElement, suffixForInlineSchema, response, typeNameForInlineSchema, isRequestBody);
return null;
return new CodeType { Name = UntypedNodeName, IsExternal = true };
}
private CodeTypeBase? CreateCollectionModelDeclaration(OpenApiUrlTreeNode currentNode, OpenApiSchema schema, OpenApiOperation? operation, CodeNamespace codeNamespace, string typeNameForInlineSchema, bool isRequestBody)
private CodeTypeBase CreateCollectionModelDeclaration(OpenApiUrlTreeNode currentNode, OpenApiSchema schema, OpenApiOperation? operation, CodeNamespace codeNamespace, string typeNameForInlineSchema, bool isRequestBody)
{
CodeTypeBase? type = GetPrimitiveType(schema.Items, string.Empty);
var isEnumOrComposedCollectionType = schema.Items.IsEnum() //the collection could be an enum type so override with strong type instead of string type.
Expand All @@ -1680,7 +1681,8 @@
var targetNamespace = GetShortestNamespace(codeNamespace, schema.Items);
type = CreateModelDeclarations(currentNode, schema.Items, operation, targetNamespace, string.Empty, typeNameForInlineSchema: typeNameForInlineSchema, isRequestBody: isRequestBody);
}
if (type is null) return null;
if (type is null)
return new CodeType { Name = UntypedNodeName, IsExternal = true };
type.CollectionKind = CodeTypeBase.CodeTypeCollectionKind.Complex;
return type;
}
Expand Down Expand Up @@ -2269,7 +2271,7 @@
if (!parameterClass.ContainsPropertyWithWireName(prop.WireName))
{
if (addBackwardCompatibleParameter && config.IncludeBackwardCompatible && config.Language is GenerationLanguage.CSharp or GenerationLanguage.Go)
{ //TODO remove for v2

Check warning on line 2274 in src/Kiota.Builder/KiotaBuilder.cs

View workflow job for this annotation

GitHub Actions / Build

Complete the task associated to this 'TODO' comment. (https://rules.sonarsource.com/csharp/RSPEC-1135)
var modernProp = (CodeProperty)prop.Clone();
modernProp.Name = $"{prop.Name}As{modernProp.Type.Name.ToFirstCharacterUpperCase()}";
modernProp.SerializationName = prop.WireName;
Expand Down
2 changes: 2 additions & 0 deletions src/Kiota.Builder/Refiners/CSharpRefiner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
Name = "DefaultQueryParameters",
IsExternal = true,
},
!_configuration.ExcludeBackwardCompatible,//TODO remove the condition for v2

Check warning on line 51 in src/Kiota.Builder/Refiners/CSharpRefiner.cs

View workflow job for this annotation

GitHub Actions / Build

Complete the task associated to this 'TODO' comment. (https://rules.sonarsource.com/csharp/RSPEC-1135)
!_configuration.ExcludeBackwardCompatible);
AddDefaultImports(generatedCode, defaultUsingEvaluators);
MoveClassesWithNamespaceNamesUnderNamespace(generatedCode);
Expand Down Expand Up @@ -183,6 +183,8 @@
SerializationNamespaceName, "ParseNodeHelper"),
new (static x => x is CodeProperty prop && prop.IsOfKind(CodePropertyKind.Headers),
AbstractionsNamespaceName, "RequestHeaders"),
new (static x => x is CodeProperty prop && prop.IsOfKind(CodePropertyKind.Custom) && prop.Type.Name.Equals(KiotaBuilder.UntypedNodeName, StringComparison.OrdinalIgnoreCase),
SerializationNamespaceName, KiotaBuilder.UntypedNodeName),
new (static x => x is CodeEnum prop && prop.Options.Any(x => x.IsNameEscaped),
"System.Runtime.Serialization", "EnumMemberAttribute"),
new (static x => x is IDeprecableElement element && element.Deprecation is not null && element.Deprecation.IsDeprecated,
Expand Down
11 changes: 11 additions & 0 deletions src/Kiota.Builder/Refiners/CommonLanguageRefiner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -621,9 +621,9 @@
if (currentElement is CodeIndexer currentIndexer &&
currentElement.Parent is CodeClass indexerParentClass)
{
if (indexerParentClass.ContainsMember(currentElement.Name)) // TODO remove condition for v2 necessary because of the second case of Go block

Check warning on line 624 in src/Kiota.Builder/Refiners/CommonLanguageRefiner.cs

View workflow job for this annotation

GitHub Actions / Build

Complete the task associated to this 'TODO' comment. (https://rules.sonarsource.com/csharp/RSPEC-1135)
indexerParentClass.RemoveChildElement(currentElement);
//TODO remove whole block except for last else if body for v2

Check warning on line 626 in src/Kiota.Builder/Refiners/CommonLanguageRefiner.cs

View workflow job for this annotation

GitHub Actions / Build

Complete the task associated to this 'TODO' comment. (https://rules.sonarsource.com/csharp/RSPEC-1135)
if (language == GenerationLanguage.Go)
{
if (currentIndexer.IsLegacyIndexer)
Expand Down Expand Up @@ -1444,6 +1444,16 @@

CrawlTree(currentElement, x => RemoveRequestConfigurationClassesCommonProperties(x, baseTypeUsing));
}
protected static void RemoveUntypedNodePropertyValues(CodeElement currentElement)
{
if (currentElement is CodeProperty currentProperty
&& currentElement.Parent is CodeClass parentClass
&& currentProperty.Type.Name.Equals(KiotaBuilder.UntypedNodeName, StringComparison.OrdinalIgnoreCase))
{
parentClass.RemoveChildElement(currentProperty);
}
CrawlTree(currentElement, RemoveUntypedNodePropertyValues);
}
protected static void RemoveRequestConfigurationClasses(CodeElement currentElement, CodeUsing? configurationParameterTypeUsing = null, CodeType? defaultValueForGenericTypeParam = null, bool keepRequestConfigurationClass = false, bool addDeprecation = false, CodeUsing? usingForDefaultGenericParameter = null)
{
if (currentElement is CodeClass currentClass && currentClass.IsOfKind(CodeClassKind.RequestConfiguration) &&
Expand Down Expand Up @@ -1490,6 +1500,7 @@
newType.GenericTypeParameterValues.Add(genericTypeParamValue);
return newType;
}

internal static void AddPrimaryErrorMessage(CodeElement currentElement, string name, Func<CodeType> type, bool asProperty = false)
{
if (currentElement is CodeClass { IsErrorDefinition: true } currentClass)
Expand Down
25 changes: 18 additions & 7 deletions src/Kiota.Builder/Refiners/GoRefiner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -570,24 +570,24 @@ private static void AddErrorAndStringsImportForEnums(CodeElement currentElement)
new (static x => x is CodeMethod method && method.IsOfKind(CodeMethodKind.Deserializer, CodeMethodKind.Factory),
"github.com/microsoft/kiota-abstractions-go/serialization", "ParseNode", "Parsable"),
new (static x => x is CodeClass codeClass && codeClass.IsOfKind(CodeClassKind.Model),
"github.com/microsoft/kiota-abstractions-go/serialization", "Parsable"),
SerializationNamespaceName, "Parsable"),
new (static x => x is CodeMethod method &&
method.IsOfKind(CodeMethodKind.RequestGenerator) &&
method.Parameters.Any(x => x.IsOfKind(CodeParameterKind.RequestBody) &&
x.Type.IsCollection &&
x.Type is CodeType pType &&
(pType.TypeDefinition is CodeClass ||
pType.TypeDefinition is CodeInterface)),
"github.com/microsoft/kiota-abstractions-go/serialization", "Parsable"),
SerializationNamespaceName, "Parsable"),
new (static x => x is CodeClass @class && @class.IsOfKind(CodeClassKind.Model) &&
(@class.Properties.Any(x => x.IsOfKind(CodePropertyKind.AdditionalData)) ||
@class.StartBlock.Implements.Any(x => KiotaBuilder.AdditionalHolderInterface.Equals(x.Name, StringComparison.OrdinalIgnoreCase))),
"github.com/microsoft/kiota-abstractions-go/serialization", "AdditionalDataHolder"),
SerializationNamespaceName, "AdditionalDataHolder"),
new (static x => x is CodeClass @class && @class.OriginalComposedType is CodeUnionType unionType && unionType.Types.Any(static y => !y.IsExternal) && unionType.DiscriminatorInformation.HasBasicDiscriminatorInformation,
"strings", "EqualFold"),
new (static x => x is CodeMethod method && (method.IsOfKind(CodeMethodKind.RequestExecutor) || method.IsOfKind(CodeMethodKind.RequestGenerator)), "context","*context"),
new (static x => x is CodeClass @class && @class.OriginalComposedType is CodeIntersectionType intersectionType && intersectionType.Types.Any(static y => !y.IsExternal) && intersectionType.DiscriminatorInformation.HasBasicDiscriminatorInformation,
"github.com/microsoft/kiota-abstractions-go/serialization", "MergeDeserializersForIntersectionWrapper"),
SerializationNamespaceName, "MergeDeserializersForIntersectionWrapper"),
new (static x => x is CodeProperty prop && prop.IsOfKind(CodePropertyKind.Headers),
AbstractionsNamespaceName, "RequestHeaders"),
new (static x => x is CodeProperty prop && prop.IsOfKind(CodePropertyKind.BackingStore), "github.com/microsoft/kiota-abstractions-go/store","BackingStore"),
Expand All @@ -596,10 +596,14 @@ x.Type is CodeType pType &&
"github.com/microsoft/kiota-abstractions-go/store", "BackingStoreFactory"),
new (static x => x is CodeMethod method && method.IsOfKind(CodeMethodKind.RequestExecutor, CodeMethodKind.RequestGenerator) && method.Parameters.Any(static y => y.IsOfKind(CodeParameterKind.RequestBody) && y.Type.Name.Equals(MultipartBodyClassName, StringComparison.OrdinalIgnoreCase)),
AbstractionsNamespaceName, MultipartBodyClassName),
new (static x => x is CodeProperty prop && prop.IsOfKind(CodePropertyKind.Custom) && prop.Type.Name.Equals(KiotaBuilder.UntypedNodeName, StringComparison.OrdinalIgnoreCase),
SerializationNamespaceName, KiotaBuilder.UntypedNodeName),
new (static x => x is CodeEnum @enum && @enum.Flags,"", "math"),
};
private const string MultipartBodyClassName = "MultipartBody";
private const string AbstractionsNamespaceName = "github.com/microsoft/kiota-abstractions-go";
private const string SerializationNamespaceName = "github.com/microsoft/kiota-abstractions-go/serialization";
internal const string UntypedNodeName = "UntypedNodeable";

private void CorrectImplements(ProprietableBlockDeclaration block)
{
Expand Down Expand Up @@ -672,21 +676,21 @@ private static void CorrectMethodType(CodeMethod currentMethod)
{"TimeSpan", ("ISODuration", new CodeUsing {
Name = "ISODuration",
Declaration = new CodeType {
Name = "github.com/microsoft/kiota-abstractions-go/serialization",
Name = SerializationNamespaceName,
IsExternal = true,
},
})},
{"DateOnly", (string.Empty, new CodeUsing {
Name = "DateOnly",
Declaration = new CodeType {
Name = "github.com/microsoft/kiota-abstractions-go/serialization",
Name = SerializationNamespaceName,
IsExternal = true,
},
})},
{"TimeOnly", (string.Empty, new CodeUsing {
Name = "TimeOnly",
Declaration = new CodeType {
Name = "github.com/microsoft/kiota-abstractions-go/serialization",
Name = SerializationNamespaceName,
IsExternal = true,
},
})},
Expand All @@ -697,6 +701,13 @@ private static void CorrectMethodType(CodeMethod currentMethod)
IsExternal = true,
},
})},
{KiotaBuilder.UntypedNodeName, (GoRefiner.UntypedNodeName, new CodeUsing {
Name = GoRefiner.UntypedNodeName,
Declaration = new CodeType {
Name = SerializationNamespaceName,
IsExternal = true,
},
})},
};
private static void CorrectPropertyType(CodeProperty currentProperty)
{
Expand Down
2 changes: 2 additions & 0 deletions src/Kiota.Builder/Refiners/JavaRefiner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ private static void AddEnumSetImport(CodeElement currentElement)
AbstractionsNamespaceName, "QueryParameters"),
new (static x => x is CodeClass @class && @class.OriginalComposedType is CodeIntersectionType intersectionType && intersectionType.Types.Any(static y => !y.IsExternal),
SerializationNamespaceName, "ParseNodeHelper"),
new (static x => x is CodeProperty prop && prop.IsOfKind(CodePropertyKind.Custom) && prop.Type.Name.Equals(KiotaBuilder.UntypedNodeName, StringComparison.OrdinalIgnoreCase),
SerializationNamespaceName, KiotaBuilder.UntypedNodeName),
new (static x => x is CodeMethod method && method.IsOfKind(CodeMethodKind.RequestExecutor, CodeMethodKind.RequestGenerator) && method.Parameters.Any(static y => y.IsOfKind(CodeParameterKind.RequestBody) && y.Type.Name.Equals(MultipartBodyClassName, StringComparison.OrdinalIgnoreCase)),
AbstractionsNamespaceName, MultipartBodyClassName)
};
Expand Down
1 change: 1 addition & 0 deletions src/Kiota.Builder/Refiners/PhpRefiner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public override Task Refine(CodeNamespace generatedCode, CancellationToken cance
AddParsableImplementsForModelClasses(generatedCode, "Parsable");
AddRequestConfigurationConstructors(generatedCode);
AddDefaultImports(generatedCode, defaultUsingEvaluators);
RemoveUntypedNodePropertyValues(generatedCode);
AddCollectionValidationUtilImportToModels(generatedCode);
cancellationToken.ThrowIfCancellationRequested();
AddGetterAndSetterMethods(generatedCode,
Expand Down
1 change: 1 addition & 0 deletions src/Kiota.Builder/Refiners/PythonRefiner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public override Task Refine(CodeNamespace generatedCode, CancellationToken cance
);
CorrectCommonNames(generatedCode);
RemoveMethodByKind(generatedCode, CodeMethodKind.RawUrlConstructor);
RemoveUntypedNodePropertyValues(generatedCode);
DisableActionOf(generatedCode,
CodeParameterKind.RequestConfiguration);
MoveRequestBuilderPropertiesToBaseType(generatedCode,
Expand Down
1 change: 1 addition & 0 deletions src/Kiota.Builder/Refiners/RubyRefiner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public override Task Refine(CodeNamespace generatedCode, CancellationToken cance
cancellationToken.ThrowIfCancellationRequested();
AddParsableImplementsForModelClasses(generatedCode, "MicrosoftKiotaAbstractions::Parsable");
AddDefaultImports(generatedCode, defaultUsingEvaluators);
RemoveUntypedNodePropertyValues(generatedCode);
CorrectCoreType(generatedCode, CorrectMethodType, CorrectPropertyType, CorrectImplements);
cancellationToken.ThrowIfCancellationRequested();
ReplacePropertyNames(generatedCode,
Expand Down
1 change: 1 addition & 0 deletions src/Kiota.Builder/Refiners/SwiftRefiner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public override Task Refine(CodeNamespace generatedCode, CancellationToken cance
AddDefaultImports(
generatedCode,
defaultUsingEvaluators);
RemoveUntypedNodePropertyValues(generatedCode);
cancellationToken.ThrowIfCancellationRequested();
CorrectCoreType(
generatedCode,
Expand Down
4 changes: 3 additions & 1 deletion src/Kiota.Builder/Refiners/TypeScriptRefiner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,9 @@ private static bool HasMultipartBody(CodeMethod m) =>
new (static x => x is CodeProperty prop && prop.Kind is CodePropertyKind.BackingStore,
AbstractionsPackageName, true, "BackingStore", "BackedModel"),
new (static x => x is CodeMethod m && HasMultipartBody(m),
AbstractionsPackageName, MultipartBodyClassName, $"serialize{MultipartBodyClassName}")
AbstractionsPackageName, MultipartBodyClassName, $"serialize{MultipartBodyClassName}"),
new (static x => x is CodeProperty prop && prop.IsOfKind(CodePropertyKind.Custom) && prop.Type.Name.Equals(KiotaBuilder.UntypedNodeName, StringComparison.OrdinalIgnoreCase),
AbstractionsPackageName, KiotaBuilder.UntypedNodeName, "createUntypedNodeFromDiscriminatorValue"),
};
private const string MultipartBodyClassName = "MultipartBody";
private static void CorrectImplements(ProprietableBlockDeclaration block)
Expand Down
Loading
Loading