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

Adjust APIDocsView static views to use base_endpoint #573

Merged
merged 1 commit into from Apr 4, 2024

Conversation

markchoward7
Copy link
Contributor

#571

Adjusts the calls to url_for within the APIDocsView to utilize the base_endpoint variable to account for setting that configuration.

@markchoward7
Copy link
Contributor Author

@billyrrr Can this get looked at? I've been using an ugly monkeypatch to use this in my environment for some time now.

To be clear on the issue, I'm trying to host flasgger at multiple endpoints (/api/v1 and /api/v2) and I use the following config options when declaring my Swagger instances (version number adjusted for each of course).

{
  "headers": [],
  "specs_route": "/api/v1",
  "endpoint": "flasgger-v1",
  "specs": [
      "endpoint": "apispec_v1",
      "route": "/apispec_v1.json",
      "rule_filter": lambda rule: version in rule.endpoint,
      "model_filter": lambda tag: True,
}

Without this change, I get an error trying to access flasgger werkzeug.routing.exceptions.BuildError: Could not build url for endpoint 'flasgger.static' with values ['filename']. Did you mean 'flasgger-v1.static' instead?

I think that APIDocsView.get should be utilizing the endpoint configuration option to allow this to work.

Copy link
Member

@billyrrr billyrrr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@billyrrr billyrrr merged commit e1ae6a9 into flasgger:master Apr 4, 2024
1 check passed
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 this pull request may close these issues.

None yet

2 participants