Skip to content

Commit

Permalink
review comments: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
VishnuSanal committed Jul 25, 2024
1 parent 3808282 commit 019b4cf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion robyn/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
from robyn.events import Events
from robyn.jsonify import jsonify
from robyn.logger import Colors, logger
from robyn.openapi import OpenAPI
from robyn.processpool import run_processes
from robyn.reloader import compile_rust_files
from robyn.responses import html, serve_file, serve_html
from robyn.router import MiddlewareRouter, MiddlewareType, Router, WebSocketRouter
from robyn.types import Directory
from robyn.ws import WebSocket
from .openapi import OpenAPI

__version__ = get_version()

Expand Down
7 changes: 2 additions & 5 deletions robyn/openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
from typing import List, Dict, Union, Any

from robyn import serve_html
import robyn


class OpenAPI:
Expand Down Expand Up @@ -233,14 +233,11 @@ def docs_handler(self):
"""
json.dumps(self.openapi_schema)
html_file = os.path.join(os.getcwd(), "robyn/swagger.html")
return serve_html(html_file)
return robyn.serve_html(html_file)

def json_handler(self):
"""
get the openapi spec json object
@return: the openapi spec json object
"""
return json.dumps(self.openapi_schema)


openapi = OpenAPI()

0 comments on commit 019b4cf

Please sign in to comment.