raml-java-parser
raml-java-parser copied to clipboard
Should primitive types be allowed in web forms ?
Affects: 1.0.0
Issue
As far as I know, web forms always contain named parameters. Having a web form with a primitive type does not seem to make sense and I was expecting the parser to fail in that case.
Isn't that right ?
How to reproduce
RAML file
#%RAML 1.0
title: My API title
/unsupported:
put:
body:
multipart/form-data:
type: string
Java file
package com.restlet.definitions.raml10.reader;
import org.raml.v2.api.RamlModelBuilder;
import org.raml.v2.api.RamlModelResult;
import static org.junit.Assert.fail;
public class Test {
@org.junit.Test
public void test() throws Exception {
String savedRamlLocation = Test.class.getResource("files/fileName.yaml").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-118