Add table name to the schema objects

Every object now has an attribute with the name of the table holding it.
the attribute for it is x-table-name

Change-Id: I2c86c5dc068ed9a408cf2ffbf917f21c9e16fafe
This commit is contained in:
Shachar Snapiri 2018-12-10 18:03:29 +02:00
parent ca688e4290
commit 7293abc01a
1 changed files with 1 additions and 0 deletions

View File

@ -366,6 +366,7 @@ class OASPrinter(ModelsPrinter):
self._models_obj['components']['schemas'][model.__name__] = self._model
self._model['type'] = 'object'
if is_first_class(model):
self._model['x-table-name'] = model.table_name
path_plural = '/' + model.table_name
self._models_obj['paths'][path_plural] = {
'get': self.get_list_path(model),