Closed scranen closed 10 years ago
Hi scranen!
Thank you very match for your interest to the project. I've added supporting of queryParameters to RAML Method (queryParameters in RAML Traits will be tomorrow)
Thanks! Here are some more suggestions for alteration. The 'type' field in RamlResource is not according to the spec, I believe. I think the following would be better:
diff --git a/pyraml/entities.py b/pyraml/entities.py
index 5976008..8e0d9d6 100644
--- a/pyraml/entities.py
+++ b/pyraml/entities.py
@@ -97,7 +97,8 @@ class RamlResource(Model):
displayName = String()
description = String()
uri = String()
- type = Reference(RamlTrait, field_name="is")
+ is_ = List(Reference(RamlTrait, field_name="is"))
+ type = Reference(RamlResourceType)
parentResource = Reference("pyraml.entities.RamlResource")
methods = Map(String(), Reference(RamlBody))
resources = Map(String(), Reference("pyraml.entities.RamlResource"))
Also, I don't have any way to distinguish between the situation in which a Resource had a body field specified, but did not contain any RAML info (e.g. because it only defines custom keywords), and the situation in which the Resource did not have a body tag in it at all. This could be fixed as follows (looking at the docstring, you actually intended to do this anyway).
diff --git a/pyraml/parser.py b/pyraml/parser.py
index 5c894d9..2a8fcac 100644
--- a/pyraml/parser.py
+++ b/pyraml/parser.py
@@ -281,6 +281,9 @@ def parse_body(c, parent_object):
:return: RamlMethod or None
:rtype: RamlMethod
"""
+
+ if c.data is None:
+ return None
body = RamlBody()
body.example = c.get_string_property("example")
Ok, thank you very much for your help. I've added your code it to master branch.
It seems that method.queryParameters is not implemented (although the queryParameters do appear in the traits). If this is not intentional, I suggest the following patch: