-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Your issue may already be reported! Please search on Github issues before creating one.
-
I'm submitting a ...
- bug report
- feature request
- question
- other
-
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.
- 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.ramllib.raml
#%RAML 1.0 Library
types:
MyType:
(invalid_annotation): testAnd 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:
true
true
true
false
- 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.
-
What is the motivation/use case for changing the behavior? (for feature requests)
-
Please tell us about your environment:
- AMF Version: 5.4.5 and 5.5.2
- AMF Distribution: JS
- Operating System: Windows 10 21H2
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels