Skip to content

Commit

Permalink
[ci-skip] Change example in the library readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaoticz committed May 22, 2024
1 parent 9b2ff80 commit 4837715
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Json2SharpLib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Json2SharpOptions options = new()
CSharpOptions = new()
{
IsSealed = false,
TargetType = CSharpObjectType.Record,
TargetType = CSharpObjectType.Class,
SerializationAttribute = CSharpSerializationAttribute.NewtonsoftJson
}
};
Expand All @@ -38,10 +38,14 @@ string code = Json2Sharp.Parse(className, rawJson, options);
/*
* using Newtonsoft.Json;
*
* public record Person(
* [JsonProperty("id")] int Id,
* [JsonProperty("name")] string Name
* );
* public sealed class Person
* {
* [JsonProperty("id")]
* public int Id { get; init; }
*
* [JsonProperty("name")]
* public string Name { get; init; }
* }
*/
```

Expand Down

0 comments on commit 4837715

Please sign in to comment.