Skip to content

Commit 6592686

Browse files
authored
feat: deserialization of demographics, schema and servers for Open Data Contract (#192)
1 parent 52c27d3 commit 6592686

File tree

69 files changed

+2938
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+2938
-3
lines changed

Packata.sln

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{95E83BA6
1919
Dockerfile = Dockerfile
2020
github.ps1 = github.ps1
2121
GitVersion.yml = GitVersion.yml
22-
package.ps1 = package.ps1
2322
package-delta-schemas.ps1 = package-delta-schemas.ps1
23+
package.ps1 = package.ps1
2424
EndProjectSection
2525
EndProject
2626
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Project", "Project", "{09BDFA96-353F-419D-890A-D9B9045E66DD}"
@@ -55,6 +55,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Packata.Storages", "src\Pac
5555
EndProject
5656
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Packata.Storages.Testing", "src\Packata.Storages.Testing\Packata.Storages.Testing.csproj", "{CB16B305-A39F-23A9-FDCB-7996C42F2EC5}"
5757
EndProject
58+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Packata.OpenDataContract", "src\Packata.OpenDataContract\Packata.OpenDataContract.csproj", "{39148ED5-15AF-D57C-21AB-5F9E32745C7B}"
59+
EndProject
60+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Packata.OpenDataContract.Testing", "src\Packata.OpenDataContract.Testing\Packata.OpenDataContract.Testing.csproj", "{368904A6-1BC4-1886-185A-74268613406A}"
61+
EndProject
5862
Global
5963
GlobalSection(SolutionConfigurationPlatforms) = preSolution
6064
Debug|Any CPU = Debug|Any CPU
@@ -93,6 +97,14 @@ Global
9397
{CB16B305-A39F-23A9-FDCB-7996C42F2EC5}.Debug|Any CPU.Build.0 = Debug|Any CPU
9498
{CB16B305-A39F-23A9-FDCB-7996C42F2EC5}.Release|Any CPU.ActiveCfg = Release|Any CPU
9599
{CB16B305-A39F-23A9-FDCB-7996C42F2EC5}.Release|Any CPU.Build.0 = Release|Any CPU
100+
{39148ED5-15AF-D57C-21AB-5F9E32745C7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
101+
{39148ED5-15AF-D57C-21AB-5F9E32745C7B}.Debug|Any CPU.Build.0 = Debug|Any CPU
102+
{39148ED5-15AF-D57C-21AB-5F9E32745C7B}.Release|Any CPU.ActiveCfg = Release|Any CPU
103+
{39148ED5-15AF-D57C-21AB-5F9E32745C7B}.Release|Any CPU.Build.0 = Release|Any CPU
104+
{368904A6-1BC4-1886-185A-74268613406A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
105+
{368904A6-1BC4-1886-185A-74268613406A}.Debug|Any CPU.Build.0 = Debug|Any CPU
106+
{368904A6-1BC4-1886-185A-74268613406A}.Release|Any CPU.ActiveCfg = Release|Any CPU
107+
{368904A6-1BC4-1886-185A-74268613406A}.Release|Any CPU.Build.0 = Release|Any CPU
96108
EndGlobalSection
97109
GlobalSection(SolutionProperties) = preSolution
98110
HideSolutionNode = FALSE

appveyor.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ test_script:
6060
$globalTestResult += $LastExitCode
6161
dotnet test src/Packata.Storages.Testing -c Release /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[Packata.*.Testing]*" /p:CoverletOutput=../../.coverage/coverage.Packata.Storages.xml --test-adapter-path:. --logger:Appveyor --no-build --nologo
6262
$globalTestResult += $LastExitCode
63+
dotnet test src/Packata.OpenDataContract.Testing -c Release /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[Packata.*.Testing]*" /p:CoverletOutput=../../.coverage/coverage.Packata.OpenDataContract.xml --test-adapter-path:. --logger:Appveyor --no-build --nologo
64+
$globalTestResult += $LastExitCode
6365
if($globalTestResult -ne 0) { $host.SetShouldExit($globalTestResult) }
6466
6567
- pwsh: |
@@ -74,6 +76,7 @@ after_test:
7476
- dotnet pack src/Packata.ResourceReaders -p:version="%GitVersion_SemVer%" -c Release --include-symbols --no-build --nologo
7577
- dotnet pack src/Packata.Provisioners -p:version="%GitVersion_SemVer%" -c Release --include-symbols --no-build --nologo
7678
- dotnet pack src/Packata.Storages -p:version="%GitVersion_SemVer%" -c Release --include-symbols --no-build --nologo
79+
- dotnet pack src/Packata.OpenDataContract -p:version="%GitVersion_SemVer%" -c Release --include-symbols --no-build --nologo
7780

7881
artifacts:
7982
- path: '**\*.nupkg'

src/Packata.Core.Testing/Serialization/BaseDataPackageSerializerTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ public void Deserialize_WithKeys_ReturnsKeys()
272272
}
273273
}
274274

275-
276275
[Test]
277276
public void Deserialize_EmbeddedFile_CorrectPackageInfo()
278277
{

src/Packata.Core/LabelAttribute.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace Packata.Core;
8+
9+
[AttributeUsage(AttributeTargets.Property, Inherited = false, AllowMultiple = false)]
10+
public sealed class LabelAttribute : Attribute
11+
{
12+
/// <summary>
13+
/// Get the UI label for the property.
14+
/// </summary>
15+
public string Label { get; }
16+
/// <summary>
17+
/// Initializes a new instance of the <see cref="LabelAttribute"/> class with the specified label.
18+
/// </summary>
19+
/// <param name="label">The label for the property.</param>
20+
public LabelAttribute(string label)
21+
{
22+
Label = label;
23+
}
24+
}

src/Packata.Core/Serialization/Yaml/ITypeDiscriminator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using YamlDotNet.Serialization.BufferedDeserialization;
77

88
namespace Packata.Core.Serialization.Yaml;
9-
internal interface ITypeDiscriminator
9+
public interface ITypeDiscriminator
1010
{
1111
void Execute(ITypeDiscriminatingNodeDeserializerOptions options);
1212
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<ItemGroup>
3+
<None Remove="Serialization\Yaml\Resources\all-data-types.odcs.yaml" />
4+
</ItemGroup>
5+
<ItemGroup>
6+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
7+
<PackageReference Include="Moq" Version="4.20.72" />
8+
<PackageReference Include="NUnit" Version="4.3.2" />
9+
<PackageReference Include="NUnit.Analyzers" Version="4.8.1">
10+
<PrivateAssets>all</PrivateAssets>
11+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
12+
</PackageReference>
13+
<PackageReference Include="NUnit3TestAdapter" Version="5.0.0" />
14+
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
15+
</ItemGroup>
16+
<ItemGroup>
17+
<PackageReference Include="coverlet.msbuild" Version="6.0.4">
18+
<PrivateAssets>all</PrivateAssets>
19+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
20+
</PackageReference>
21+
<PackageReference Include="coverlet.collector" Version="6.0.4">
22+
<PrivateAssets>all</PrivateAssets>
23+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
24+
</PackageReference>
25+
</ItemGroup>
26+
<ItemGroup>
27+
<PackageReference Update="DotNet.ReproducibleBuilds" Version="1.2.25">
28+
<PrivateAssets>all</PrivateAssets>
29+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
30+
</PackageReference>
31+
</ItemGroup>
32+
<ItemGroup>
33+
<ProjectReference Include="..\Packata.Core\Packata.Core.csproj" />
34+
<ProjectReference Include="..\Packata.OpenDataContract\Packata.OpenDataContract.csproj" />
35+
</ItemGroup>
36+
<ItemGroup>
37+
<EmbeddedResource Include="Serialization\Yaml\Resources\kafka-schema.odcs.yaml" />
38+
<EmbeddedResource Include="Serialization\Yaml\Resources\table-column-description.odcs.yaml" />
39+
<EmbeddedResource Include="Serialization\Yaml\Resources\table-columns-with-partition.odcs.yaml" />
40+
<EmbeddedResource Include="Serialization\Yaml\Resources\kafka-server.odcs.yaml" />
41+
<EmbeddedResource Include="Serialization\Yaml\Resources\kafka-schemaregistry.odcs.yaml" />
42+
<EmbeddedResource Include="Serialization\Yaml\Resources\all-data-types.odcs.yaml" />
43+
</ItemGroup>
44+
</Project>

0 commit comments

Comments
 (0)