Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
16e5766
Bump apidoctor from `2f0c4e3` to `7420842`
dependabot[bot] Oct 4, 2022
3459cc6
Merge pull request #844 from microsoftgraph/dependabot/submodules/api…
andrueastman Oct 4, 2022
6de4ddc
Bump submodules/vipr from `a945c8d` to `c2d6cf2` (#846)
dependabot[bot] Oct 5, 2022
96d9e15
Bump actions/setup-dotnet from 3.0.0 to 3.0.1 (#845)
dependabot[bot] Oct 5, 2022
fae3758
Handle primitive collection properties
Ndiritu Oct 5, 2022
a64fcdc
Update test data
Ndiritu Oct 5, 2022
5eff809
Merge pull request #847 from microsoftgraph/php/fix/primitive-collect…
Ndiritu Oct 5, 2022
ed1f0d0
Bump Mono.TextTemplating from 2.2.1 to 2.3.0
dependabot[bot] Oct 6, 2022
2141be6
Merge pull request #848 from microsoftgraph/dependabot/nuget/Mono.Tex…
andrueastman Oct 6, 2022
cb44b9d
Bump apidoctor from `7420842` to `eb8d949`
dependabot[bot] Oct 12, 2022
f08ddea
Merge pull request #849 from microsoftgraph/dependabot/submodules/api…
baywet Oct 12, 2022
57b8a10
Bump actions/setup-dotnet from 3.0.1 to 3.0.2
dependabot[bot] Oct 14, 2022
b895eb5
Merge pull request #850 from microsoftgraph/dependabot/github_actions…
andrueastman Oct 14, 2022
bbb4910
Bump submodules/vipr from `c2d6cf2` to `f4c578a`
dependabot[bot] Oct 17, 2022
8c02a38
Merge pull request #851 from microsoftgraph/dependabot/submodules/sub…
andrueastman Oct 17, 2022
b712dcd
Bump submodules/vipr from `f4c578a` to `f883156`
dependabot[bot] Oct 19, 2022
5c299f0
Merge pull request #852 from microsoftgraph/dependabot/submodules/sub…
andrueastman Oct 19, 2022
d88cedb
Fix for method returning odata primitive
Oct 24, 2022
96ecb11
Bump submodules/vipr from `f883156` to `2cd91a5`
dependabot[bot] Oct 25, 2022
1eabbbf
Merge pull request #853 from microsoftgraph/dependabot/submodules/sub…
andrueastman Oct 25, 2022
82f7106
Default to empty list.
Oct 25, 2022
252e775
Merge pull request #854 from microsoftgraph/fixgeneration
andrueastman Oct 25, 2022
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: 1 addition & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Templates/templates/PHP/Model/EntityType.php.tt
Original file line number Diff line number Diff line change
Expand Up @@ -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()#>()
{
Expand Down Expand Up @@ -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()#>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -730,10 +730,10 @@ public static List<OdcmProperty> 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<OdcmProperty>(); // default to empty list
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.3.1" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Mono.TextTemplating">
<Version>2.2.1</Version>
<Version>2.3.0</Version>
</PackageReference>
<PackageReference Include="NLog.Config">
<Version>4.7.15</Version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
</EntityType>
<EntityType Name="testType" BaseType="graph.entity">
<Property Name="propertyAlpha" Type="graph.derivedComplexTypeRequest" />
<Property Name="primitiveCollection" Type="Collection(Edm.String)" />
</EntityType>
<EnumType Name="enum1">
<Member Name="value0" Value="0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 15 additions & 0 deletions test/Typewriter.Test/TestDataObjC/Models/MSGraphTestType.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ @interface MSObject()
@interface MSGraphTestType()
{
MSGraphDerivedComplexTypeRequest* _propertyAlpha;
NSArray* _primitiveCollection;
}
@end

Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export interface Entity {
}
export interface TestType extends Entity {
propertyAlpha?: NullableOption<DerivedComplexTypeRequest>;
primitiveCollection?: NullableOption<string[]>;
}
export interface Print {
settings?: NullableOption<string>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface Entity {
}
export interface TestType extends Entity {
propertyAlpha?: NullableOption<DerivedComplexTypeRequest>;
primitiveCollection?: NullableOption<string[]>;
}
export interface Print {
settings?: NullableOption<string>;
Expand Down