Skip to content

"can't access property "readOnly", mergedSchemas is undefined" while opening a generated page #1231

@Paolo7297

Description

@Paolo7297

Describe the bug

When using a specific OpenAPI schema, Selecting a specific operation shows:

This page crashed.

can't access property "readOnly", mergedSchemas is undefined

The OpenAPI operation which triggers the issue is

The OpenAPI snippet
            "post": {
                "operationId": "api_invoices_post_collection",
                "tags": [
                    "Invoice"
                ],
                "responses": {
                    "400": {
                        "description": "Invalid input"
                    },
                    "202": {
                        "description": "Invoice resource created",
                        "content": {
                            "application/ld+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Invoice.InvoiceOutput.jsonld-read"
                                }
                            },
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Invoice.InvoiceOutput-read"
                                }
                            },
                            "text/html": {
                                "schema": {
                                    "$ref": "#/components/schemas/Invoice.InvoiceOutput-read"
                                }
                            },
                            "application/xml": {
                                "schema": {
                                    "$ref": "#/components/schemas/Invoice.InvoiceOutput-read"
                                }
                            },
                            "text/xml": {
                                "schema": {
                                    "$ref": "#/components/schemas/Invoice.InvoiceOutput-read"
                                }
                            },
                            "application/octet-stream": {
                                "schema": {
                                    "$ref": "#/components/schemas/Invoice.InvoiceOutput-read"
                                }
                            },
                            "application/pdf": {
                                "schema": {
                                    "$ref": "#/components/schemas/Invoice.InvoiceOutput-read"
                                }
                            },
                            "application/zip": {
                                "schema": {
                                    "$ref": "#/components/schemas/Invoice.InvoiceOutput-read"
                                }
                            },
                            "text/csv": {
                                "schema": {
                                    "$ref": "#/components/schemas/Invoice.InvoiceOutput-read"
                                }
                            }
                        },
                        "links": {}
                    },
                    "422": {
                        "description": "Unprocessable entity"
                    }
                },
                "summary": "Creates a Invoice resource.",
                "description": "Create a new invoice and send it to the government channel",
                "parameters": [],
                "requestBody": {
                    "description": "The new Invoice resource",
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Invoice.InvoiceInput-write"
                            }
                        },
                        "application/xml": {
                            "schema": {
                                "$ref": "#/components/schemas/Invoice.InvoiceInput-write"
                            }
                        },
                        "text/xml": {
                            "schema": {
                                "$ref": "#/components/schemas/Invoice.InvoiceInput-write"
                            }
                        }
                    },
                    "required": true
                },
                "deprecated": false
            }

during the api pages generation it shows:

Could not merge values, they are probably incompatible
WARNING: failed to create example from schema object: TypeError: Cannot read properties of undefined (reading 'oneOf')
Could not merge values, they are probably incompatible
Could not merge values, they are probably incompatible
Could not merge values, they are probably incompatible
Could not merge values, they are probably incompatible
Could not merge values, they are probably incompatible
Could not merge values, they are probably incompatible
WARNING: failed to create example from schema object: TypeError: Cannot read properties of undefined (reading 'oneOf')
Could not merge values, they are probably incompatible
Could not merge values, they are probably incompatible
Could not merge values, they are probably incompatible
Could not merge values, they are probably incompatible

I don't know if it matters.

I'm attaching the generated page with the issue.

api-invoices-post-collection.api.zip

Expected behavior

Shows the operation like the others

Current behavior

Gives me the error reported above

Steps to reproduce

  1. Configure this plugin to use this OpenAPI spec
          govit: {
            specPath: "./static/openapi/gov-it-api.json",
            outputDir: "docs/api/gov-it",
            sidebarOptions: {
              groupPathsBy: "tag",
              sidebarCollapsed: true,
            },
          } satisfies OpenApiPlugin.Options,
  1. Generate pages
  2. Start docusaurus
  3. Open the generated page /docs/api/gov-it/api-invoices-post-collection
  4. Page crashes

Screenshots

Image

Context

Add api docs of this project

Your Environment

  • Version used: Docusaurus 3.8.1 | docusaurus-openapi-docs 4.5.1
  • Environment name and version: Node v24.8.0, zen-browser 1.16b and google-chrome 140.0.7339.185
  • Operating System and version (desktop or mobile): Arch
  • Link to your project: We don't have one yet

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions