wuseal / JsonToKotlinClass

🚀 Plugin for Android Studio And IntelliJ Idea to generate Kotlin data class code from JSON text ( Json to Kotlin )
GNU General Public License v3.0
3.07k stars 174 forks source link

How to generate kotlin data classes from a json schema rather than a json data file? #423

Open KodyFernandes opened 7 months ago

KodyFernandes commented 7 months ago

How does one generate kotlin data classes from a json schema rather than a json data file? Is there a checkbox I'm missing to specify that the provided json is a schema rather than data? I see this feature mentioned in the README but when passing a json schema file to the plugin it treats the schema file like normal json data. The plugin generates schema specific fields (id, type, title, description, etc.) in the kotlin classes rather than the fields specified in the schema properties fields, etc.

wuseal commented 7 months ago

The plugin can auto determine the input is JSON or jsonschema by default depends on the content format