You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.
Hi, this parser seems incapable of handling the union of user-defined types. I've compiled an example of the problem into this zip.
Inside it, the files are organized as:
The API definition in api.raml uses the types.lib.raml library, which references both type files, a.type.raml and b.type.raml, defining typeA and typeB, respectively. One of the properties of typeA is an array is an array made of strings or typeB's (both may be in the array at the same time).
When validating (passing the directory as the argument) with the latest version, 1.0.26-SNAPSHOT, I get the following output:
$ java -jar raml-java-parser/raml-parser-2/target/raml-parser-2-1.0.26-SNAPSHOT-full.jar sample_api
========================================================================================================================
sample_api\api.raml
========================================================================================================================
1 error found:
- Invalid type expression syntax: "string | !include b.type.raml". Caused by : Library references cannot be chained: !includeb.type.raml at character : 126 [line=0, col=0]
========================================================================================================================
sample_api\types\a.type.raml
========================================================================================================================
1 error found:
- Invalid type expression syntax: "string | !include b.type.raml". Caused by : Library references cannot be chained: !includeb.type.raml at character : 126 [line=0, col=0]
========================================================================================================================
sample_api\types\b.type.raml
========================================================================================================================
No errors found.
========================================================================================================================
sample_api\types\types.lib.raml
========================================================================================================================
1 error found:
- Invalid type expression syntax: "string | !include b.type.raml". Caused by : Library references cannot be chained: !includeb.type.raml at character : 126 [line=0, col=0]
==================================================
Parsed 4 raml files. 1 OK, 3 with Errors.
==================================================
Since the error description mentions libraries, I tried removing them altogether and !include'ing the types manually. This was the result:
========================================================================================================================
sample_api\api.raml
========================================================================================================================
1 error found:
- Invalid type expression syntax: "string | !include b.type.raml". Caused by : Library references cannot be chained: !includeb.type.raml at character : 126 [line=0, col=0]
========================================================================================================================
sample_api\types\a.type.raml
========================================================================================================================
1 error found:
- Invalid type expression syntax: "string | !include b.type.raml". Caused by : Library references cannot be chained: !includeb.type.raml at character : 126 [line=0, col=0]
========================================================================================================================
sample_api\types\b.type.raml
========================================================================================================================
No errors found.
==================================================
Parsed 3 raml files. 1 OK, 2 with Errors.
==================================================
I've looked into the Union Type section of the specification and couldn't find anything preventing the union of user defined DataTypes. Is this a limitation of the parser, or just something I'm not seeing in the spec?
Hi, this parser seems incapable of handling the union of user-defined types. I've compiled an example of the problem into this zip.
Inside it, the files are organized as:
The API definition in
api.raml
uses thetypes.lib.raml
library, which references both type files,a.type.raml
andb.type.raml
, definingtypeA
andtypeB
, respectively. One of the properties oftypeA
is an array is an array made ofstrings
ortypeB
's (both may be in the array at the same time).When validating (passing the directory as the argument) with the latest version,
1.0.26-SNAPSHOT
, I get the following output:Since the error description mentions libraries, I tried removing them altogether and
!include
'ing the types manually. This was the result:I've looked into the Union Type section of the specification and couldn't find anything preventing the union of user defined DataTypes. Is this a limitation of the parser, or just something I'm not seeing in the spec?
Thanks in advance.
Aha! Link: https://mulesoft-roadmap.aha.io/features/APIRAML-54
The text was updated successfully, but these errors were encountered: