Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type error in the official rest_api example code #1700

Closed
journeast opened this issue Sep 17, 2021 · 1 comment · Fixed by #1701
Closed

Type error in the official rest_api example code #1700

journeast opened this issue Sep 17, 2021 · 1 comment · Fixed by #1701

Comments

@journeast
Copy link

I am a new FAB user here, and found a minor but frustrating error in the official documentation.

I was trying to follow through the above rest_api example, and copy the exact code below to my editor but it did not work. It turned out that it is just a simple type error. It should use [route_base] instead of [base_route], please correct this asap so as not to turn off new users.

`from flask_appbuilder.api import BaseApi, expose
from . import appbuilder

class ExampleApi(BaseApi):

base_route = '/newapi/v2/nice'

@expose('/greeting')
def greeting(self):
    return self.response(200, message="Hello")

appbuilder.add_api(ExampleApi)`

@fedepad fedepad mentioned this issue Sep 17, 2021
1 task
@fedepad
Copy link
Contributor

fedepad commented Sep 17, 2021

@journeast I submitted a PR to fix that. Thanks for spotting it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants