From 7293abc01a5705789faa00c428032e9f8c541241 Mon Sep 17 00:00:00 2001 From: Shachar Snapiri Date: Mon, 10 Dec 2018 18:03:29 +0200 Subject: [PATCH] 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 --- dragonflow/cli/df_model.py | 1 + 1 file changed, 1 insertion(+) diff --git a/dragonflow/cli/df_model.py b/dragonflow/cli/df_model.py index 8536ec193..f77011eed 100644 --- a/dragonflow/cli/df_model.py +++ b/dragonflow/cli/df_model.py @@ -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),