Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into andrueastman/pluginDo…
Browse files Browse the repository at this point in the history
…cumentTrimming
  • Loading branch information
Andrew Omondi committed Jun 3, 2024
2 parents ee3fb51 + 399a577 commit c0366a7
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 24 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixes a bug where indexers in include/exclude patters were not normalized if the indexer was the last segment without a slash at the end [#4715](https://github.com/microsoft/kiota/issues/4715)
- Fixes a bug where CLI generation doesnot handle parameters of type string array. [#4707](https://github.com/microsoft/kiota/issues/4707)
- Fixed a bug where models would not be created when a multipart content schema existed with no encoding [#4734](https://github.com/microsoft/kiota/issues/4734)
- Fixes a bug where warnings about discriminator not being inherited were generated [#4761](https://github.com/microsoft/kiota/issues/4761)
- Trims unused components from output openApi document when generating plugins [#4672](https://github.com/microsoft/kiota/issues/4672)

## [1.14.0] - 2024-05-02
Expand Down
2 changes: 1 addition & 1 deletion it/csharp/dotnet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.11.3" />
<PackageReference Include="Microsoft.Kiota.Abstractions" Version="1.9.3" />
<PackageReference Include="Microsoft.Kiota.Abstractions" Version="1.9.4" />
<PackageReference Include="Microsoft.Kiota.Authentication.Azure" Version="1.1.7" />
<PackageReference Include="Microsoft.Kiota.Http.HttpClientLibrary" Version="1.4.3" />
<PackageReference Include="Microsoft.Kiota.Serialization.Form" Version="1.2.4" />
Expand Down
6 changes: 3 additions & 3 deletions it/python/requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

astroid==3.2.2 ; python_full_version >= '3.7.2'

certifi==2024.2.2 ; python_version >= '3.6'
certifi==2024.6.2 ; python_version >= '3.6'

charset-normalizer==3.3.2 ; python_full_version >= '3.7.0'

Expand Down Expand Up @@ -56,15 +56,15 @@ tomli-w==1.0.0 ; python_version >= '3.7'

tomlkit==0.12.5 ; python_version >= '3.7'

typing-extensions==4.12.0 ; python_version >= '3.7'
typing-extensions==4.12.1 ; python_version >= '3.7'

urllib3==2.2.1 ; python_version >= '3.7'

wrapt==1.15.0 ; python_version < '3.11'

yapf==0.40.2

zipp==3.19.0 ; python_version >= '3.7'
zipp==3.19.1 ; python_version >= '3.7'

aiohttp==3.9.5 ; python_version >= '3.6'

Expand Down
16 changes: 8 additions & 8 deletions it/typescript/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions it/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
"prettier": "./.prettierrc.json",
"devDependencies": {
"@es-exec/esbuild-plugin-start": "^0.0.5",
"@types/node": "^20.12.13",
"@types/node": "^20.14.0",
"@typescript-eslint/eslint-plugin": "^7.7.1",
"@typescript-eslint/parser": "^7.8.0",
"esbuild": "^0.21.4",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"minimist": "^1.2.8",
"prettier": "^3.2.5",
"prettier": "^3.3.0",
"typescript": "^4.9.5"
},
"dependencies": {
Expand Down
3 changes: 2 additions & 1 deletion src/Kiota.Builder/KiotaBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2164,7 +2164,8 @@ internal static void AddDiscriminatorMethod(CodeClass newClass, string discrimin
}
if (baseClass is not null && (result.TypeDefinition is not CodeClass codeClass || codeClass.StartBlock.Inherits is null))
{
logger.LogWarning("Discriminator {ComponentKey} is not inherited from {ClassName}.", componentKey, baseClass.Name);
if (!baseClass.Equals(result.TypeDefinition))// don't log warning if the discriminator points to the base type itself as this is implicitly the default case.
logger.LogWarning("Discriminator {ComponentKey} is not inherited from {ClassName}.", componentKey, baseClass.Name);
return null;
}
return result;
Expand Down
7 changes: 7 additions & 0 deletions tests/Kiota.Builder.Tests/KiotaBuilderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3426,6 +3426,13 @@ public async Task AddsDiscriminatorMappingsAllOfImplicit()
var entityClass = codeModel.FindChildByName<CodeClass>("entity");
var directoryObjectClass = codeModel.FindChildByName<CodeClass>("directoryObject");
var userClass = codeModel.FindChildByName<CodeClass>("user");
mockLogger.Verify(logger => logger.Log(
It.Is<LogLevel>(logLevel => logLevel == LogLevel.Warning),
It.Is<EventId>(eventId => eventId.Id == 0),
It.Is<It.IsAnyType>((@object, @type) => @object.ToString().Contains(" is not inherited from ", StringComparison.OrdinalIgnoreCase) && @type.Name == "FormattedLogValues"),
It.IsAny<Exception>(),
It.IsAny<Func<It.IsAnyType, Exception, string>>()),
Times.Never);
Assert.NotNull(entityClass);
Assert.NotNull(directoryObjectClass);
Assert.NotNull(userClass);
Expand Down
16 changes: 8 additions & 8 deletions vscode/microsoft-kiota/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vscode/microsoft-kiota/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@
"dependencies": {
"@vscode/extension-telemetry": "^0.9.6",
"@vscode/l10n": "^0.0.18",
"adm-zip": "^0.5.12",
"adm-zip": "^0.5.13",
"is-online": "^10.0.0",
"original-fs": "^1.2.0",
"vscode-jsonrpc": "^8.2.1"
Expand Down

0 comments on commit c0366a7

Please sign in to comment.