Skip to content

Commit

Permalink
Merge pull request alufers#161 from puc9/master
Browse files Browse the repository at this point in the history
Fix number/boolean and nullable object generation
  • Loading branch information
alufers authored Apr 3, 2024
2 parents a398085 + 9c29226 commit d9abbb5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mitmproxy2swagger/swagger_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def response_to_headers(headers):

def value_to_schema(value):
# check if value is a number
if isinstance(value, (int, float)):
if type(value) is int or type(value) is float:
return {"type": "number"}
# check if value is a boolean
elif isinstance(value, bool):
Expand Down Expand Up @@ -143,7 +143,7 @@ def value_to_schema(value):
}
# if it is none, return null
elif value is None:
return {"type": "object"}
return {"type": "object", "nullable": True}


def is_uuid(key):
Expand Down

0 comments on commit d9abbb5

Please sign in to comment.