Skip to content

Commit

Permalink
#109: Create dictionary to store examples
Browse files Browse the repository at this point in the history
  • Loading branch information
keiranjprice101 committed Oct 29, 2019
1 parent 0df043e commit e9d37c7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/swagger/swagger_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ def _map_db_type_to_json_type(self, type_str):
}
return type_map[type_str]



def __init__(self, entity_name, model):
self.properties_dict = {}
for column in model.__table__.columns:
self.properties_dict[column.name] = {"type": self._map_db_type_to_json_type(str(column.type))}
self.entity_no_id_endpoint = {
f"/{entity_name.lower()}": {
"get": {
Expand Down

0 comments on commit e9d37c7

Please sign in to comment.