Skip to content

Commit 32b1cba

Browse files
author
Michaël Catanzariti
committed
Imported attributes assembly from Dahomey.Json
1 parent 4c9c83d commit 32b1cba

15 files changed

+358
-1
lines changed

.github/workflows/Build.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Build and Test
2+
3+
on:
4+
push:
5+
paths:
6+
- 'src/**'
7+
- '.github/workflows/**'
8+
branches:
9+
- '**'
10+
tags-ignore:
11+
- '*.*.*'
12+
pull_request:
13+
paths:
14+
- 'src/**'
15+
- '.github/workflows/**'
16+
branches:
17+
- '**'
18+
tags-ignore:
19+
- '*.*.*'
20+
21+
jobs:
22+
build_and_test:
23+
24+
runs-on: ubuntu-latest
25+
26+
steps:
27+
- name: checkout
28+
uses: actions/checkout@v1
29+
30+
- name: setup .net core 3.1.415
31+
uses: actions/setup-dotnet@v1
32+
with:
33+
dotnet-version: 3.1.412
34+
35+
- name: setup .net core 5.0.403
36+
uses: actions/setup-dotnet@v1
37+
with:
38+
dotnet-version: 5.0.400
39+
40+
- name: setup .net core 6.0.100
41+
uses: actions/setup-dotnet@v1
42+
with:
43+
dotnet-version: 6.0.100
44+
45+
# workaround for using multiple dotnet core installs
46+
- name: setup multiple sdks
47+
run: |
48+
rsync -a ${DOTNET_ROOT/6.0.100/3.1.415}/* $DOTNET_ROOT/
49+
rsync -a ${DOTNET_ROOT/6.0.100/5.0.403}/* $DOTNET_ROOT/
50+
dotnet --info
51+
52+
- name: build
53+
run: dotnet build -c Release src/Dahomey.Json.Attributes

.github/workflows/Deploy.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Deploy to Nuget
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: checkout
14+
uses: actions/checkout@v1
15+
16+
- name: setup
17+
uses: actions/setup-dotnet@v1
18+
with:
19+
dotnet-version: 6.0.100
20+
21+
- name: build
22+
run: dotnet pack -p:Version=${GITHUB_REF##*/} -p:FileVersion=${GITHUB_REF##*/} -p:AssemblyVersion=${GITHUB_REF##*/} -c Release src/Dahomey.Json.Attributes
23+
24+
- name: deploy
25+
run: dotnet nuget push src/Dahomey.Json/bin/Release/Dahomey.Json.Attributes.${GITHUB_REF##*/}.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
26+

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# User-specific files
2+
*.suo
3+
*.user
4+
.vs
5+
6+
# Build output
7+
src/**/obj/
8+
src/**/bin/
9+

CODE_OF_CONDUCT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at . All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 Dahomey Technologies
3+
Copyright (c) 2019 Michael Catanzariti
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

src/Dahomey.Json.Attributes.sln

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.31903.59
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dahomey.Json.Attributes", "Dahomey.Json.Attributes\Dahomey.Json.Attributes.csproj", "{054681DB-CE4C-4B65-88B1-0592B0DCFB75}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{054681DB-CE4C-4B65-88B1-0592B0DCFB75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{054681DB-CE4C-4B65-88B1-0592B0DCFB75}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{054681DB-CE4C-4B65-88B1-0592B0DCFB75}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{054681DB-CE4C-4B65-88B1-0592B0DCFB75}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {7DA7D457-2F15-4901-962B-D33B9DAB33E7}
24+
EndGlobalSection
25+
EndGlobal
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFrameworks>netstandard2.0;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
5+
<LangVersion>10.0</LangVersion>
6+
<Nullable>enable</Nullable>
7+
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
8+
<PackageReleaseNotes>cf. https://github.com/dahomey-technologies/Dahomey.Json.Attributes/releases/tag/$(Version)</PackageReleaseNotes>
9+
<Authors>Michaël Catanzariti</Authors>
10+
<Company>Dahomey Technologies</Company>
11+
<Description>Attributes assembly for https://github.com/dahomey-technologies/Dahomey.Json</Description>
12+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
13+
<PackageProjectUrl>https://github.com/dahomey-technologies/Dahomey.Json.Attributes</PackageProjectUrl>
14+
<PackageTags>serialization;json</PackageTags>
15+
<RepositoryUrl>https://github.com/dahomey-technologies/Dahomey.Json.Attributes.git</RepositoryUrl>
16+
<RepositoryType>Git</RepositoryType>
17+
<PackageIcon>icon.png</PackageIcon>
18+
<Copyright>Copyright © Dahomey Technologies 2021</Copyright>
19+
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
20+
</PropertyGroup>
21+
22+
<PropertyGroup>
23+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
24+
</PropertyGroup>
25+
26+
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
27+
<PackageReference Include="System.Text.Json" Version="6.0.0" />
28+
<PackageReference Include="Nullable" Version="1.3.0">
29+
<PrivateAssets>all</PrivateAssets>
30+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
31+
</PackageReference>
32+
</ItemGroup>
33+
34+
<ItemGroup>
35+
<None Include="Images\icon.png" Pack="true" PackagePath="" />
36+
</ItemGroup>
37+
38+
</Project>
12 KB
Loading
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System;
2+
3+
namespace Dahomey.Json.Attributes
4+
{
5+
[AttributeUsage(AttributeTargets.Constructor)]
6+
public class JsonConstructorExAttribute : Attribute
7+
{
8+
/// <summary>JSON serialized member names of the corresponding parameters of the decorated constructor.</summary>
9+
public string[]? MemberNames { get; set; }
10+
11+
public JsonConstructorExAttribute()
12+
{
13+
}
14+
15+
public JsonConstructorExAttribute(params string[] memberNames)
16+
{
17+
MemberNames = memberNames;
18+
}
19+
}
20+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System;
2+
using System.Text.Json.Serialization;
3+
4+
namespace Dahomey.Json.Attributes
5+
{
6+
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
7+
public sealed class JsonDeserializeAttribute : JsonAttribute
8+
{
9+
}
10+
}

0 commit comments

Comments
 (0)