raml-java-parser
raml-java-parser copied to clipboard
Discriminator seems to be global in validation
When using this RAML
#%RAML 1.0
---
title: Test
types:
FooAction:
type: object
discriminator: action
properties:
action: string
FooTestAction:
type: FooAction
discriminatorValue: test
properties:
name: object
BarAction:
type: object
discriminator: action
properties:
action: string
BarTestAction:
type: FooAction
discriminatorValue: test
properties:
name: string
/bar:
post:
body:
application/json:
type: BarAction
example: |
{
"action": "test",
"name": "Test"
}
/foo:
post:
body:
application/json:
type: FooAction
example: |
{
"action": "test",
"name": {
"en": "Test"
}
}
I get this error "Error validating JSON. Error: - Invalid type String, expected Object -- test.raml [line=42, col=26]"
The parser seems not to take into account that a discriminator may only be valid for a specific type.
Aha! Link: https://mulesoft-roadmap.aha.io/features/APIRAML-98