1
0
mirror of https://github.com/enpaul/kodak.git synced 2024-11-14 18:46:50 +00:00
kodak/fresnel_lens/resources/openapi.py

20 lines
362 B
Python
Raw Normal View History

from pathlib import Path
from ruamel.yaml import YAML
2021-10-28 23:03:09 +00:00
from fresnel_lens.resources._shared import FresnelResource
yaml = YAML(typ="safe")
2021-10-28 23:03:09 +00:00
class OpenAPI(FresnelResource):
routes = ("/openapi.json",)
def get(self):
with (Path(__file__).parent, "openapi.yaml").open() as infile:
data = yaml.load(infile)
return data, 200