raml-java-parser icon indicating copy to clipboard operation
raml-java-parser copied to clipboard

URI parameter of type file

Open quilicicf opened this issue 9 years ago • 1 comments

Affects: 1.0.0

Issue

URI parameters should never be of type file unless I'm mistaken.

How to reproduce

RAML file

#%RAML 1.0

title: My API title
/fileInUriParam/{file}:
  uriParameters:
    file: file

Java file

package com.restlet.definitions.raml10.reader;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.raml.v2.api.RamlModelBuilder;
import org.raml.v2.api.RamlModelResult;
import org.raml.v2.api.model.v10.api.Api;

import static org.junit.Assert.fail;

public class Test {

    @org.junit.Test
    public void test() throws Exception {
        String savedRamlLocation = Test.class.getResource("fileName").toString();
        RamlModelResult ramlModelResult = new RamlModelBuilder().buildApi(savedRamlLocation);
        if (ramlModelResult.hasErrors()) {
            return;
        }

        fail("Should not pass parser validation");
    }
}

Aha! Link: https://mulesoft-roadmap.aha.io/features/APIRAML-121

quilicicf avatar Aug 19 '16 08:08 quilicicf

That may also hold true for headers and query parameters ?

quilicicf avatar Aug 22 '16 09:08 quilicicf