Skip to content

Commit 1ee443c

Browse files
committed
remove markdown routing
1 parent bcf0d8c commit 1ee443c

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

flask_openapi3/openapi.py

+1-19
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,16 @@
55
import os
66
from copy import deepcopy
77
from functools import wraps
8-
from io import StringIO
98
from typing import Optional, List, Dict, Union, Any, Type, Callable, Tuple
109

11-
from flask import Flask, Blueprint, render_template, make_response
10+
from flask import Flask, Blueprint, render_template
1211
from flask.wrappers import Response
1312
from pydantic import BaseModel
1413

1514
from .api_blueprint import APIBlueprint
1615
from .commands import openapi_command
1716
from .do_wrapper import _do_wrapper
1817
from .http import HTTPMethod
19-
from .markdown import openapi_to_markdown
2018
from .models import Info, APISpec, Tag, Components, Server
2119
from .models.common import Reference, ExternalDocumentation
2220
from .models.oauth import OAuthConfig
@@ -148,11 +146,6 @@ def init_doc(self) -> None:
148146
api_doc_url=self.api_doc_url.lstrip('/')
149147
)
150148
)
151-
blueprint.add_url_rule(
152-
rule='/markdown',
153-
endpoint='markdown',
154-
view_func=lambda: self.export_to_markdown()
155-
)
156149
blueprint.add_url_rule(
157150
rule='/',
158151
endpoint='index',
@@ -165,17 +158,6 @@ def init_doc(self) -> None:
165158
)
166159
self.register_blueprint(blueprint)
167160

168-
def export_to_markdown(self) -> Response:
169-
"""Export to markdown(Experimental)"""
170-
md = StringIO()
171-
172-
md.write(openapi_to_markdown(self.api_doc))
173-
174-
r = make_response(md.getvalue())
175-
r.headers['Content-Disposition'] = 'attachment; filename=api.md'
176-
177-
return r
178-
179161
@property
180162
def api_doc(self) -> Dict:
181163
"""Generate Specification json"""

0 commit comments

Comments
 (0)