FEATURE: Allow plugins to register parameter-based API routes (#10505)

Example usage:

```
add_api_parameter_route(
  method: :get,
  route: "users#bookmarks",
  format: :ics
)
```
This commit is contained in:
David Taylor
2020-08-24 10:24:52 +01:00
committed by GitHub
parent 23b823dd3a
commit 629ee5494d
4 changed files with 34 additions and 1 deletions

View File

@@ -48,6 +48,19 @@ describe 'api keys' do
expect(response.status).to eq(302)
end
context "with a plugin registered filter" do
before do
plugin = Plugin::Instance.new
plugin.add_api_parameter_route method: :get, route: "session#current", format: "*"
end
it 'allows parameter access to the registered route' do
get '/session/current.json', params: {
api_key: api_key.key
}
expect(response.status).to eq(200)
end
end
end
describe 'user api keys' do