<?xml version="1.0"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>CKAN: Ticket #1438: Action API - parameter discovery/checking</title>
    <link>http://localhost/ticket/1438</link>
    <description>&lt;p&gt;
Many actions in the Action API require parameters. What params are needed should be listed and checked. Because currently, if you get them wrong you simply get a useless 500 error.
&lt;/p&gt;
&lt;p&gt;
Currently they are listed in the docs, extracted from the code manually.
&lt;/p&gt;
&lt;p&gt;
So you could GET /action/api/package_list to receive not only the help text, but a list of arguments.
&lt;/p&gt;
&lt;p&gt;
And if you send an extra or missing argument then an intelligent error message can be returned.
&lt;/p&gt;
&lt;h1 id="implementation"&gt;implementation&lt;/h1&gt;
&lt;p&gt;
How about some sort of decorator on the action function:
&lt;/p&gt;
&lt;pre class="wiki"&gt;@logic_params(id, offset, limit)
def get_package_list(context, data_dict):
    ...
&lt;/pre&gt;&lt;p&gt;
This would do the param checking, and is there a way to extract these params from the function? Or do a registration of the logic function?
&lt;/p&gt;
&lt;p&gt;
I'd certainly like to keep the list of the list of params for the function with the function, for ease of reading the code.
&lt;/p&gt;
&lt;p&gt;
Another good thing would be to pass in the params named as themselves, rather than having them contained in the data_dict.
&lt;/p&gt;
</description>
    <language>en-us</language>
    <image>
      <title>CKAN</title>
      <url>http://assets.okfn.org/p/ckan/img/ckan_logo_shortname.png</url>
      <link>http://localhost/ticket/1438</link>
    </image>
    <generator>Trac 0.12.3</generator>
    <item>
      
        <dc:creator>icmurray</dc:creator>

      <pubDate>Mon, 28 May 2012 11:37:14 GMT</pubDate>
      <title>milestone changed</title>
      <link>http://localhost/ticket/1438#comment:1</link>
      <guid isPermaLink="false">http://localhost/ticket/1438#comment:1</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;milestone&lt;/strong&gt;
                changed from &lt;em&gt;ckan-v1.7&lt;/em&gt; to &lt;em&gt;ckan-backlog&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>icmurray</dc:creator>

      <pubDate>Mon, 28 May 2012 11:37:30 GMT</pubDate>
      <title>milestone changed</title>
      <link>http://localhost/ticket/1438#comment:2</link>
      <guid isPermaLink="false">http://localhost/ticket/1438#comment:2</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;milestone&lt;/strong&gt;
                changed from &lt;em&gt;ckan-backlog&lt;/em&gt; to &lt;em&gt;ckan-future&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item>
 </channel>
</rss>