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

Generic Types (non-GenericWrapperTypes) #136

Open
ghost opened this issue Jun 9, 2016 · 2 comments
Open

Generic Types (non-GenericWrapperTypes) #136

ghost opened this issue Jun 9, 2016 · 2 comments

Comments

@ghost
Copy link

ghost commented Jun 9, 2016

Hello

in the ParserHelper you are generally using "qualifiedTypeName" which works fine except when i have something like this

    @GET
    @Path("bar")
    public Dto<Bar> bar() {
        return null;
    }

    @GET
    @Path("foo")
    public Dto<Foo> foo() {
        return null;
    }

which will result in

        {
            "path": "/api/bar",
            "operations": [
                {
                    "method": "GET",
                    "nickname": "bar",
                    "type": "Dto"
                }
            ]
        },
        {
            "path": "/api/foo",
            "operations": [
                {
                    "method": "GET",
                    "nickname": "foo",
                    "type": "Dto"
                }
            ]
        }

but what you actually want is something like this

        {
            "path": "/api/bar",
            "operations": [
                {
                    "method": "GET",
                    "nickname": "bar",
                    "type": "Dto<Bar>"
                }
            ]
        },
        {
            "path": "/api/foo",
            "operations": [
                {
                    "method": "GET",
                    "nickname": "foo",
                    "type": "Dto<Foo>"
                }
            ]
        }

Using the 'genericWrapperTypes' command line switch is not really an option, because it's not really a wrapper - it contains additional fields that need to be present in the documentation. So what i did as a workaround is returning 'type.ToString()' in 'ParserHelper.getQualifiedTypeName' which solves this problem, but breaks with the existing api, and also my implementation is more than ugly... Any suggestions before I try to clean my implementation (or feel free to do it yourselves:))?

cheers

@ghost
Copy link
Author

ghost commented Sep 20, 2016

duplicates #7

@ghost
Copy link
Author

ghost commented Oct 8, 2016

is also the same as conorroche#10

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

0 participants