Skip to content

Commit

Permalink
make more fields nullable to not throw serialization errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jtwotimes committed Aug 18, 2022
1 parent e2106ff commit 4ae5822
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 3.0.8
### Added
- Made property `PokemonSpecies.CaptureRate` and `PokemonSpecies.BaseHappiness` nullable

## 3.0.7
### Added
- Made property `Pokemon.BaseExperience` nullable: [#37](https://github.com/mtrdp642/PokeApiNet/pull/37)
Expand Down
6 changes: 3 additions & 3 deletions PokeApiNet/Models/Pokemon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2060,14 +2060,14 @@ public class PokemonSpecies : NamedApiResource
/// the catch.
/// </summary>
[JsonProperty("capture_rate")]
public int CaptureRate { get; set; }
public int? CaptureRate { get; set; }

/// <summary>
/// The happiness when caught by a normal Pokéball; up to 255. The higher
/// the number, the happier the Pokémon.
/// </summary>
[JsonProperty("base_happiness")]
public int BaseHappiness { get; set; }
public int? BaseHappiness { get; set; }

/// <summary>
/// Whether or not this is a baby Pokémon.
Expand All @@ -2093,7 +2093,7 @@ public class PokemonSpecies : NamedApiResource
/// Flame Body's.
/// </summary>
[JsonProperty("hatch_counter")]
public int HatchCounter { get; set; }
public int? HatchCounter { get; set; }

/// <summary>
/// Whether or not this Pokémon has visual gender differences.
Expand Down
2 changes: 1 addition & 1 deletion PokeApiNet/PokeApiNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>3.0.7</Version>
<Version>3.0.8</Version>
<Authors>JJ Banda</Authors>
<Company />
<Description>.Net client for the PokeAPI api</Description>
Expand Down

0 comments on commit 4ae5822

Please sign in to comment.