Skip to content

Inconsistent behaviour while creating a template from a URI #101

@achamian

Description

@achamian

Executing following code

base = 'http://foo.com/api/xml'.to_uri
p base.to_template("bar/:id").uri_pattern

base = 'http://foo.com/api/xml/'.to_uri
p base.to_template("bar/:id").uri_pattern

base = 'http://foo.com/api/xml'.to_uri
p base.to_template("/bar/:id").uri_pattern

Produces

"http://foo.com/api/bar/:id"

"http://foo.com/api/xml/bar/:id" # Expected behaviour (Considering p base["/bar"].uri_string to be standard)

"http://foo.com/bar/:id"

Note that 'xml' is dropped in first case where as only base path is considered in last.

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