API Key Generator
Generate prefixed API keys in the format modern providers use.
Generate C# classes with System.Text.Json attributes from a JSON sample.
Leave them off if your serialiser is configured with a camelCase naming policy and the mapping is implicit.
The JSON to C# Class converter writes model classes with PascalCase properties, JsonPropertyName attributes carrying the original keys, List<T> collections and nullable value types wherever a field can be absent.
Paste a payload and get the model classes: PascalCase properties with getters and setters, a JsonPropertyName attribute carrying the original key, List<T> for arrays and a nested class for every nested object.
Optional fields are declared as nullable value types — long?, double?, bool?, DateTime? — so an absent key deserialises as null rather than silently becoming zero. Values that look like timestamps are typed as DateTime, numbers as long or double depending on whether a decimal point appears anywhere in the sample, and you can drop the attributes entirely if your serialiser is configured with a camelCase naming policy instead.
JsonPropertyName preserves the original JSON key, so PascalCase properties bind correctly however the API names its fields.
long?, double? and bool? are used where a key can be missing, so an absent number does not silently deserialise as zero.
Values in ISO 8601 form are typed as DateTime rather than string, which is what you actually want to work with.
Drop them entirely when your serialiser is configured with a camelCase naming policy and the mapping is implicit.
Swapping JsonPropertyName for JsonProperty and the using directive is all it takes if your project is on Newtonsoft.Json.
An array of records detects optional fields better than a single object.
Nested classes are named from the keys that contain them.
Keep JsonPropertyName for explicit mapping, or drop it if you use a naming policy.
Paste into a .cs file — the using directives are included.
The output targets System.Text.Json, the built-in serialiser since .NET Core 3.0. For Newtonsoft.Json, swap JsonPropertyName for JsonProperty and the using directive for Newtonsoft.Json — nothing else changes.
Because JSON numbers routinely exceed the 32-bit range — timestamps in milliseconds and database identifiers both do. Narrow to int by hand where you know the range is safe.
Because the field is missing from some records or appears as null. Without the question mark, a missing number would deserialise as 0, which is indistinguishable from a real zero.
Not here — classes with settable properties are what System.Text.Json binds to without extra configuration. Converting the output to a positional record afterwards is a mechanical change.
What people who use the JSON to C# Class think of it. Reviews come from visitors and are posted as written.
No ratings yet
Yours would be the first.
0 reviews
Newest first
No reviews yet
Be the first to rate the JSON to C# Class. It takes half a minute and no account.
Write the first reviewGenerate prefixed API keys in the format modern providers use.
Generate HMAC signatures with SHA-1, SHA-256, SHA-384 or SHA-512.
Normalise YAML indentation, quoting and key order in one pass.
Learn and generate flexbox layouts with a live, interactive preview.
Work out a subnet: network, broadcast, host range and usable count.
Build a valid package.json with scripts, exports and metadata.
Generate plausible addresses in the format each country actually uses.
Your browser, engine, platform, languages and what it supports.