mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-13 18:45:40 +00:00
Render API docs (#6463)
* Render API docs
* Cleanup broken links
* Re-enable strict mode
* Change json to yaml
* Update docs/docs/api/schema.md
Co-authored-by: Matthias Mair <code@mjmair.com>
* Update docs/docs/api/schema.md
Co-authored-by: Matthias Mair <code@mjmair.com>
* Use neoteroi-mkdocs instead
- seems to render more reliably
* Fix SERVERS section for SPECTACTULAR_SETTINGS
* Script for splitting schema into smaller sections
* Generate an index file for the schema pages
* Move schema.md up one directory
* Fix formatting
* Remove tracked file
* Add hook for rebuilding API schema as part of RTD build
* Extract schema as RTD build step
* install invoke
* export env vars
* remove argparse
* Fix order of operations
* Compress env vars
* Remove custom env vars
- Now configured as part of RTD project
* Migrate db
* Revert "remove argparse"
This reverts commit 4665805340
.
* Post-process generated schema file
* Fix file formatting
* Add note about schema repo
* no message
* Reduce schema overhead
* Ignore generated files
* Delete generated file
* Update .gitignore
* Add extra split for machine integration
* Remove schema files
- These will be auto-generated too
* Generate individual schema .md files
* Re-add .md files
- Need git commit log to work
* Update .gitignore
* Fix for CI test
* patch machine.api
* Revert previous change
* Formatting fix
* Adjust export step
* Bump API version
---------
Co-authored-by: Matthias Mair <code@mjmair.com>
This commit is contained in:
8
tasks.py
8
tasks.py
@ -918,6 +918,10 @@ def schema(c, filename='schema.yml', overwrite=False, ignore_warnings=False):
|
||||
"""Export current API schema."""
|
||||
check_file_existance(filename, overwrite)
|
||||
|
||||
filename = os.path.abspath(filename)
|
||||
|
||||
print(f"Exporting schema file to '{filename}'")
|
||||
|
||||
cmd = f'spectacular --file {filename} --validate --color'
|
||||
|
||||
if not ignore_warnings:
|
||||
@ -925,6 +929,10 @@ def schema(c, filename='schema.yml', overwrite=False, ignore_warnings=False):
|
||||
|
||||
manage(c, cmd, pty=True)
|
||||
|
||||
assert os.path.exists(filename)
|
||||
|
||||
print('Schema export completed:', filename)
|
||||
|
||||
|
||||
@task(default=True)
|
||||
def version(c):
|
||||
|
Reference in New Issue
Block a user