Skip to content

Using parameterized types using Void resulting in invalid Swagger #1147

@nigelsim

Description

@nigelsim

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))) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions