From 16e57662861f9c64ff0392d65aecd1994a0e5562 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Oct 2022 03:03:45 +0000 Subject: [PATCH 01/13] Bump apidoctor from `2f0c4e3` to `7420842` Bumps [apidoctor](https://github.com/OneDrive/apidoctor) from `2f0c4e3` to `7420842`. - [Release notes](https://github.com/OneDrive/apidoctor/releases) - [Commits](https://github.com/OneDrive/apidoctor/compare/2f0c4e32d8774e1d5bfd81b186e98981274ff7f2...742084283c4b0fc7eed8cd8d6c23cac23ecc5a86) --- updated-dependencies: - dependency-name: apidoctor dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- apidoctor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apidoctor b/apidoctor index 2f0c4e32d..742084283 160000 --- a/apidoctor +++ b/apidoctor @@ -1 +1 @@ -Subproject commit 2f0c4e32d8774e1d5bfd81b186e98981274ff7f2 +Subproject commit 742084283c4b0fc7eed8cd8d6c23cac23ecc5a86 From 6de4ddced4be8aa8a0eab4ab9f688bb5862b0af6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Oct 2022 09:27:19 +0300 Subject: [PATCH 02/13] Bump submodules/vipr from `a945c8d` to `c2d6cf2` (#846) Bumps [submodules/vipr](https://github.com/microsoft/vipr) from `a945c8d` to `c2d6cf2`. - [Release notes](https://github.com/microsoft/vipr/releases) - [Commits](https://github.com/microsoft/vipr/compare/a945c8d231d1249cbe6cf297ce6484df3a9e75ca...c2d6cf233d61070b7d660099bf13ec332554a08d) --- updated-dependencies: - dependency-name: submodules/vipr dependency-type: direct:production ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- submodules/vipr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/vipr b/submodules/vipr index a945c8d23..c2d6cf233 160000 --- a/submodules/vipr +++ b/submodules/vipr @@ -1 +1 @@ -Subproject commit a945c8d231d1249cbe6cf297ce6484df3a9e75ca +Subproject commit c2d6cf233d61070b7d660099bf13ec332554a08d From 96d9e15f89945ec97e81768c84b323bf751cc9bc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Oct 2022 09:27:46 +0300 Subject: [PATCH 03/13] Bump actions/setup-dotnet from 3.0.0 to 3.0.1 (#845) Bumps [actions/setup-dotnet](https://github.com/actions/setup-dotnet) from 3.0.0 to 3.0.1. - [Release notes](https://github.com/actions/setup-dotnet/releases) - [Commits](https://github.com/actions/setup-dotnet/compare/v3.0.0...v3.0.1) --- updated-dependencies: - dependency-name: actions/setup-dotnet dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 7be865c9b..f55354e7d 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -16,7 +16,7 @@ jobs: with: submodules: recursive - name: Setup .NET - uses: actions/setup-dotnet@v3.0.0 + uses: actions/setup-dotnet@v3.0.1 with: dotnet-version: 6.0.x - name: Restore dependencies From fae3758c1ce0294ab75c0fabc748fc1c7129de52 Mon Sep 17 00:00:00 2001 From: Philip Gichuhi Date: Wed, 5 Oct 2022 09:51:34 +0300 Subject: [PATCH 04/13] Handle primitive collection properties --- .../templates/PHP/Model/EntityType.php.tt | 4 +-- .../Metadata/MetadataWithSubNamespaces.xml | 1 + .../com/Microsoft/Graph/Model/TestType.php | 27 +++++++++++++++++++ .../Beta/Microsoft/Graph/Model/TestType.php | 27 +++++++++++++++++++ 4 files changed, 57 insertions(+), 2 deletions(-) diff --git a/Templates/templates/PHP/Model/EntityType.php.tt b/Templates/templates/PHP/Model/EntityType.php.tt index 854b4d040..98fb9de27 100644 --- a/Templates/templates/PHP/Model/EntityType.php.tt +++ b/Templates/templates/PHP/Model/EntityType.php.tt @@ -188,7 +188,7 @@ foreach(var property in entity.Properties.Where(prop => prop.Type.GetTypeString( * <#=property.GetSanitizedLongDescription()#> <# } #> * - * @return <#=propertyTypeReference#>|null The <#=propertyName#> + * @return <#=(property.IsCollection()) ? "array" : propertyTypeReference#>|null The <#=propertyName#> */ public function get<#=propertyName.ToCheckedCase()#>() { @@ -216,7 +216,7 @@ foreach(var property in entity.Properties.Where(prop => prop.Type.GetTypeString( * <#=property.GetSanitizedLongDescription()#> <# } #> * - * @param <#=propertyTypeReference#> $val The <#=propertyName#> + * @param <#=(property.IsCollection()) ? $"{propertyTypeReference}[]" : propertyTypeReference#> $val The <#=propertyName#> * * @return <#=entityName.ToCheckedCase()#> */ diff --git a/test/Typewriter.Test/Metadata/MetadataWithSubNamespaces.xml b/test/Typewriter.Test/Metadata/MetadataWithSubNamespaces.xml index 2ee132789..fac15fdc4 100644 --- a/test/Typewriter.Test/Metadata/MetadataWithSubNamespaces.xml +++ b/test/Typewriter.Test/Metadata/MetadataWithSubNamespaces.xml @@ -10,6 +10,7 @@ + diff --git a/test/Typewriter.Test/TestDataPHP/com/Microsoft/Graph/Model/TestType.php b/test/Typewriter.Test/TestDataPHP/com/Microsoft/Graph/Model/TestType.php index 8c73d699a..bd6656f11 100644 --- a/test/Typewriter.Test/TestDataPHP/com/Microsoft/Graph/Model/TestType.php +++ b/test/Typewriter.Test/TestDataPHP/com/Microsoft/Graph/Model/TestType.php @@ -55,4 +55,31 @@ public function setPropertyAlpha($val) return $this; } + /** + * Gets the primitiveCollection + * + * @return array|null The primitiveCollection + */ + public function getPrimitiveCollection() + { + if (array_key_exists("primitiveCollection", $this->_propDict)) { + return $this->_propDict["primitiveCollection"]; + } else { + return null; + } + } + + /** + * Sets the primitiveCollection + * + * @param string[] $val The primitiveCollection + * + * @return TestType + */ + public function setPrimitiveCollection($val) + { + $this->_propDict["primitiveCollection"] = $val; + return $this; + } + } diff --git a/test/Typewriter.Test/TestDataPHPBeta/com/Beta/Microsoft/Graph/Model/TestType.php b/test/Typewriter.Test/TestDataPHPBeta/com/Beta/Microsoft/Graph/Model/TestType.php index bb8abf6b1..92cf77b7d 100644 --- a/test/Typewriter.Test/TestDataPHPBeta/com/Beta/Microsoft/Graph/Model/TestType.php +++ b/test/Typewriter.Test/TestDataPHPBeta/com/Beta/Microsoft/Graph/Model/TestType.php @@ -55,4 +55,31 @@ public function setPropertyAlpha($val) return $this; } + /** + * Gets the primitiveCollection + * + * @return array|null The primitiveCollection + */ + public function getPrimitiveCollection() + { + if (array_key_exists("primitiveCollection", $this->_propDict)) { + return $this->_propDict["primitiveCollection"]; + } else { + return null; + } + } + + /** + * Sets the primitiveCollection + * + * @param string[] $val The primitiveCollection + * + * @return TestType + */ + public function setPrimitiveCollection($val) + { + $this->_propDict["primitiveCollection"] = $val; + return $this; + } + } From a64fcdc52ed52e6b265602e97ec5510d397de6e7 Mon Sep 17 00:00:00 2001 From: Philip Gichuhi Date: Wed, 5 Oct 2022 09:56:10 +0300 Subject: [PATCH 05/13] Update test data --- .../TestDataObjC/Models/MSGraphTestType.h | 1 + .../TestDataObjC/Models/MSGraphTestType.m | 15 +++++++++++++++ .../com/microsoft/graph/src/Microsoft-graph.d.ts | 1 + .../com/microsoft/graph/src/Microsoft-graph.d.ts | 1 + 4 files changed, 18 insertions(+) diff --git a/test/Typewriter.Test/TestDataObjC/Models/MSGraphTestType.h b/test/Typewriter.Test/TestDataObjC/Models/MSGraphTestType.h index b7df6d1c4..28f2d018d 100644 --- a/test/Typewriter.Test/TestDataObjC/Models/MSGraphTestType.h +++ b/test/Typewriter.Test/TestDataObjC/Models/MSGraphTestType.h @@ -9,5 +9,6 @@ @interface MSGraphTestType : MSGraphEntity @property (nullable, nonatomic, setter=setPropertyAlpha:, getter=propertyAlpha) MSGraphDerivedComplexTypeRequest* propertyAlpha; + @property (nullable, nonatomic, setter=setPrimitiveCollection:, getter=primitiveCollection) NSArray* primitiveCollection; @end diff --git a/test/Typewriter.Test/TestDataObjC/Models/MSGraphTestType.m b/test/Typewriter.Test/TestDataObjC/Models/MSGraphTestType.m index a2665ab16..06dcdc114 100644 --- a/test/Typewriter.Test/TestDataObjC/Models/MSGraphTestType.m +++ b/test/Typewriter.Test/TestDataObjC/Models/MSGraphTestType.m @@ -15,6 +15,7 @@ @interface MSObject() @interface MSGraphTestType() { MSGraphDerivedComplexTypeRequest* _propertyAlpha; + NSArray* _primitiveCollection; } @end @@ -41,5 +42,19 @@ - (void) setPropertyAlpha: (MSGraphDerivedComplexTypeRequest*) val self.dictionary[@"propertyAlpha"] = val; } +- (NSArray*) primitiveCollection +{ + if([[NSNull null] isEqual:self.dictionary[@"primitiveCollection"]]) + { + return nil; + } + return self.dictionary[@"primitiveCollection"]; +} + +- (void) setPrimitiveCollection: (NSArray*) val +{ + self.dictionary[@"primitiveCollection"] = val; +} + @end diff --git a/test/Typewriter.Test/TestDataTypeScript/com/microsoft/graph/src/Microsoft-graph.d.ts b/test/Typewriter.Test/TestDataTypeScript/com/microsoft/graph/src/Microsoft-graph.d.ts index 55d91c689..e38fc857c 100644 --- a/test/Typewriter.Test/TestDataTypeScript/com/microsoft/graph/src/Microsoft-graph.d.ts +++ b/test/Typewriter.Test/TestDataTypeScript/com/microsoft/graph/src/Microsoft-graph.d.ts @@ -18,6 +18,7 @@ export interface Entity { } export interface TestType extends Entity { propertyAlpha?: NullableOption; + primitiveCollection?: NullableOption; } export interface Print { settings?: NullableOption; diff --git a/test/Typewriter.Test/TestDataTypeScriptBeta/com/microsoft/graph/src/Microsoft-graph.d.ts b/test/Typewriter.Test/TestDataTypeScriptBeta/com/microsoft/graph/src/Microsoft-graph.d.ts index 1f049e542..d24aeccff 100644 --- a/test/Typewriter.Test/TestDataTypeScriptBeta/com/microsoft/graph/src/Microsoft-graph.d.ts +++ b/test/Typewriter.Test/TestDataTypeScriptBeta/com/microsoft/graph/src/Microsoft-graph.d.ts @@ -17,6 +17,7 @@ export interface Entity { } export interface TestType extends Entity { propertyAlpha?: NullableOption; + primitiveCollection?: NullableOption; } export interface Print { settings?: NullableOption; From ed1f0d0b87fde11f67d109ff880ed64740ccc599 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 6 Oct 2022 03:05:37 +0000 Subject: [PATCH 06/13] Bump Mono.TextTemplating from 2.2.1 to 2.3.0 Bumps [Mono.TextTemplating](https://github.com/mono/t4) from 2.2.1 to 2.3.0. - [Release notes](https://github.com/mono/t4/releases) - [Changelog](https://github.com/mono/t4/blob/main/release-steps.md) - [Commits](https://github.com/mono/t4/compare/v2.2.1...v2.3.0) --- updated-dependencies: - dependency-name: Mono.TextTemplating dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- src/GraphODataTemplateWriter/GraphODataTemplateWriter.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GraphODataTemplateWriter/GraphODataTemplateWriter.csproj b/src/GraphODataTemplateWriter/GraphODataTemplateWriter.csproj index 8a16108c3..d406ab6e3 100644 --- a/src/GraphODataTemplateWriter/GraphODataTemplateWriter.csproj +++ b/src/GraphODataTemplateWriter/GraphODataTemplateWriter.csproj @@ -54,7 +54,7 @@ - 2.2.1 + 2.3.0 4.7.15 From cb44b9df22401d3fa2bcbf36a0420812b77624a1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Oct 2022 03:04:37 +0000 Subject: [PATCH 07/13] Bump apidoctor from `7420842` to `eb8d949` Bumps [apidoctor](https://github.com/OneDrive/apidoctor) from `7420842` to `eb8d949`. - [Release notes](https://github.com/OneDrive/apidoctor/releases) - [Commits](https://github.com/OneDrive/apidoctor/compare/742084283c4b0fc7eed8cd8d6c23cac23ecc5a86...eb8d949189884ee2a365086f5e429a887c34b13c) --- updated-dependencies: - dependency-name: apidoctor dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- apidoctor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apidoctor b/apidoctor index 742084283..eb8d94918 160000 --- a/apidoctor +++ b/apidoctor @@ -1 +1 @@ -Subproject commit 742084283c4b0fc7eed8cd8d6c23cac23ecc5a86 +Subproject commit eb8d949189884ee2a365086f5e429a887c34b13c From 57b8a10cc23b102727d265bcaf47595e4cdf8e8b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 Oct 2022 03:04:43 +0000 Subject: [PATCH 08/13] Bump actions/setup-dotnet from 3.0.1 to 3.0.2 Bumps [actions/setup-dotnet](https://github.com/actions/setup-dotnet) from 3.0.1 to 3.0.2. - [Release notes](https://github.com/actions/setup-dotnet/releases) - [Commits](https://github.com/actions/setup-dotnet/compare/v3.0.1...v3.0.2) --- updated-dependencies: - dependency-name: actions/setup-dotnet dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index f55354e7d..b140cefcd 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -16,7 +16,7 @@ jobs: with: submodules: recursive - name: Setup .NET - uses: actions/setup-dotnet@v3.0.1 + uses: actions/setup-dotnet@v3.0.2 with: dotnet-version: 6.0.x - name: Restore dependencies From bbb4910a9fa7a3994c7636ce4d6b78ff61e629ad Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Oct 2022 03:04:31 +0000 Subject: [PATCH 09/13] Bump submodules/vipr from `c2d6cf2` to `f4c578a` Bumps [submodules/vipr](https://github.com/microsoft/vipr) from `c2d6cf2` to `f4c578a`. - [Release notes](https://github.com/microsoft/vipr/releases) - [Commits](https://github.com/microsoft/vipr/compare/c2d6cf233d61070b7d660099bf13ec332554a08d...f4c578a51d1bdcb9ea1c323c15f22f8c4716eb70) --- updated-dependencies: - dependency-name: submodules/vipr dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- submodules/vipr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/vipr b/submodules/vipr index c2d6cf233..f4c578a51 160000 --- a/submodules/vipr +++ b/submodules/vipr @@ -1 +1 @@ -Subproject commit c2d6cf233d61070b7d660099bf13ec332554a08d +Subproject commit f4c578a51d1bdcb9ea1c323c15f22f8c4716eb70 From b712dcdb85360a4d90d485814a8836ae733c3799 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Oct 2022 03:04:47 +0000 Subject: [PATCH 10/13] Bump submodules/vipr from `f4c578a` to `f883156` Bumps [submodules/vipr](https://github.com/microsoft/vipr) from `f4c578a` to `f883156`. - [Release notes](https://github.com/microsoft/vipr/releases) - [Commits](https://github.com/microsoft/vipr/compare/f4c578a51d1bdcb9ea1c323c15f22f8c4716eb70...f883156396fb692a4ee9c61080b3a5a816f8b1a1) --- updated-dependencies: - dependency-name: submodules/vipr dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- submodules/vipr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/vipr b/submodules/vipr index f4c578a51..f88315639 160000 --- a/submodules/vipr +++ b/submodules/vipr @@ -1 +1 @@ -Subproject commit f4c578a51d1bdcb9ea1c323c15f22f8c4716eb70 +Subproject commit f883156396fb692a4ee9c61080b3a5a816f8b1a1 From d88cedb703e973af0649185580a738a7cbe51d4e Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Mon, 24 Oct 2022 16:19:02 +0300 Subject: [PATCH 11/13] Fix for method returning odata primitive --- .../Extensions/OdcmModelExtensions.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/GraphODataTemplateWriter/Extensions/OdcmModelExtensions.cs b/src/GraphODataTemplateWriter/Extensions/OdcmModelExtensions.cs index e2e74f393..1cdb58c2d 100644 --- a/src/GraphODataTemplateWriter/Extensions/OdcmModelExtensions.cs +++ b/src/GraphODataTemplateWriter/Extensions/OdcmModelExtensions.cs @@ -730,10 +730,10 @@ public static List GetComposableFunctionReturnTypeNavigations(this throw new InvalidOperationException("This extension method is intended " + "to only be called on a composable function."); - return (odcmMethod.ReturnType as OdcmClass).Properties + return (odcmMethod.ReturnType as OdcmClass)?.Properties .Where(p => p.IsLink) .OrderBy(p => p.Name) - .ToList(); + .ToList() ?? new List(); } /// From 96ecb1113caee916dc7c9bceec35865d8bd8faac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 25 Oct 2022 03:04:26 +0000 Subject: [PATCH 12/13] Bump submodules/vipr from `f883156` to `2cd91a5` Bumps [submodules/vipr](https://github.com/microsoft/vipr) from `f883156` to `2cd91a5`. - [Release notes](https://github.com/microsoft/vipr/releases) - [Commits](https://github.com/microsoft/vipr/compare/f883156396fb692a4ee9c61080b3a5a816f8b1a1...2cd91a506d36c1999a17a184b448754c26e59d79) --- updated-dependencies: - dependency-name: submodules/vipr dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- submodules/vipr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/vipr b/submodules/vipr index f88315639..2cd91a506 160000 --- a/submodules/vipr +++ b/submodules/vipr @@ -1 +1 @@ -Subproject commit f883156396fb692a4ee9c61080b3a5a816f8b1a1 +Subproject commit 2cd91a506d36c1999a17a184b448754c26e59d79 From 82f7106dadcb6770578ea6fe4d9c732f3bc12643 Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Tue, 25 Oct 2022 09:39:46 +0300 Subject: [PATCH 13/13] Default to empty list. --- src/GraphODataTemplateWriter/Extensions/OdcmModelExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GraphODataTemplateWriter/Extensions/OdcmModelExtensions.cs b/src/GraphODataTemplateWriter/Extensions/OdcmModelExtensions.cs index 1cdb58c2d..953e09e92 100644 --- a/src/GraphODataTemplateWriter/Extensions/OdcmModelExtensions.cs +++ b/src/GraphODataTemplateWriter/Extensions/OdcmModelExtensions.cs @@ -733,7 +733,7 @@ public static List GetComposableFunctionReturnTypeNavigations(this return (odcmMethod.ReturnType as OdcmClass)?.Properties .Where(p => p.IsLink) .OrderBy(p => p.Name) - .ToList() ?? new List(); + .ToList() ?? new List(); // default to empty list } ///