-
Notifications
You must be signed in to change notification settings - Fork 300
Description
Describe the bug
Request body schemas that use allOf/oneOf/$ref composition are not rendered in the generated documentation. The request body section appears empty or incomplete when using the Docusaurus OpenAPI plugin, even though the OpenAPI spec is valid and renders correctly in Swagger UI.
Expected behavior
The plugin should resolve and display all properties from composed schemas (using allOf, oneOf, and $ref) in the request body section, similar to how Swagger UI flattens and renders them.
Current behavior
The request body section is missing or does not show the merged properties when the schema uses allOf/oneOf/$ref. Only the schema name or a partial structure is shown, making it unclear to users what fields are required.
Possible solution
Enhance the plugin to fully resolve and flatten composed schemas (allOf, oneOf, $ref) for request bodies, so all properties are displayed in the documentation.
Steps to reproduce
- Create an OpenAPI spec with a request body schema using allOf/oneOf/$ref (see example below).
- Add the spec to a Docusaurus site using the OpenAPI plugin.
- Build or serve the docs.
- Navigate to the endpoint with the composed request body schema and observe the missing or incomplete schema rendering.
Screenshots
Context
This affects our ability to document APIs with reusable and composed schemas. Consumers of our API docs cannot see the required fields for endpoints with composed request body schemas, leading to confusion and support overhead.
example:
requestBody:
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/UploadRequest'
- $ref: '#/components/schemas/UploadTemplateRequest'
components:
schemas:
UploadRequest:
allOf:
- $ref: '#/components/schemas/UploadRequestTemplate'
- type: object
required: [contentType]
properties:
contentType:
$ref: '#/components/schemas/ContentType'
UploadRequestTemplate:
type: object
required: [content, notificationChannel, subject, templateName]
properties:
notificationChannel:
$ref: '#/components/schemas/NotificationChannel'
templateName:
type: string
subject:
type: string
content:
type: string