Enrich schema declarations to allow for describing all the details of an API

Bug #984660 reported by Christopher Armstrong
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
txAWS
Fix Released
Medium
Christopher Armstrong

Bug Description

It'd be nice if schemas made it possible to describe:

- A method's name
- A more rich, abstract description of the arguments that a method takes
  - support for list arguments as List("things", Unicode())
  - support for structures as Structure("structname", fields=[Unicode("name"), Integer("anotherfield")])
- the *output* format (assuming json, it can be described as a Structure())
- possible errors (as a list of exception types)
- documentation of the method as a whole in the schema
- documentation of each individual parameter (even structure elements)

Some changes that will need to happen
- all parameter types will need to make the name argument optional, so they can be used as anonymous fields (like in Lists). Parameter types that take an additional positional argument after the name will be changed to accept those arguments as keywords, so you'd do something like Enum(mapping=...), but the old Enum('name', mapping) will still work.
- the way that indexing in arguments is done is INCREDIBLY INSANE. Every other element in a "foo.bar.baz.quux" field is assumed to be a list index. This will need to change, (since it doesn't allow for things like Structure("foo", fields=[Structure("bar", ...)]) with "foo.bar.field=1") but we probably shouldn't break compatibility with the current way of doing things.

Let's double-check the Colander library to see if it has any good ideas to use.

Related branches

Changed in txaws:
assignee: nobody → Christopher Armstrong (radix)
Thomas Herve (therve)
Changed in txaws:
importance: Undecided → Medium
status: New → In Progress
Changed in txaws:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.