Skip to content

Commit

Permalink
Merge branch 'main' into task/warn-unsupported-auth-flows
Browse files Browse the repository at this point in the history
  • Loading branch information
thewahome authored Nov 15, 2024
2 parents afe8aeb + 84255ef commit 1904a89
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/01-kiota-bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ body:
id: logs
attributes:
label: Debug output
description: Please copy and paste the output when using the `--debug`` flag. This will be automatically formatted into code, so no need for backticks.
description: Please copy and paste the output when using the `--ll debug`` flag. This will be automatically formatted into code, so no need for backticks.
value: |
<details><summary>Click to expand log</summary>
```
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed python generation in scenarios with opening/closing tags for code comments. [#5636](https://github.com/microsoft/kiota/issues/5636)
- Fixed Python error when a class inherits from a base class and implements an interface. [5637](https://github.com/microsoft/kiota/issues/5637)
- Fix anyOf/oneOf generation in TypeScript. [5353](https://github.com/microsoft/kiota/issues/5353)
- Fixed invalid code in Php caused by "*/*/" in property description. [5635](https://github.com/microsoft/kiota/issues/5635)

## [1.20.0] - 2024-11-07

Expand Down
10 changes: 5 additions & 5 deletions it/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
"Language": "typescript",
"Rationale": "https://github.com/microsoft/kiota/issues/5634"
},
{
"Language": "php",
"Rationale": "https://github.com/microsoft/kiota/issues/5635"
},
{
"Language": "ruby",
"Rationale": "https://github.com/microsoft/kiota/issues/1816"
},
{
"Language": "php",
"Rationale": "https://github.com/microsoft/kiota/issues/5779"
}
],
"ExcludePatterns": [
Expand Down Expand Up @@ -259,4 +259,4 @@
"Suppressions": [],
"IdempotencySuppressions": []
}
}
}
14 changes: 7 additions & 7 deletions it/csharp/dotnet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@

<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.13.1" />
<PackageReference Include="Microsoft.Kiota.Abstractions" Version="1.14.0" />
<PackageReference Include="Microsoft.Kiota.Authentication.Azure" Version="1.14.0" />
<PackageReference Include="Microsoft.Kiota.Http.HttpClientLibrary" Version="1.14.0" />
<PackageReference Include="Microsoft.Kiota.Serialization.Form" Version="1.14.0" />
<PackageReference Include="Microsoft.Kiota.Serialization.Json" Version="1.14.0" />
<PackageReference Include="Microsoft.kiota.Serialization.Multipart" Version="1.14.0" />
<PackageReference Include="Microsoft.Kiota.Serialization.Text" Version="1.14.0" />
<PackageReference Include="Microsoft.Kiota.Abstractions" Version="1.15.2" />
<PackageReference Include="Microsoft.Kiota.Authentication.Azure" Version="1.15.2" />
<PackageReference Include="Microsoft.Kiota.Http.HttpClientLibrary" Version="1.15.2" />
<PackageReference Include="Microsoft.Kiota.Serialization.Form" Version="1.15.2" />
<PackageReference Include="Microsoft.Kiota.Serialization.Json" Version="1.15.2" />
<PackageReference Include="Microsoft.kiota.Serialization.Multipart" Version="1.15.2" />
<PackageReference Include="Microsoft.Kiota.Serialization.Text" Version="1.15.2" />

<Compile Remove="basic\**" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions it/python/requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ urllib3==2.2.3 ; python_version >= '3.7'

wrapt==1.15.0 ; python_version < '3.11'

yapf==0.40.2
yapf==0.43.0

zipp==3.21.0 ; python_version >= '3.7'

aiohttp==3.10.10 ; python_version >= '3.6'
aiohttp==3.11.2 ; python_version >= '3.6'

aiosignal==1.3.1 ; python_version >= '3.7'

Expand Down
12 changes: 6 additions & 6 deletions src/Kiota.Builder/Kiota.Builder.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@
<PackageReference Include="AsyncKeyedLock" Version="7.1.3" />
<PackageReference Include="DotNet.Glob" Version="3.1.3" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.0" />
<PackageReference Include="Microsoft.Kiota.Abstractions" Version="1.14.0" />
<PackageReference Include="Microsoft.Kiota.Http.HttpClientLibrary" Version="1.14.0" />
<PackageReference Include="Microsoft.Kiota.Serialization.Form" Version="1.14.0" />
<PackageReference Include="Microsoft.Kiota.Serialization.Json" Version="1.14.0" />
<PackageReference Include="Microsoft.Kiota.Serialization.Text" Version="1.14.0" />
<PackageReference Include="Microsoft.kiota.Serialization.Multipart" Version="1.14.0" />
<PackageReference Include="Microsoft.Kiota.Abstractions" Version="1.15.2" />
<PackageReference Include="Microsoft.Kiota.Http.HttpClientLibrary" Version="1.15.2" />
<PackageReference Include="Microsoft.Kiota.Serialization.Form" Version="1.15.2" />
<PackageReference Include="Microsoft.Kiota.Serialization.Json" Version="1.15.2" />
<PackageReference Include="Microsoft.Kiota.Serialization.Text" Version="1.15.2" />
<PackageReference Include="Microsoft.kiota.Serialization.Multipart" Version="1.15.2" />
<PackageReference Include="Microsoft.OpenApi" Version="1.6.22" />
<PackageReference Include="Microsoft.OpenApi.ApiManifest" Version="0.5.5-preview" />
<PackageReference Include="Microsoft.OpenApi.Readers" Version="1.6.22" />
Expand Down
2 changes: 1 addition & 1 deletion src/Kiota.Builder/Writers/Php/CodeEnumWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public override void WriteCodeElement(CodeEnum codeElement, LanguageWriter write
writer.IncreaseIndent();
foreach (var enumProperty in enumProperties)
{
writer.WriteLine($"public const {GetEnumValueName(enumProperty.Name)} = '{enumProperty.WireName}';");
writer.WriteLine($"public const {GetEnumValueName(enumProperty.Name)} = \"{enumProperty.WireName}\";");
}
}
[GeneratedRegex(@"([A-Z]{1})", RegexOptions.Singleline, 500)]
Expand Down
2 changes: 1 addition & 1 deletion src/Kiota.Builder/Writers/Php/PhpConventionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ private string GetCollectionDocString(CodeParameter codeParameter)
return codeParameter.Optional ? $"{doc}|null" : doc;
}

internal static string RemoveInvalidDescriptionCharacters(string originalDescription) => originalDescription.Replace("\\", "/", StringComparison.OrdinalIgnoreCase);
internal static string RemoveInvalidDescriptionCharacters(string originalDescription) => originalDescription.Replace("\\", "/", StringComparison.OrdinalIgnoreCase).Replace("*/", string.Empty, StringComparison.OrdinalIgnoreCase);
public override bool WriteShortDescription(IDocumentedElement element, LanguageWriter writer, string prefix = "", string suffix = "")
{
ArgumentNullException.ThrowIfNull(writer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.0" />
<PackageReference Include="Microsoft.NET.Test.SDK" Version="17.11.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public async Task WritesEnumAsync()
Assert.Contains("use Microsoft\\Kiota\\Abstractions\\Enum", result);
Assert.Contains("class", result);
Assert.Contains("extends Enum", result);
Assert.Contains($"public const {optionName.ToUpperInvariant()} = '{optionName}'", result);
Assert.Contains($"public const {optionName.ToUpperInvariant()} = \"{optionName}\"", result);
AssertExtensions.CurlyBracesAreClosed(result, 1);
Assert.Contains(optionName, result);
}
Expand Down
22 changes: 22 additions & 0 deletions tests/Kiota.Builder.Tests/Writers/Php/CodePropertyWriterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,4 +246,26 @@ public async Task WriteRequestOptionAsync()
Assert.Contains("@var array<RequestOption>|null $options", result);
Assert.Contains("public ?array $options = null;", result);
}

[Fact]
public void WritePropertyWithDescription()
{
CodeProperty property = new CodeProperty
{
Name = "name",
Documentation = new()
{
DescriptionTemplate = "The name pattern that branches must match in order to deploy to the environment.Wildcard characters will not match `/`. For example, to match branches that begin with `release/` and contain an additional single slash, use `release/*/*`.For more information about pattern matching syntax, see the [Ruby File.fnmatch documentation](https://ruby-doc.org/core-2.5.1/File.html#method-c-fnmatch).",
},
Type = new CodeType
{
Name = "string"
},
Access = AccessModifier.Private
};
parentClass.AddProperty(property);
propertyWriter.WriteCodeElement(property, languageWriter);
var result = stringWriter.ToString();
Assert.DoesNotContain("/*/*", result);
}
}

0 comments on commit 1904a89

Please sign in to comment.