techjourneyman
techjourneyman

Reputation: 1813

RAML generic types

Does RAML (or a RAML code generator) support generating generic types? I tried few things but none seem to work.

I am trying to generate a generic type something like this:

class Envelop<T> {
  SomeType x;
  AnotherType y;
  T z;
}

We are using the com.phoenixnap.oss Maven plugin to generate the classes. It does not appear to support generics either.

Upvotes: 1

Views: 353

Answers (1)

techjourneyman
techjourneyman

Reputation: 1813

Looks like it is not possible to have generics in RAML, not at least with the phoenix code generator (I would be interested in learning if it is possible in some other way).

However, it is possible to do achieve the same using good old inheritance. Something like this...

class Envelop {
  SomeType x;
  AnotherType y;
  SuperType z;
}

class BaseTypeA extends SuperType {
}

class BaseTypeB extends SuperType {
}

Upvotes: 1

Related Questions