🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

jsoncodegen-generator-kotlin-jackson

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsoncodegen-generator-kotlin-jackson

jsoncodegen JSON to Kotlin code generator for Jackson.

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

generator-kotlin-jackson

jsoncodegen JSON to Kotlin code generator for Jackson.

Generates Kotlin data classes from jsoncodegen interfaces. They can be instantiated like this:

val myObject = MyObject(
  name = "Budapest",
  flag = true,
  count = 3.0
)

Number is mapped to Double.

Enums are mapped to Kotlin enums, arrays to Lists, maps will become Maps.

Install

npm i -D jsoncodegen-generator-kotlin-jackson

Use

Remember to use com.fasterxml.jackson.module.kotlin.jacksonObjectMapper rather than the regular ObjectMapper.

Configure

Configuration can be put in jsoncodegen-generator-kotlin-jackson.config.js and passed to jsoncodegen in the config parameter:

jsoncodegen --generator java-jackson --config jsoncodegen-generator-kotlin-jackson.config.js ...

jsoncodegen-generator-kotlin-jackson.config.js

module.exports = {
  package: 'com.example'
}

package?: string

The name of the target package. All generated classes will be in this package. Example: "com.example"

License

MIT

History

1.0.0 Initial version.

FAQs

Package last updated on 09 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts