Skip to content

Configuration Options

Kotz edited this page Mar 8, 2026 · 9 revisions

This page lists the options available for the --config/-c argument.
To use the options, just type them in sequence after the --config/-c argument, within quotation marks.

Example usage: json2sharp -i SomeFile.json -c "csharp class internal ntj set"

Supported Languages

Language Argument
C# cs or csharp (default)
Java java
Kotlin kt or kotlin
Python py or python

Language Options

C#

Language cs or csharp
Structure record (default)
class
struct
Accessibility public (default)
internal
protected
private
protectedinternal
privateprotected
Serialization Attribute stj or systemtextjson (default)
ntj or newtonsoft or newtonsoftjson
noatt or noattribute
Required Property required (default)
notrequired
Setter init (default)
set
Sealed sealed (default)
notsealed
Indentation Character space (default)
tab
Indentation Character Amount ind:4 (default - change the number to get more or less indentation)

Java

Language java
Structure record (default)
class
Serialization Annotation jackson (default)
gson
moshi
noann or noannotation
Nullability Annotation nonull or nonullability (default)
jakarta
jspecify
jetbrains
lombok
findbugs
Indentation Character space (default)
tab
Indentation Character Amount ind:4 (default - change the number to get more or less indentation)

Kotlin

Language kt or kotlin
Serialization Annotation kotlinx (default)
jackson
gson
moshi
noann or noannotation
Indentation Character space (default)
tab
Indentation Character Amount ind:4 (default - change the number to get more or less indentation)

Python

Language py or python
Structure dc or dataclass (default)
pyd or pydantic
class
Type Hints th or typehints (default)
nth or notypehints
Nullable Type Hints nopt or nopotional (default)
opt or optional
Indentation Character space (default)
tab
Indentation Character Amount ind:4 (default - change the number to get more or less indentation)

Clone this wiki locally