diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 7be865c9b..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.0 + uses: actions/setup-dotnet@v3.0.2 with: dotnet-version: 6.0.x - name: Restore dependencies 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/apidoctor b/apidoctor index 2f0c4e32d..eb8d94918 160000 --- a/apidoctor +++ b/apidoctor @@ -1 +1 @@ -Subproject commit 2f0c4e32d8774e1d5bfd81b186e98981274ff7f2 +Subproject commit eb8d949189884ee2a365086f5e429a887c34b13c diff --git a/src/GraphODataTemplateWriter/Extensions/OdcmModelExtensions.cs b/src/GraphODataTemplateWriter/Extensions/OdcmModelExtensions.cs index e2e74f393..953e09e92 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(); // default to empty list } /// 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 diff --git a/submodules/vipr b/submodules/vipr index a945c8d23..2cd91a506 160000 --- a/submodules/vipr +++ b/submodules/vipr @@ -1 +1 @@ -Subproject commit a945c8d231d1249cbe6cf297ce6484df3a9e75ca +Subproject commit 2cd91a506d36c1999a17a184b448754c26e59d79 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/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/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; + } + } 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;