Skip to content

Dynamic matching / static matching - expected behaviour #1858

@myxoh

Description

@myxoh

When trying to have an endpoint that matches dynamically except for specific keywords.
i.e.
GET resource/:id => returns the resource
GET resource/new => returns a JSON schema of the resource

The issue is that when I define it this way:

class ResourceAPI
  get 'resource/:id' do
    # ...
  end

  get 'resource/new' do
    # ...
  end
end

I will never hit the resource/new endpoint. However, if I define it the other way around, it will work.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions