Skip to content

Commit

Permalink
Merge pull request #23 from ioggstream/fix-yaml-reader
Browse files Browse the repository at this point in the history
Yaml is a superset of json.
  • Loading branch information
koxudaxi authored Jul 27, 2020
2 parents 11508ea + 9c2d30d commit 913a41f
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 913a41f

Please sign in to comment.