Skip to content

support for inheritance in code generation #810

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ialmetwally opened this issue May 29, 2015 · 1 comment
Closed

support for inheritance in code generation #810

ialmetwally opened this issue May 29, 2015 · 1 comment

Comments

@ialmetwally
Copy link

Is there any way to support inheritance in code generation? like specifying the parent/base model in the JSON schema?

The only resource I found about this issue was this discussions https://gist.github.com/leedm777/5730877 and it doesn't seem to be implemented yet!

I need to generate the following Java models from the below JSON schema

public class Bar {
  String a;
  String b;
}

public calls Foo extends Bar {
  String c;
  String d;
  String e;
}
{
  "Bar": {
    "properties": {
      "a": {
        "type": "string"
      },
      "b": {
        "type": "string"
      }
    }
  },
  "Foo": {
    "properties": {
      "c": {
        "type": "string"
      },
      "d": {
        "type": "string"
      },
      "e": {
        "type": "string"
      }
    },
    "parent": "Bar"
  }
}

@webron
Copy link
Contributor

webron commented May 29, 2015

If you look at the examples under the Schema Object you'll see how inheritance and composition is defined.

The support for it is not yet included, but please follow #358 for integration.

@webron webron closed this as completed May 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants