ServiceStack.Java Class is missing from the generated code

Hello,

I found a new issue where the JavaGenerator does not generate a specific class when I’m excluding a request. I can reproduce the issue like this:

  • Create SomeClass class
  • Create Class1 class (request) that implements IReturn<SomeClass>
  • Create Class2 class (request) that has a property of type SomeClass
  • Implement the service as usual
  • Exclude the Class1 using the option ExcludeTypes

The generated code will only include Class2 with a property of type SomeClass but the SomeClass will not be present in the file. I was able to reproduce this problem with the Swift generator as well.

Below is the code I used to reproduce the issue.

Requests:
    public class Class1 : IReturn<SomeClass>
    {
    }
    public class Class2 : IReturn<string>
    {
        public SomeClass Classy { get; set; }
    }

    public class SomeClass
    {
        public string SomeValue { get; set; }
    }

Service:
        public SomeClass Any(Class1 request)
        {
            return new SomeClass();
        }
        public String Any(Class2 request)
        {
            return "Hello!";
        }

The problem also occurs if SomeClass is nested.


    public class Class3 : IReturn<SomeOtherClass>
    {
        public SomeOtherClass OtherClassy { get; set; }
    }

    public class SomeOtherClass
    {
        public SomeClass Classy { get; set; }
    }

I’ve raised an issue with some reproduction steps and I’ll have a look into the generator.

Issue can be tracked here.