Formatadores e Código
JSON para Classe C#
Generate POCO classes from a JSON sample.
Nota do editor
Understanding · Two libraries, one mental model.
Este capítulo aprofundado está disponível apenas em inglês no momento. A ferramenta de conversão acima funciona no seu idioma; o artigo explicativo longo ainda não foi traduzido.
Perguntas frequentes
Quick answers.
›How does the tool handle nested objects?
The generator recursively scans your JSON structure to create separate, linked classes for each nested object level. It ensures that complex hierarchies are mapped to a structured class model.
›What attributes are added to the classes?
The tool can include `[JsonPropertyName]` or `[JsonProperty]` attributes to ensure proper deserialization when JSON keys use different naming conventions than C# properties. This supports both System.Text.Json and Newtonsoft.Json libraries.
›How are data types determined?
It infers types based on the JSON values: integers become `int` or `long`, decimals become `double` or `decimal`, and ISO dates are mapped to `DateTime`. If a value is null, the tool defaults to `object` or a nullable type.
›Is my data sent to any external server?
No. The conversion logic is executed entirely within your web browser. Neither your JSON structure nor the resulting C# code is transmitted or stored on any server.
As pessoas também pesquisam por
Ferramentas relacionadas
More in this room.
- JSON para Interface TypeScriptInferir tipos de uma amostra JSON e emitir interfaces TS.
- JSON para Java POJOEmitir um Java POJO de uma amostra JSON.
- JSON para Python DataclassDataclasses tipadas (com Pydantic opcional) de JSON.
- JSON para Go StructStructs Go idiomáticas com tags `json:`.
- JSON para Kotlin Data ClassClasses de dados concisas para qualquer amostra JSON.
- JSON para JSON SchemaInferir um documento JSON Schema de uma amostra.