diff --git a/src/kotlin/StandardKotlinImports.ts b/src/kotlin/StandardKotlinImports.ts index eaea54f..5edcd1e 100644 --- a/src/kotlin/StandardKotlinImports.ts +++ b/src/kotlin/StandardKotlinImports.ts @@ -14,5 +14,10 @@ export const StandardKotlinImportList = [ `import kotlinx.serialization.json.jsonObject`, ]; -export const StarKotlinImport = "import kotlinx.serialization.*"; +export const StarKotlinImportList = [ + "import kotlinx.serialization.*", + "import kotlinx.serialization.json.*", +]; + +export const StarKotlinImports = StarKotlinImportList.join("\n"); export const StandardKotlinImports = StandardKotlinImportList.join("\n"); diff --git a/src/martok/Martok.ts b/src/martok/Martok.ts index 1378091..c019dce 100644 --- a/src/martok/Martok.ts +++ b/src/martok/Martok.ts @@ -5,7 +5,7 @@ import _ from "lodash"; import { TsHelper } from "../typescript/TsHelper"; import { StandardKotlinImportList, - StarKotlinImport, + StarKotlinImportList, } from "../kotlin/StandardKotlinImports"; import { ImportGenerator } from "./ImportGenerator"; import { DeclarationGenerator } from "./declarations/DeclarationGenerator"; @@ -167,7 +167,7 @@ export class Martok { package: `package ${pkg}`, imports: [ ...(this.config.options?.importStar - ? [StarKotlinImport] + ? StarKotlinImportList : StandardKotlinImportList), ], declarations: [], diff --git a/src/martok/MartokFormatter.ts b/src/martok/MartokFormatter.ts index e7b75c0..b100b27 100644 --- a/src/martok/MartokFormatter.ts +++ b/src/martok/MartokFormatter.ts @@ -1,7 +1,8 @@ import { MartokOutFile } from "./MartokOutFile"; import { StandardKotlinImports, - StarKotlinImport, + StarKotlinImportList, + StarKotlinImports, } from "../kotlin/StandardKotlinImports"; import { MartokConfig } from "./MartokConfig"; import { KlassPrinter } from "../kotlin/KlassPrinter"; @@ -27,7 +28,7 @@ ${file.text.declarations return `${StandardFileHeader} package ${this.config.package} -${this.config.options?.importStar ? StarKotlinImport : StandardKotlinImports} +${this.config.options?.importStar ? StarKotlinImports : StandardKotlinImports} ${files .flatMap((value) =>