Skip to content

Commit 9c2d30d

Browse files
committed
Yaml is a superset of json.
1 parent 11508ea commit 9c2d30d

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

fastapi_code_generator/parser.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@
66
from typing import Any, Dict, List, Optional, Union
77

88
import stringcase
9-
from datamodel_code_generator import (
10-
DataModelField,
11-
load_json_or_yaml,
12-
snooper_to_methods,
13-
)
9+
import yaml
10+
from datamodel_code_generator import DataModelField, snooper_to_methods
1411
from datamodel_code_generator.imports import IMPORT_LIST, Import, Imports
1512
from datamodel_code_generator.model.pydantic.types import type_map
1613
from datamodel_code_generator.parser.jsonschema import (
@@ -390,7 +387,7 @@ def __init__(
390387
model_path_var.set(model_path)
391388

392389
def parse(self) -> ParsedObject:
393-
openapi = load_json_or_yaml(self.input_text)
390+
openapi = yaml.safe_load(self.input_text)
394391
return self.parse_paths(openapi)
395392

396393
def parse_security(

0 commit comments

Comments
 (0)