Skip to content
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

Using parameterized types using Void resulting in invalid Swagger #1147

Closed
nigelsim opened this issue Jan 21, 2016 · 1 comment
Closed

Using parameterized types using Void resulting in invalid Swagger #1147

nigelsim opened this issue Jan 21, 2016 · 1 comment
Labels
Milestone

Comments

@nigelsim
Copy link

I have type Result<A, B> which is returned by many of my methods.

class Result<A,B> {
 A value;
 List<B> extra;
...
}

When Result<Void, Void> is returned the returned definition correctly removes the value property, but the extra property is specified as an array with no type.

Result«Void,Void»: {
    properties: {
        extra: {
            type: "array"
        }
    }
},

I tried adding an alternateTypeRule to map this to another class type that would have the correct signature, but this didn't result in the expected result. The type name changed in the definitions list, but not in the method signatures, and the properties of the original Result type were used, not the SimpleResult properties.

.alternateTypeRules(newRule(typeResolver.resolve(Result.class, Void.class, Void.class),
                        typeResolver.resolve(SimpleResult.class)))
@dilipkrish
Copy link
Member

It appears to be a bug.. the rendering of list of voids, that is. The alternate type rule should just work, not sure what the problem is there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants