-
Notifications
You must be signed in to change notification settings - Fork 238
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
Response descriptions in v4.2.0 not processing MDX #1012
Comments
Hi @Preston-Landers, |
Hi @ahelmy - I am using yarn. I tried a few things such as a deleting One is that if I simply deleted yarn.lock, and left all other package versions alone including leaving this plugin at 4.1.0, then ran yarn install and did a new build, it did update a number of packages, including a lot of Then, if allowed all available packages to update (with Something else I noticed - I'm seeing this not just in the Responses section, but also in the Request body description. The last thing I wanted to mention, and probably the most important, is that I noticed that the In the working version the MDX for the relevant section (talking about the
In the non-working version it looks like this, and overall the file has far fewer MDX components and just a bunch of data crammed in property strings.
The Docusaurus build errors previously mentioned looked like this:
|
A few more details:
Later this week I'll try to build a minimal demonstration repo that shows the issue. Just to recap, the problem I'm seeing is that Markdown stuff in API request and response descriptions are not rendering correctly and just render as plain text as shown in my screenshots.
|
I created a relatively minimal repo that demonstrates the problem. https://github.com/Preston-Landers/docusaurus-openapi-upgrade-bug-demo Clone and run On the Then switch to the Hopefully this is enough info to help you reproduce the issue. Thanks! |
Hi @Preston-Landers , Hi @sserrata, |
This is likely due to moving/abstracting the majority of the emitted MDX to higher-level JSX/React components, meaning descriptions are no longer processed as MDX. After a quick patch/change we can, at least, support GitHub-flavored markdown rendering but full Docusaurus-style MDX support may not be possible unless Docusaurus provides a hook or method for rendering Docusaurus MDX client-side. |
I am not very knowledgeable about either this project or Docusaurus itself, but I'm not sure I understand the comment about possibly needing a hook in Docusaurus, because I was able to update to the latest version of that without issue. It seems like something substantial changed here in this project in how it emits the Not being able to use MDX in request and response descriptions would be a pretty major bummer for my use cases, unfortunately. |
Hi @Preston-Landers, it is a bit of an edge case, but I think I came up with a viable solution for supporting admonitions and potentially other MDX components: https://docusaurus-openapi-36b86--pr1016-wu0mmkeo.web.app/petstore/add-pet It basically boiled down to creating a custom remark plugin for handling admonitions and using the Docusaurus |
Describe the bug
After updating my project to Docusaurus-OpenAPI-Docs v4.2.0 (from 4.1.0), when I build and view my docs, any Markdown / MDX processing is not happening in the Responses description - admonitions,
back-tick quoting
, etc doesn't render there.Expected behavior
I have MDX stuff in a Response description:
The admonition and the backtick words should render out correctly, but I'm just seeing the raw text as shown below.
As far as I can tell in my limited testing so far, it's only happening in Response descriptions. No obvious signs of warnings or errors in the build.
Current behavior
The admonitions should be rendered correctly as shown in the screenshots.
Screenshots
Not working:
Working:
Context
Only happened after updating to 4.2.0.
The text was updated successfully, but these errors were encountered: