Skip to content

Invalid test for generics #84

Description

@izogfif

In annotations/src/test/testcases/org/leandreck/endpoints/generics/Endpoint.gstring contains code snippet:

    @RequestMapping(value = "/boundType/{value}", method = GET, produces = MediaType.APPLICATION_JSON_VALUE)
    public $boundType echoBoundType(@RequestParam $boundType value) {
        return value;
    }

Here {value} part of @RequestMapping corresponds to @PathVariable, not @RequestParam. Corrected version should look like this:

    @RequestMapping(value = "/boundType/{value}", method = GET, produces = MediaType.APPLICATION_JSON_VALUE)
    public $boundType echoBoundType(@PathVariable("value") $boundType value) {
        return value;
    }

Also, don't forget to change

import org.springframework.web.bind.annotation.RequestParam;

to

import org.springframework.web.bind.annotation.PathVariable;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions