Repository navigation
Unexpected keyword 'source' in OpenAPIV3DocumentationHandler.__init__() #11
Copy link
Copy link
Open
Description
We're retrying this plugin with a single spec file (draft PR is here: n8n-io/n8n-docs#818)
Trying to serve locally, I'm getting:
ERROR - Error reading page 'api\api-reference-3.md': OpenAPIV3DocumentationHandler.__init__() got
an unexpected keyword argument 'source'
Traceback (most recent call last):
File "C:\Users\debor\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\debor\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\debor\Desktop\docs\n8n-docs\venv\Scripts\mkdocs.exe\__main__.py", line 7, in <module>
File "C:\Users\debor\Desktop\docs\n8n-docs\venv\lib\site-packages\click\core.py", line 1128, in __call__
return self.main(*args, **kwargs)
File "C:\Users\debor\Desktop\docs\n8n-docs\venv\lib\site-packages\click\core.py", line 1053, in main
rv = self.invoke(ctx)
File "C:\Users\debor\Desktop\docs\n8n-docs\venv\lib\site-packages\click\core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Users\debor\Desktop\docs\n8n-docs\venv\lib\site-packages\click\core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\debor\Desktop\docs\n8n-docs\venv\lib\site-packages\click\core.py", line 754, in invoke return __callback(*args, **kwargs)
File "C:\Users\debor\Desktop\docs\n8n-docs\venv\lib\site-packages\mkdocs\__main__.py", line 181, in serve_command
serve.serve(dev_addr=dev_addr, livereload=livereload, watch=watch, **kwargs)
File "C:\Users\debor\Desktop\docs\n8n-docs\venv\lib\site-packages\mkdocs\commands\serve.py", line 63, in serve
config = builder()
File "C:\Users\debor\Desktop\docs\n8n-docs\venv\lib\site-packages\mkdocs\commands\serve.py", line 58, in builder
build(config, live_server=live_server, dirty=dirty)
File "C:\Users\debor\Desktop\docs\n8n-docs\venv\lib\site-packages\mkdocs\commands\build.py", line 292, in build
_populate_page(file.page, config, files, dirty)
File "C:\Users\debor\Desktop\docs\n8n-docs\venv\lib\site-packages\mkdocs\commands\build.py", line 170, in _populate_page
page.markdown = config['plugins'].run_event(
File "C:\Users\debor\Desktop\docs\n8n-docs\venv\lib\site-packages\mkdocs\plugins.py", line 102, in run_event
result = method(item, **kwargs)
File "C:\Users\debor\Desktop\docs\n8n-docs\venv\lib\site-packages\neoteroi\mkdocsoad\__init__.py", line 44, in on_page_markdown
return self.rx.sub(self._replacer, markdown)
File "C:\Users\debor\Desktop\docs\n8n-docs\venv\lib\site-packages\neoteroi\mkdocsoad\__init__.py", line 31, in _replacer
handler = OpenAPIV3DocumentationHandler(
TypeError: OpenAPIV3DocumentationHandler.__init__() got an unexpected keyword argument 'source'
api-reference-3.md is the markdown file containing the link to the spec file.
- Python 3.10.2
- MkDocs 1.3.0
Any help is appreciated :-)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
RobertoPrevato commentedon May 17, 2022
Hi @StarfallProjects,
Please upgrade the
essentials-openapidependency usingpip install -U, as I described in the other issue I closed a few days ago:I needed to pass the
sourceto the function that generates documentation to support your scenario, to recreate the full path to files when you use relative file paths to separate the OAD into different files.I should have pinned the dependency in
neoteroi-mkdocsbut for now I preferred to always keep the latest versionPlease let me know if this helps. 🙂
StarfallProjects commentedon May 18, 2022
I still get the error after updating (fairly sure I updated last time as prompted, but ran the command again just now in case I'd missed it)
essentials==1.1.5
essentials-openapi==1.0.0
neoteroi-mkdocs==0.0.5
Ok so running the command doesn't get me 1.0.2, possibly that is the problem . . . brb poking pip
StarfallProjects commentedon May 18, 2022
Ok new error:
Attached my full requirements.txt
requirements.txt