Skip to content

Proposal: Allow register_blueprint option to name the Blueprint outside of Flask #567

Description

@spra85

Would like to have the option to use a different, more user-friendly name for OpenAPI/Swagger UI Blueprints without needing to change the underlying Flask Blueprint name.

Currently, register_blueprint looks for the name option to be passed in and falls back on Blueprint.name (see: https://github.com/marshmallow-code/flask-smorest/blob/master/flask_smorest/blueprint.py#L180).

Suggestion, something like the below to add a docs_name option to use a different name from the name option, which is also used by the FlaskBlueprint and materially changes the actual route reference that might be used by Flask url_for.

blp_name = options.get("docs_name") or options.get("name", blueprint.name)

If this is an acceptable solution/idea, I can submit a PR. I could be misinterpreting the appropriate place for this change.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions