Skip to content

Document path params #18

@svennhg

Description

@svennhg

Hi,

I would like to document my path params, but currently only params in 'header', 'querystring' and 'body' locations are handled. Is there a reason for not including path?

I would like the following code

class CustomerSchema(colander.MappingSchema):
    id = colander.SchemaNode(
        colander.Int(),
        location='path',
        description='Customer ID',
        )

@resource(path='/customers/{id}')
class Customer(object):

    def __init__(self, request, context=None):
        self.request = request

    @view(schema=CustomerSchema, validators=('colander_path_validator',))
    def get(self):
        """Get customer."""
        return {"customer": ...}

to produce the following documentation:

values in the path

  • id (Integer) - Customer ID

Any suggestions?

Best regards,

svennhg

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions