light-codegen icon indicating copy to clipboard operation
light-codegen copied to clipboard

setting serializableModel to true to implement serilizable for modal classes not working

Open SureshTak opened this issue 5 years ago • 2 comments

In the config Json, I added serializableModel: true but still classes are not generating with implement serializable. Is there any additional setting need to be done to have all classes implement Serializable interface.

{
  "name": "hello",
  "version": "0.1.0",
  "groupId": "com.hello",
  "artifactId": "0.1.0",
  "rootPackage": "com.networknt.eventuate.account.command",
  "handlerPackage":"com.networknt.eventuate.account.command.handler",
  "modelPackage":"com.hello",
  "serializableModel": true,
  "overwriteHandler": true,
  "overwriteHandlerTest": true,
  "overwriteModel": true,
  "httpPort": 8080,
  "enableHttp": false,
  "httpsPort": 8443,
  "enableHttps": false,
  "enableRegistry": false,
  "supportOracle": false,
  "supportMysql": false,
  "supportPostgresql": false,
  "supportH2ForTest": false,
  "supportClient": false
}

SureshTak avatar Nov 18 '21 19:11 SureshTak

I tried with latest fat jar codejen-cli.jar to see if it will resolve the issue but it with latest fat jar ,getting following error.

Invalid framework: swagger
avaliable frameworks:
        light-hybrid-4j-server
        light-graphql-4j
        openapi
        light-hybrid-4j-service
        openapi-spec
        openapikotlin

SureshTak avatar Nov 18 '21 20:11 SureshTak

@SureshTak The swagger framework is removed as we only support OpenAPI 3.0 specification for codegen now. There are online tools to convert swagger spec to openapi spec.

For your first question, serializable is not supported for the POJO generation. We need to add this into the support if it is needed. From my experience, we don't need this interface unless we are still trying to build a Java EE application. What is your use case?

stevehu avatar Nov 24 '21 20:11 stevehu