Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zero-property JSON response object schema leads to MimeTabs/TabItem error #813

Open
bnewbold opened this issue Apr 30, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@bnewbold
Copy link

Describe the bug

If I have a response JSON object with no fields, like:

        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          },
        }

then MDX generation succeeds, and npx docusaurus-mdx-checker passes, but when I actually build I get an error like:

Error: Docusaurus error: Bad <Tabs> child <TabItem>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.

The issue seems to be a <MimeTabs> MDX element with no body.

Expected behavior

Ideally the generated response section would show that the response must be mimetype application/json, and maybe that the body is supposed to be an object (eg, not a JSON string). But really anything would be fine as long as the docs could actually compile.

Current behavior

Fails to build, as described above.

Possible solution

Relevant code seems to be:

Steps to reproduce

(see above)

Context

This prevented building docs.bsky.app (https://github.com/bluesky-social/bsky-docs). Plan is to work around by creating a fake/bogus parameter _unknown_ so that the parameter list isn't empty.

Your Environment

  • Version used: docusaurus-plugin-openapi-docs v3.0.0-beta.10
  • Environment name and version (e.g. Chrome 59, node.js 5.4, python 3.7.3): node v18.13.0 / npm 8.19.3
  • Operating System and version (desktop or mobile): debian linux amd64
  • Link to your project: https://github.com/bluesky-social/bsky-docs
@bnewbold bnewbold added the bug Something isn't working label Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant