nidi3 / raml-tester

Test if a request/response matches a given raml definition
Apache License 2.0
71 stars 14 forks source link

resource.getResolvedUriParameters() does not resolve params from ancestor above parent #28

Closed ghost closed 9 years ago

ghost commented 9 years ago

If getResolvedUriParameters is run on the resource child2 below, no parameters is returned. If it is run from child1, the id parameter is returned.

/{id}:
    uriParameters:
      id:
        type: integer
        required: true
        example: 7393
    /child1:
      /child2:
        get:
          responses:
            200:
              body:

It looks like this line:

Map<String, UriParameter> uriParams = new HashMap<String, UriParameter>(parentResource.getUriParameters());

Should be:

Map<String, UriParameter> uriParams = new HashMap<String, UriParameter>(parentResource.getResolvedUriParameters());
nidi3 commented 9 years ago

I absolutely agree, but this is code of the Resource class, which is part of the (https://github.com/raml-org/raml-java-parser) project.

ghost commented 9 years ago

Ah, ok.