Your issue may already be reported! Please search on Github issues before creating one.
When a RAML file references a RAML library with types that use invalid anntations, those are not validated by RAML validator. However, they are validated when the RAML library is validated directly.
- If the current behavior is a bug, please provide the minimal steps to reproduce with AMF code. Please don't upload AMF code mixed with yours.
Consider the following RAML files:
root.raml
#%RAML 1.0 Library
uses:
lib: lib.raml
lib.raml
#%RAML 1.0 Library
types:
MyType:
(invalid_annotation): test
And the following code in TypeScript:
import amf from 'amf-client-js'
(async () => {
const client = amf.RAMLConfiguration.RAML10().baseUnitClient()
let res = await client.parseLibrary("file://root.raml")
console.log(res.conforms) // OK: true
let validation = await client.validate(res.baseUnit)
console.log(validation.conforms) // Not OK: true
res = await client.parseLibrary("file://lib.raml")
console.log(res.conforms) // OK: true
validation = await client.validate(res.baseUnit)
console.log(validation.conforms) // OK: false
})();
The output will be:
- What is the expected behavior?
When validating root.raml, the validator should fail validation due to invalid annotation used in the RAML type provided in referenced library.
Your issue may already be reported! Please search on Github issues before creating one.
I'm submitting a ...
What is the current behavior?
When a RAML file references a RAML library with types that use invalid anntations, those are not validated by RAML validator. However, they are validated when the RAML library is validated directly.
Consider the following RAML files:
root.raml
lib.raml
And the following code in TypeScript:
The output will be:
When validating
root.raml, the validator should fail validation due to invalid annotation used in the RAML type provided in referenced library.What is the motivation/use case for changing the behavior? (for feature requests)
Please tell us about your environment: