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

Byte Order Mark (BOM) not handled

Open gardea opened this issue 11 years ago • 2 comments

Consider this:

#%RAML 0.8
title: BOM bombs
version: v1
schemas:
  - NotNice: !include NotASchema.json 
/test:
  get: 
    responses: 
      200:
        body: 
          application/json: 
            schema: NotNice

The binary view of NotASchema.json is shown below:

raml-bomissue

The validation code:

RamlValidationService svc = RamlValidationService.createDefault();
...
results = svc.validate(raml, location);

The error:

bomissueerror

Removing the BOM from the file fixes the problem.

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

gardea avatar Sep 22 '14 14:09 gardea

this issue was addressed by 09162cb757f651e836f6a1d1a936516cb484593a you can give it a try with 0.8.8 release or latest 0.9-SNAPSHOT

svacas avatar Sep 25 '14 20:09 svacas

I just tried it with the latest 0.9-SNAPSHOT and it still complains about the BOM. In another test case, I've simply saved sequence-trait.yaml with a BOM, I've opened the include-sequence.yaml (these are files from the test package) and I get an error message (saying the paged trait cannot be found, which it would be because BOM + paged comes as a different key).

gardea avatar Sep 26 '14 01:09 gardea