Skip to content

Commit

Permalink
Merge pull request #229 from contentful/fix-strong-typing-for-data
Browse files Browse the repository at this point in the history
Fix strong typing for data
  • Loading branch information
Roblinde authored Mar 13, 2021
2 parents 84e756b + 7f81d3f commit c4b7282
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 20 deletions.
8 changes: 4 additions & 4 deletions Contentful.AspNetCore/Contentful.AspNetCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
<PackageProjectUrl>https://github.com/contentful/contentful.net</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryType>git</RepositoryType>
<Version>6.0.2</Version>
<AssemblyVersion>6.0.2.0</AssemblyVersion>
<Version>6.0.3</Version>
<AssemblyVersion>6.0.3.0</AssemblyVersion>
<RepositoryUrl>https://github.com/contentful/contentful.net</RepositoryUrl>
<FileVersion>6.0.2.0</FileVersion>
<FileVersion>6.0.3.0</FileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>bin\Release\netstandard1.5\Contentful.AspNetCore.xml</DocumentationFile>
Expand All @@ -25,7 +25,7 @@
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="contentful.csharp" Version="6.0.2" />
<PackageReference Include="contentful.csharp" Version="6.0.3" />
<PackageReference Include="gitlink" Version="3.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
Expand Down
6 changes: 3 additions & 3 deletions Contentful.Core/Contentful.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<AssemblyVersion>6.0.2.0</AssemblyVersion>
<FileVersion>6.0.2.0</FileVersion>
<Version>6.0.2</Version>
<AssemblyVersion>6.0.3.0</AssemblyVersion>
<FileVersion>6.0.3.0</FileVersion>
<Version>6.0.3</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="gitlink" Version="3.1.0">
Expand Down
37 changes: 24 additions & 13 deletions Contentful.Core/Models/AuthoringModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class Document
/// <summary>
/// The additional data of the node.
/// </summary>
public object Data { get; set; }
public GenericStructureData Data { get; set; }

/// <summary>
/// The list of content this document contains.
Expand All @@ -40,7 +40,7 @@ public class Text : IContent
/// <summary>
/// The additional data of the node.
/// </summary>
public object Data { get; set; }
public GenericStructureData Data { get; set; }

/// <summary>
/// The textual value.
Expand Down Expand Up @@ -114,7 +114,7 @@ public class Paragraph : IContent
/// <summary>
/// The additional data of the node.
/// </summary>
public object Data { get; set; }
public GenericStructureData Data { get; set; }

/// <summary>
/// The list of content this paragraph contains.
Expand All @@ -135,7 +135,7 @@ public class Heading1 : IContent, IHeading
/// <summary>
/// The additional data of the node.
/// </summary>
public object Data { get; set; }
public GenericStructureData Data { get; set; }

/// <summary>
/// The list of content this heading contains.
Expand All @@ -156,7 +156,7 @@ public class Heading2 : IContent, IHeading
/// <summary>
/// The additional data of the node.
/// </summary>
public object Data { get; set; }
public GenericStructureData Data { get; set; }

/// <summary>
/// The list of content this heading contains.
Expand All @@ -177,7 +177,7 @@ public class Heading3 : IContent, IHeading
/// <summary>
/// The additional data of the node.
/// </summary>
public object Data { get; set; }
public GenericStructureData Data { get; set; }

/// <summary>
/// The list of content this heading contains.
Expand All @@ -198,7 +198,7 @@ public class Heading4 : IContent, IHeading
/// <summary>
/// The additional data of the node.
/// </summary>
public object Data { get; set; }
public GenericStructureData Data { get; set; }

/// <summary>
/// The list of content this heading contains.
Expand All @@ -219,7 +219,7 @@ public class Heading5 : IContent, IHeading
/// <summary>
/// The additional data of the node.
/// </summary>
public object Data { get; set; }
public GenericStructureData Data { get; set; }

/// <summary>
/// The list of content this heading contains.
Expand All @@ -240,7 +240,7 @@ public class Heading6 : IContent, IHeading
/// <summary>
/// The additional data of the node.
/// </summary>
public object Data { get; set; }
public GenericStructureData Data { get; set; }

/// <summary>
/// The list of content this heading contains.
Expand Down Expand Up @@ -288,7 +288,7 @@ public class List : IContent
/// <summary>
/// The additional data of the node.
/// </summary>
public object Data { get; set; }
public GenericStructureData Data { get; set; }

/// <summary>
/// The list of content this paragraph contains.
Expand All @@ -309,7 +309,7 @@ public class ListItem : IContent
/// <summary>
/// The additional data of the node.
/// </summary>
public object Data { get; set; }
public GenericStructureData Data { get; set; }

/// <summary>
/// The list of content this paragraph contains.
Expand All @@ -330,7 +330,7 @@ public class Quote : IContent
/// <summary>
/// The additional data of the node.
/// </summary>
public object Data { get; set; }
public GenericStructureData Data { get; set; }

/// <summary>
/// The list of content this paragraph contains.
Expand All @@ -351,7 +351,7 @@ public class HorizontalRuler : IContent
/// <summary>
/// The additional data of the node.
/// </summary>
public object Data { get; set; }
public GenericStructureData Data { get; set; }
}

/// <summary>
Expand Down Expand Up @@ -418,6 +418,17 @@ public class EntryStructureData
public IContent Target { get; set; }
}

/// <summary>
/// Represents the data property of the generic node tpes
/// </summary>
public class GenericStructureData
{
/// <summary>
/// The entry this hyperlink targets
/// </summary>
public object Target { get; set; }
}

/// <summary>
/// Represents an hyperlink to an asset.
/// </summary>
Expand Down

0 comments on commit c4b7282

Please sign in to comment.