mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-17 09:31:55 +00:00
00441e776d
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.