drf-to-mkdoc 0.1.8__tar.gz → 0.1.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of drf-to-mkdoc might be problematic. Click here for more details.
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/PKG-INFO +1 -1
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/conf/defaults.py +2 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/utils/common.py +20 -15
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc.egg-info/PKG-INFO +1 -1
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/.github/workflows/publish.yaml +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/.pre-commit-config.yaml +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/CONTRIBUTING.md +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/LICENSE +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/MANIFEST.in +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/README.md +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/conf/__init__.py +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/conf/defaults.py +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/conf/settings.py +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/docs/customizing_endpoints.md +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/docs/mkdocs.yml +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/docs/serving_mkdocs_with_django.md +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/__init__.py +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/apps.py +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/conf/__init__.py +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/conf/settings.py +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/management/__init__.py +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/management/commands/__init__.py +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/management/commands/build_docs.py +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/management/commands/generate_doc_json.py +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/management/commands/generate_docs.py +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/management/commands/generate_model_docs.py +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/management/commands/update_doc_schema.py +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/static/drf-to-mkdoc/javascripts/endpoints-filter.js +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/accessibility.css +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/animations.css +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/badges.css +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/base.css +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/endpoint-content.css +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/endpoints-grid.css +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/filter-section.css +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/fixes.css +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/layout.css +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/loading.css +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/responsive.css +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/sections.css +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/stats.css +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/tags.css +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/theme-toggle.css +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/variables.css +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/models/animations.css +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/models/base.css +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/models/model-cards.css +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/models/model-tables.css +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/models/responsive.css +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/models/variables.css +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/utils/__init__.py +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/utils/endpoint_detail_generator.py +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/utils/endpoint_list_generator.py +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/utils/extractors/__init__.py +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/utils/extractors/query_parameter_extractors.py +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/utils/md_generators/__init__.py +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/utils/md_generators/query_parameters_generators.py +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/utils/model_detail_generator.py +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/utils/model_list_generator.py +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc.egg-info/SOURCES.txt +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc.egg-info/dependency_links.txt +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc.egg-info/requires.txt +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc.egg-info/top_level.txt +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/pyproject.toml +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/setup.cfg +0 -0
- {drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: drf-to-mkdoc
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.9
|
|
4
4
|
Summary: Generate Markdown API docs from Django/DRF OpenAPI schema for MkDocs
|
|
5
5
|
Author-email: Hossein Shayesteh <shayestehhs1@gmail.com>
|
|
6
6
|
Maintainer-email: Hossein Shayesteh <shayestehhs1@gmail.com>
|
|
@@ -5,6 +5,8 @@ DEFAULTS = {
|
|
|
5
5
|
"MODEL_DOCS_FILE": "docs/model-docs.json", # Path to model documentation JSON file
|
|
6
6
|
"DOC_CONFIG_FILE": "docs/configs/doc_config.json", # Path to documentation configuration file
|
|
7
7
|
"CUSTOM_SCHEMA_FILE": "docs/configs/custom_schema.json", # Path to custom schema file
|
|
8
|
+
"PATH_PARAM_SUBSTITUTE_FUNCTION": None,
|
|
9
|
+
"PATH_PARAM_SUBSTITUTE_MAPPING": {},
|
|
8
10
|
# Django apps - required, no default
|
|
9
11
|
"DJANGO_APPS": None, # List of Django app names to process
|
|
10
12
|
}
|
|
@@ -174,39 +174,44 @@ def get_custom_schema():
|
|
|
174
174
|
def convert_to_django_path(path: str, parameters: list[dict[str, Any]]) -> str:
|
|
175
175
|
"""
|
|
176
176
|
Convert a path with {param} to a Django-style path with <type:param>.
|
|
177
|
-
If
|
|
177
|
+
If PATH_PARAM_SUBSTITUTE_FUNCTION is set, use that function instead.
|
|
178
178
|
"""
|
|
179
179
|
function = None
|
|
180
|
-
func_path =
|
|
180
|
+
func_path = drf_to_mkdoc_settings.PATH_PARAM_SUBSTITUTE_FUNCTION
|
|
181
181
|
|
|
182
182
|
if func_path:
|
|
183
183
|
try:
|
|
184
184
|
function = import_string(func_path)
|
|
185
185
|
except ImportError:
|
|
186
|
-
logger.warning("
|
|
186
|
+
logger.warning("PATH_PARAM_SUBSTITUTE_FUNCTION is not a valid import path")
|
|
187
187
|
|
|
188
188
|
# If custom function exists and returns a valid value, use it
|
|
189
|
+
PATH_PARAM_SUBSTITUTE_MAPPING = drf_to_mkdoc_settings.PATH_PARAM_SUBSTITUTE_MAPPING
|
|
189
190
|
if callable(function):
|
|
190
191
|
try:
|
|
191
|
-
|
|
192
|
-
if isinstance(
|
|
193
|
-
|
|
192
|
+
result = function(path, parameters)
|
|
193
|
+
if result and isinstance(result, dict):
|
|
194
|
+
PATH_PARAM_SUBSTITUTE_MAPPING.update(result)
|
|
194
195
|
except Exception as e:
|
|
195
196
|
logger.exception("Error in custom path substitutor: %s", e)
|
|
196
197
|
|
|
197
198
|
# Default Django path conversion
|
|
198
199
|
def replacement(match):
|
|
199
200
|
param_name = match.group(1)
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
if param_type == "integer":
|
|
205
|
-
converter = "int"
|
|
206
|
-
elif param_type == "string" and param_format == "uuid":
|
|
207
|
-
converter = "uuid"
|
|
201
|
+
custom_param_type = PATH_PARAM_SUBSTITUTE_MAPPING.get(param_name)
|
|
202
|
+
if custom_param_type and custom_param_type in ("int", "uuid", "str"):
|
|
203
|
+
converter = custom_param_type
|
|
208
204
|
else:
|
|
209
|
-
|
|
205
|
+
param_info = next((p for p in parameters if p.get("name") == param_name), {})
|
|
206
|
+
param_type = param_info.get("schema", {}).get("type")
|
|
207
|
+
param_format = param_info.get("schema", {}).get("format")
|
|
208
|
+
|
|
209
|
+
if param_type == "integer":
|
|
210
|
+
converter = "int"
|
|
211
|
+
elif param_type == "string" and param_format == "uuid":
|
|
212
|
+
converter = "uuid"
|
|
213
|
+
else:
|
|
214
|
+
converter = "str"
|
|
210
215
|
|
|
211
216
|
return f"<{converter}:{param_name}>"
|
|
212
217
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: drf-to-mkdoc
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.9
|
|
4
4
|
Summary: Generate Markdown API docs from Django/DRF OpenAPI schema for MkDocs
|
|
5
5
|
Author-email: Hossein Shayesteh <shayestehhs1@gmail.com>
|
|
6
6
|
Maintainer-email: Hossein Shayesteh <shayestehhs1@gmail.com>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/management/commands/generate_doc_json.py
RENAMED
|
File without changes
|
|
File without changes
|
{drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/management/commands/generate_model_docs.py
RENAMED
|
File without changes
|
{drf_to_mkdoc-0.1.8 → drf_to_mkdoc-0.1.9}/drf_to_mkdoc/management/commands/update_doc_schema.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|