cenobites / flask-jsonrpc

Basic JSON-RPC implementation for your Flask-powered sites

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request: allow deeper view nesting in API Browser

Talkless opened this issue · comments

Currently, view names are spitted using '.' once:

package_name = package['name'].split('.')[0]

It might be useful to allow more then than single dot (or some other separator) for better code organization in bigger APIs.

For examples, if we have view names like this:

  • object.list.all
  • object.list.with_tacho_download_capability
  • object.report.trip_stop
  • object.report.time_in_zone
  • object.service.create
  • object.service.edit

We would see them nested in the API Browser like this:

image

Yes, it's pretty good.

My idea here is to create a schema definition for API Browser that allows setting the splitter character, like this:

browse = JSONRPCBrowe(splitter='.')

app = Flask('multiplesite')
jsonrpc_v1 = JSONRPC(app, '/api/v1', browse=browse)

Will it solve your use case?

Looks good.