core.spectacular_hooks
Overview
drf-spectacular preprocessing and postprocessing hooks for schema customization.
Classes
postprocess_schema_components
Add examples, descriptions, and defaults to the generated schema components, and set summaries and descriptions on VUEDA operations.
It also removes the expand query parameter from workflow object operations and renames the single-object transition operation. It edits and returns result.
Signature
postprocess_schema_components(result, generator, kwargs)
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| result | yes | |||
| generator | yes | |||
| kwargs | no |
Source
server/vueda/core/spectacular_hooks.py:75
preprocessing_hooks
Return the drf-spectacular endpoints without the /routes/tests/ endpoints, and with each workflow execute_transition route split in two.
The split gives OpenAPI a bulk path and a single-object path with a required object_id. Runtime routing is unchanged.
Signature
preprocessing_hooks(endpoints)
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| endpoints | yes |
Source
server/vueda/core/spectacular_hooks.py:21
register_cart_with_model_info
Register the test store's CartSerializer with vueda.info when tests.store is installed, and return endpoints unchanged.
It runs as a schema preprocessing hook because registering in AppConfig.ready would query the database.
Signature
register_cart_with_model_info(endpoints)
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| endpoints | yes |
Source
server/vueda/core/spectacular_hooks.py:54
Source
server/vueda/core/spectacular_hooks.py