diff --git a/fastapi_code_generator/parser.py b/fastapi_code_generator/parser.py index 5208fa8..5a9ef59 100644 --- a/fastapi_code_generator/parser.py +++ b/fastapi_code_generator/parser.py @@ -6,11 +6,8 @@ from typing import Any, Dict, List, Optional, Union import stringcase -from datamodel_code_generator import ( - DataModelField, - load_json_or_yaml, - snooper_to_methods, -) +import yaml +from datamodel_code_generator import DataModelField, snooper_to_methods from datamodel_code_generator.imports import IMPORT_LIST, Import, Imports from datamodel_code_generator.model.pydantic.types import type_map from datamodel_code_generator.parser.jsonschema import ( @@ -390,7 +387,7 @@ def __init__( model_path_var.set(model_path) def parse(self) -> ParsedObject: - openapi = load_json_or_yaml(self.input_text) + openapi = yaml.safe_load(self.input_text) return self.parse_paths(openapi) def parse_security(