Skip to content

Commit

Permalink
Yaml is a superset of json.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioggstream committed Jul 27, 2020
1 parent 11508ea commit 9c2d30d
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions fastapi_code_generator/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 9c2d30d

Please sign in to comment.