Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: disallow unknown fields #6

Merged
merged 1 commit into from
Dec 25, 2024
Merged
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions MV64e.MTB/Mtb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1630,7 +1630,7 @@

public partial class Mtb
{
public static Mtb FromJson(string json) => JsonConvert.DeserializeObject<Mtb>(json, MV64e.MTB.Converter.Settings);

Check warning on line 1633 in MV64e.MTB/Mtb.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference return.
}

public static class Serialize
Expand All @@ -1644,6 +1644,7 @@
{
MetadataPropertyHandling = MetadataPropertyHandling.Ignore,
DateParseHandling = DateParseHandling.None,
MissingMemberHandling = MissingMemberHandling.Error,
Converters =
{
PatientTypeConverter.Singleton,
Expand Down Expand Up @@ -1689,7 +1690,7 @@

public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;

Check warning on line 1693 in MV64e.MTB/Mtb.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference return.
var value = serializer.Deserialize<string>(reader);
if (value == "Patient")
{
Expand Down Expand Up @@ -1723,7 +1724,7 @@

public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;

Check warning on line 1727 in MV64e.MTB/Mtb.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference return.
var value = serializer.Deserialize<string>(reader);
switch (value)
{
Expand Down Expand Up @@ -1774,7 +1775,7 @@

public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;

Check warning on line 1778 in MV64e.MTB/Mtb.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference return.
var value = serializer.Deserialize<string>(reader);
switch (value)
{
Expand Down Expand Up @@ -1850,7 +1851,7 @@

public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;

Check warning on line 1854 in MV64e.MTB/Mtb.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference return.
var value = serializer.Deserialize<string>(reader);
if (value == "https://pubmed.ncbi.nlm.nih.gov/")
{
Expand Down Expand Up @@ -1884,7 +1885,7 @@

public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;

Check warning on line 1888 in MV64e.MTB/Mtb.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference return.
var value = serializer.Deserialize<string>(reader);
switch (value)
{
Expand Down Expand Up @@ -1935,7 +1936,7 @@

public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;

Check warning on line 1939 in MV64e.MTB/Mtb.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference return.
var value = serializer.Deserialize<string>(reader);
if (value == "Claim")
{
Expand Down Expand Up @@ -1969,7 +1970,7 @@

public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;

Check warning on line 1973 in MV64e.MTB/Mtb.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference return.
var value = serializer.Deserialize<string>(reader);
switch (value)
{
Expand Down Expand Up @@ -2137,7 +2138,7 @@

public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;

Check warning on line 2141 in MV64e.MTB/Mtb.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference return.
var value = serializer.Deserialize<string>(reader);
switch (value)
{
Expand Down Expand Up @@ -3342,7 +3343,7 @@

public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;

Check warning on line 3346 in MV64e.MTB/Mtb.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference return.
var value = serializer.Deserialize<string>(reader);
switch (value)
{
Expand Down
Loading