mulesoft-labs / raml-for-jax-rs

This project is all about two way transformation of JAX-RS-annotated Java code to RAML API description and back.
Other
296 stars 181 forks source link

the cli does not handle relative path in JSON schema properly #406

Open kunli-mulesoft opened 5 years ago

kunli-mulesoft commented 5 years ago

Hello,

I am using the CLI to generate Java model from RAML. My RAML uses JSON schema to define the types. If the JSON schema internally has a reference to another JSON schema using a relative path, the CLI fails with an error: Exception in thread "main" java.lang.IllegalArgumentException: Unrecognised URI, can't resolve this: file:/var/folders/1y/z9h1wnd13n18fv9nbzvw8gwr7vx607/T/1562477156501-0/name.schema.json/definitions/name

If I replace the "$ref" value with the absolute file path it worked fine.

I am attaching a simplified version of my RAML + JSON schemas to reproduce this issue. I am on 3.0.5-SNAPSHOT version.

poc-json-schema.zip