milesj/docusaurus-plugin-typedoc-api

Enums with numbers do not render the correct `type` due to `reflection.type` being undefined

vladfrangu opened this issue · 9 comments

Hello!

I've recently deployed a website with your plugin, but I've encountered a strange issue with numeric enum members: https://discord-api-types.dev/api/next/discord-api-types-v10/enum/ActivityFlags#Embedded

The source code for the website is visible at https://github.com/discordjs/discord-api-types, in the website folder

For some reason, reflection.type is undefined in this case. Could it be an issue with the JSON I made? Is there an easy fix for this?

Thanks!

@vladfrangu Are you expecting the actual bitwise to be rendered, like 1 << 6?

Well, honestly I'd be fine with either the final number to be rendered, or just the type of the defaultValue. Right now it renders like this, which is less than ideal (that : is out of place)

Google Chrome Dev - 2022-05-25 at 02 30 05@2x

@vladfrangu Recreated this and it looks like the raw JSON data just has the number above.

Screen Shot 2022-05-28 at 5 22 39 PM

I'd report this to TypeDoc. Not much I can do here, especially since there's no other metadata/flags to work with.

Thanks! I'll create a minimum repro sample and report it to them, and keep the patch I have for now to render the defaultValue if missing

🎉 whenever 0.23 is released this will be fixable TypeStrong/typedoc@261b5a1

Awesome, that was fast.

Actually just noticed this has been released in 0.22.16! I guess this issue can be closed since no release is needed from your side, correct?

Hmm...I tried a clean reinstall of the plugin but it still doesn't seem to render correctly, even if the JSON is correct 🤔

Scratch that, was looking at previous versions!

v2.1 is now on TypeDoc v0.23, which should include this fix!