raml-org / raml-java-parser

(deprecated) A RAML parser based on SnakeYAML written in Java
Other
174 stars 121 forks source link

Surrogate characters are not supported #79

Open mkrup opened 9 years ago

mkrup commented 9 years ago

Issue: Validation fails for RAML documents that contain surrogate chars (e.g. '𠿿').

Investigation: Raml-java-parser uses the 'org.yaml.snakeyaml.reader.StreamReader.checkPrintable()' method for validation of RAML documents. This method works with chars from a String representation of a RAML document. A surrogate character from the example is represented by a pair of chars: uD843 and uDFFF (https://docs.oracle.com/javase/6/docs/api/java/lang/Character.html). Looks like StreamReader.checkPrintable() doesn't support the case and checks each of these two chars as a separate char. That's why the check fails.

Example of RAML file:

#%RAML 0.8
title: simpleapi
version: 1.0
baseUri: /test1/test2/api1
protocols: [HTTPS]
/test:
  displayName: test𠿿
  get:
    protocols: [HTTPS]

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

asomov commented 8 years ago

Can you please report this in SnakeYAML ?