Skip to content

Latest commit

 

History

History
39 lines (36 loc) · 1.04 KB

README.md

File metadata and controls

39 lines (36 loc) · 1.04 KB

User customization of language SDKs

Add a custom codegen

  • if you want to add a kotlin codegen
  • Add custom File
    • src/main/kotlin/caver/sdk/KlaytnKotlinClientCodegen.kt
  • Extend KotlinClientCodegen class
    class KlaytnKotlinClientCodegen : KotlinClientCodegen
  • Add META-INF.services resource
    • Edit src/main/resources/META-INF.services
      caver.kotlin.KlaytnKotlinClientCodegen
      
  • Add Test Case
    • Add src/test/kotlin/caver/sdk/KlaytnKotlinClientCodegenTest.kt
    • Add Test for ServiceLoader
    val loader = ServiceLoader.load(
      CodegenConfig::class.java,
      CodegenConfig::class.java.classLoader
    )

deploy

./gradlew clean :deployJar
./gradlew cleanTest :test

Test

  • Using the kotest
  • Using Behavior Spec
  • locate an index.html and report files in build/reports/test

Jar file

  • Generate jar include a customized code generator class
  • This jar file include openapi-generator-cli.jar
  • Generate a caver-openapi-generator-cli.jar and locate in bin/libs directory