datamodel-code-generator
datamodel-code-generator copied to clipboard
Support `webhooks` in `--openapi-scope`
OpenAPI Documents can have a webhooks root element instead of paths or component:
https://spec.openapis.org/oas/latest.html#oasWebhooks
It usually contains path-like items with operations that have a requestBody which have content schema attribute.
It's the same schema object that already is getting utilised for schema and paths openapi-scopes when used with --openapi-scope.
Here is an example OpenAPI JSON (for Zoom Account Webhooks)
It would be nice to extend the currently available openapi-scopes to include webhooks to generate pydantic model or data classes based on the schema information found.
Alternatively, it might be possible to merge the objects under paths with webhooks.