-
Notifications
You must be signed in to change notification settings - Fork 53
Expand does not work for traits that add response types #94
Comments
Well, expand does work for traits that add response types. But you were happy to hit two different bugs at once :) Thanks for reporting this. The first issue may be not a bug as-is, but something, which is not clearly stated by the spec, and this one should be discussed. Right now, you cant really apply the same trait twice to a same method. The second issue is clearly a bug: when you have two traits, which apply a node, that looks -equally- in the unexpanded state, but differently in expanded state, the node is only applied once. In your case it is Here is the modification of your RAML, which applies both types, just in case it helps until the second issue is fixed:
See that |
BTW, in RAML 1.0 RC2 the value of |
Fixed in the |
Response types that are added by an trait are not correctly expanded if their suffix is the same (
+xml
in this case). The following example should lead to two response types (application/tree_v1_0_0+xml
andapplication/tree_v1_0_1+xml
):Unfortunately, one of the response-types is not added by the expand() method:
The expected output would be:
This has been tested against the current beta (v11). Everything is fine, if all used suffixes are distinct (e.g.
+xml
and+json
). This bug makes using traits for responses effectively useless if multiple media types must be supported.The text was updated successfully, but these errors were encountered: