mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-10-30 07:14:20 +00:00
feat(api): add OpenAPI schema postprocessing hooks for Mintlify compatibility
Add three postprocessing hooks to fix OpenAPI 3.0.x compatibility issues
generated by drf-spectacular-jsonapi:
1. fix_empty_id_fields: Fixes empty id field definitions ({}) in JSON:API
request schemas (particularly PATCH/update requests) by replacing them
with proper schema: {"type": "string", "format": "uuid", "description": "..."}
2. fix_pattern_properties: Converts patternProperties to additionalProperties
for OpenAPI 3.0 compatibility. patternProperties is only available in
OpenAPI 3.1+, but drf-spectacular generates 3.0.3 specs. This is needed
for the Prowler mutelist configuration which uses dynamic keys.
3. fix_type_formats: Fixes invalid type values like "email" that
drf-spectacular generates from Django's EmailField. Converts them to
proper OpenAPI format: "type": "string" with "format": "email".
Also handles "url" → "uri" and "uuid" formats.
These hooks ensure the generated OpenAPI schema validates correctly with
Mintlify and other OpenAPI 3.0.x tools.
This commit is contained in:
5 files changed
+44847
No files matched your search
@@ -329,6 +329,10 @@
|
||||
{
|
||||
"tab": "Public Roadmap",
|
||||
"href": "https://roadmap.prowler.com/"
|
||||
},
|
||||
{
|
||||
"tab": "API Reference",
|
||||
"openapi": "api-reference/openapi.json"
|
||||
}
|
||||
],
|
||||
"global": {
|
||||
|
||||
Reference in new issue
Block a user