Skip to content

Missing version numbers in Java codegen #159

@workuser12345

Description

@workuser12345

The generated Java classes do not include the version numbers for any objects. I'm not sure if this is a bug or limitation of Java as a language.

Context

This is an example class of generated code

// this code is generated and should not be modified
package company.platform.example;

import com.fasterxml.jackson.annotation.*;

@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, property = "$class")
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
public class ExampleClass extends ParentClass {
   
   // the accessor for the identifying field
   public String getID() {
      return this.getId();
   }

}

Expected Behavior

The output I expect for the class value is

"${'$'}class": "[email protected]",

Actual Behavior

The actual value is

"${'$'}class": "company.platform.example.ExampleClass",

Possible Fix

Could this be a limitation of the Java language preventing the codegen from including version numbers?

Steps to Reproduce

  1. Generate Java code for any concerto concept.
  2. The generated code does not include version numbers for the generated concept.

Existing issues

Context

Because of this bug we have opted not to use concerto codegen. Injecting the version info manually using Jackson is complicated and removes a lot of the value of codegen.

Your Environment

  • Version used:
  • Environment name and version (e.g. Chrome 39, node.js 5.4):
  • Operating System and version (desktop or mobile):
  • Link to your project:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions