You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@superset.apache.org by Maxime Beauchemin <ma...@gmail.com> on 2019/04/04 17:12:41 UTC

FAB - New REST API in the works

Hey!

[I sent a similar email to the Airflow community earlier, sorry if you got
this twice]

I wanted to point out that there's awesome work taking place in FAB around
a new REST API provided by the framework, and ways to extend it.

Daniel Gaspar (cced) is working on this currently, and looking for input
on  implementation and looking for feedback.

Check it out and chime in on the PR
https://github.com/dpgaspar/Flask-AppBuilder/pull/929

I wanted to point out that a good place to start is by reading the
`rest_api.rst` file in the PR (github collapses it in the PR interface as
it's large, and want to make sure people don't overlook that file)
https://github.com/dpgaspar/Flask-AppBuilder/pull/929/files#diff-f0aaa98b108e6453b3a8b2526956b8beR1

Some key elements:
* better and more flexible authentication, using JWTs
* Type awareness
* a much better auto REST CRUD, with the ModelRestApi base class
* a new way to define REST endpoints and a cohesive API, versioned as in
`/api/v1`
* Rison integration
* i18n

This should probably become the foundation to Superset's REST API as it
grows and this is a unique moment to influence the design of FAB's REST API.

Max

Re: FAB - New REST API in the works

Posted by da...@gmail.com, da...@gmail.com.
Ok, so now ModelRestApi generates automatic OpenAPI specs from the CRUD endpoint, and made
the spec accessible on /api/<version>/_openapi. This endpoint is protected, but will allow browser session cookies also (besides JWT).

BaseApi generates spec from YAML method docs. And offers 400-500 already bundled spec responses for easy referencing ($ref: ) and Rison jsonschema integration and self registering on /components/parameters

I'm not bundling a swagger-ui also. Maybe this could be useful for dev.

On 2019/04/04 17:30:20, Don Bowman <do...@agilicus.com> wrote: 
> On Thu, 4 Apr 2019 at 13:12, Maxime Beauchemin <ma...@gmail.com>
> wrote:
> 
> > Hey!
> >
> > [I sent a similar email to the Airflow community earlier, sorry if you got
> > this twice]
> >
> > I wanted to point out that there's awesome work taking place in FAB around
> > a new REST API provided by the framework, and ways to extend it.
> >
> >
> I would recommend also looking at
> https://connexion.readthedocs.io/en/latest/ as tooling for REST interface
> in superset.
> Its openapi-based, so standard tools for defining/documenting/testing ,
> integrates well with flask, and supports the auth methods well.
> Perhaps it layers on / updates the FAB approach, i'm not sure.
> 

Re: FAB - New REST API in the works

Posted by da...@gmail.com, da...@gmail.com.
Yes, actually I'm trying out https://github.com/marshmallow-code/apispec.
conexion seems to overlap and has lots of features we don't need

On 2019/04/04 17:30:20, Don Bowman <do...@agilicus.com> wrote: 
> On Thu, 4 Apr 2019 at 13:12, Maxime Beauchemin <ma...@gmail.com>
> wrote:
> 
> > Hey!
> >
> > [I sent a similar email to the Airflow community earlier, sorry if you got
> > this twice]
> >
> > I wanted to point out that there's awesome work taking place in FAB around
> > a new REST API provided by the framework, and ways to extend it.
> >
> >
> I would recommend also looking at
> https://connexion.readthedocs.io/en/latest/ as tooling for REST interface
> in superset.
> Its openapi-based, so standard tools for defining/documenting/testing ,
> integrates well with flask, and supports the auth methods well.
> Perhaps it layers on / updates the FAB approach, i'm not sure.
> 

Re: FAB - New REST API in the works

Posted by Don Bowman <do...@agilicus.com>.
On Thu, 4 Apr 2019 at 13:12, Maxime Beauchemin <ma...@gmail.com>
wrote:

> Hey!
>
> [I sent a similar email to the Airflow community earlier, sorry if you got
> this twice]
>
> I wanted to point out that there's awesome work taking place in FAB around
> a new REST API provided by the framework, and ways to extend it.
>
>
I would recommend also looking at
https://connexion.readthedocs.io/en/latest/ as tooling for REST interface
in superset.
Its openapi-based, so standard tools for defining/documenting/testing ,
integrates well with flask, and supports the auth methods well.
Perhaps it layers on / updates the FAB approach, i'm not sure.