From 3e32b7aa1e37681358311ff980f69e2631a21d86 Mon Sep 17 00:00:00 2001 From: Jake Herrmann Date: Wed, 6 Sep 2023 14:37:28 -0800 Subject: [PATCH] `create_spec` is deprecated --- apps/api/src/hyp3_api/routes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/api/src/hyp3_api/routes.py b/apps/api/src/hyp3_api/routes.py index a74eed87e..0868a4d16 100644 --- a/apps/api/src/hyp3_api/routes.py +++ b/apps/api/src/hyp3_api/routes.py @@ -7,16 +7,16 @@ import yaml from flask import abort, g, jsonify, make_response, redirect, render_template, request from flask_cors import CORS +from openapi_core import Spec from openapi_core.contrib.flask.handlers import FlaskOpenAPIErrorsHandler from openapi_core.contrib.flask.views import FlaskOpenAPIView -from openapi_core.spec.shortcuts import create_spec from hyp3_api import app, auth, handlers from hyp3_api.openapi import get_spec_yaml api_spec_file = Path(__file__).parent / 'api-spec' / 'openapi-spec.yml' api_spec_dict = get_spec_yaml(api_spec_file) -api_spec = create_spec(api_spec_dict) +api_spec = Spec.from_dict(api_spec_dict) CORS(app, origins=r'https?://([-\w]+\.)*asf\.alaska\.edu', supports_credentials=True) AUTHENTICATED_ROUTES = ['/jobs', '/user']