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
the behavior of the trailing slash should be more intuitive and consistent #47
Comments
there is a note on docs: " from: http://flask-classful.teracy.org/#flask-classful-s-way-of-talking-about-routes by default, a trailing slash should work. Could you provide the sample code to see if there is anything wrong? |
related: #46 for the next release version that trailing slash can be optional. |
@hoatle here is an example app: https://github.com/AlJohri/nonworking-flask-apispec-example I was using it to debug a The routes that work are: The route that doesn't work is: |
The relevant code is: class TemplateResource(FlaskView, metaclass=ResourceMeta):
route_base = '/templates/'
trailing_slash = True
@marshal_with(TemplateSchema(many=True))
def index(self):
return Template.query.all()
@marshal_with(TemplateSchema)
def get(self, template_id):
template = Template.query.filter(Template.id == template_id).one()
return template
TemplateResource.register(app) The issue occurs with |
hello @AlJohri, this works by using
By using By default (without Could you try with |
I guess we should check back the behavior of the trailing slash to get it more intuitive for the next version. |
…uitive and consistent
…uitive and consistent
@ #47 | the behavior of the trailing slash should be more intuitive and consistent
hello @AlJohri, it's considered as a bug from your report and it should be fixed now. |
I want a trailing slash for routes with parameters, such as
/api/v1/templates/1/
. any way to achieve that? it gives a 404 right now and only works without the trailing slashThe text was updated successfully, but these errors were encountered: