Skip to content

Commit

Permalink
Merge pull request #14 from koxudaxi/fix_invalid_required
Browse files Browse the repository at this point in the history
fix invalid required
  • Loading branch information
koxudaxi authored Jun 18, 2020
2 parents ee6edcf + bb4fc92 commit f8dfd3a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions fastapi_code_generator/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def request_objects(self) -> List[Request]:
Request(
description=self.requestBody.get("description"),
contents=contents,
required=self.requestBody.get("required") == "true",
required=self.requestBody.get("required") is True,
)
)
return requests
Expand Down Expand Up @@ -219,8 +219,7 @@ def get_parameter_type(
field = DataModelField(
name=name,
data_types=[type_map[type_]],
required=parameter.get("required") == "true"
or parameter.get("in") == "path",
required=parameter.get("required") or parameter.get("in") == "path",
default=schema.typed_default,
)
self.imports.extend(field.imports)
Expand Down

0 comments on commit f8dfd3a

Please sign in to comment.