Skip to content

Cornice API with optional path parameter #548

@tflorac

Description

@tflorac

Hi,

I'm trying to build a Cornice service which should accept an optional path parameter, so I followed Pyramid guidelines and set path as "/api/rest/doc/{doc_id}{version:.*}".

But then:

  • when defined, request.matchdict['version'] is set to "/1" (for example), instead of just "1", as described in Pyramid documentation;
  • when using Swagger extension, I only see a single parameter called "doc_id}{version"!

So is this syntax supported by Cornice, or should I handle it in another way?

Best regards,

Thierry

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