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.
According to http://raml.org/spec.html#toc_59 and my understanding, if we specify a parameter inside a trait/resource type, and then try to use this type without providing the parameter value, the parsing should fail:
"The definitions of resource types and traits MAY contain parameters, whose values MUST be specified when applying the resource type or trait, UNLESS the parameter corresponds to a reserved parameter name, in which case its value is provided by the processing application (whatever is consuming the API definition)."
In our resource type we have a parameter called <<commonResourceSchema>> and if we use this resource type in our RAML without specifying the commonResourceSchema parameter, the parsing still passes. Shouldn't it fail, according to the specs?
We have the problem that such RAML is not correctly picked up by other tool, because of "syntax error". We can implement an additional validation ourselves, but I'm just wondering that maybe it should be part of the RAML parser.
Monika
The text was updated successfully, but these errors were encountered:
Hi @monami555, for performance reasons, trait and resource types are validated only when they are actually mixed in with the method/resource.
The only scenario in which I would see a missing parameter not get validated is in a trait that is applied at a resource level in a methodless resource:
#%RAML 0.8
title: My API
traits:
- traitName:
description: <<description>>
/resource:
is: [traitName]
We will re-consider parsing and validating parameters for applied traits on these scenarios, and update the parser accordingly.
If you have found a different scenario in which parameters are not validated, please post the RAML spec on this issue and I'll take a look.
Thanks!
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
According to http://raml.org/spec.html#toc_59 and my understanding, if we specify a parameter inside a trait/resource type, and then try to use this type without providing the parameter value, the parsing should fail:
"The definitions of resource types and traits MAY contain parameters, whose values MUST be specified when applying the resource type or trait, UNLESS the parameter corresponds to a reserved parameter name, in which case its value is provided by the processing application (whatever is consuming the API definition)."
In our resource type we have a parameter called <<commonResourceSchema>> and if we use this resource type in our RAML without specifying the commonResourceSchema parameter, the parsing still passes. Shouldn't it fail, according to the specs?
We have the problem that such RAML is not correctly picked up by other tool, because of "syntax error". We can implement an additional validation ourselves, but I'm just wondering that maybe it should be part of the RAML parser.
Monika
The text was updated successfully, but these errors were encountered: