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

Documentation Plugin doesn't generate Proper Type for the Localization prop , and doesn't generate Refs for Components in Dynamic Zones #13453

Closed
meganoob1337 opened this issue Jun 3, 2022 · 2 comments · Fixed by #13458
Labels
issue: bug Issue reporting a bug severity: low If the issue only affects a very niche base of users and an easily implemented workaround can solve source: plugin:documentation Source is plugin/documentation package status: confirmed Confirmed by a Strapi Team member or multiple community members

Comments

@meganoob1337
Copy link
Contributor

meganoob1337 commented Jun 3, 2022

Bug report

Required System information

  • Node.js version: 14.17.6
  • NPM version: 8.5.3
  • Strapi version: 4.1.12
  • Database: Postgres
  • Operating system: MacOS

Describe the bug

When Generating a OpenAPI documentation with the Documentation Plugin , Content-Types that Are localized have an Empty array for the "localizations" prop instead of the correct type.

Also it doesn't generate Proper refs for Components in Dynamic Zones, which Bloats the Documentation if there are many Components in Dynamic Zones that are used in multiple Content-Types.
This also Makes it not as UserFriendly to use with CodeGens ( i use Orval) because the Component-types in Dynamic Zones are not Named properly (for example A Slider Component is named AnyOf instead of Slider)

Steps to reproduce the behavior

  1. Go to Content Types , create A localized Content-type, add a Dynamic Zone, Create one or more Components and add them to the Dynamic Zone.
  2. Go To Documentation Plugin and Create Documentation
  3. Look at the Generated Documentation and see that Localizations prop shows an empty array as type instead of the proper Content-Type. also see that Dynamic Zone Components are not Reffed but just defined inside an AnyOf

Expected behavior

Components in Dynamic Zones are Reffed.
the localizations prop shows the "parent" content type aswell

Additional context

i Created A Patch for it and would like to submit it as a PR or have it implemented by someone from Strapi:

too much of a wall of text

meganoob1337 pushed a commit to meganoob1337/strapi that referenced this issue Jun 3, 2022
…r the Localization prop , and doesn't generate Refs for Components in Dynamic Zones
meganoob1337 pushed a commit to meganoob1337/strapi that referenced this issue Jun 3, 2022
…r the Localization prop , and doesn't generate Refs for Components in Dynamic Zones
meganoob1337 pushed a commit to meganoob1337/strapi that referenced this issue Jun 3, 2022
…r the Localization prop , and doesn't generate Refs for Components in Dynamic Zones
meganoob1337 added a commit to meganoob1337/strapi that referenced this issue Jun 3, 2022
…r the Localization prop , and doesn't generate Refs for Components in Dynamic Zones
@derrickmehaffy derrickmehaffy added issue: bug Issue reporting a bug severity: low If the issue only affects a very niche base of users and an easily implemented workaround can solve status: confirmed Confirmed by a Strapi Team member or multiple community members source: plugin:documentation Source is plugin/documentation package labels Jun 3, 2022
@derrickmehaffy
Copy link
Member

@meganoob1337 I snipped your patch out, in the future can you zip those and just attach the zip file? I should have mentioned that to you in Discord but wasn't paying attention. If you want to see an example, see this: #13435 (comment)

@meganoob1337
Copy link
Contributor Author

patches.zip
Like this?
Added the Patch here

markkaylor added a commit that referenced this issue Aug 23, 2022
…cumentation-fix

fix #13453 Documentation Plugin doesn't generate Proper Type for the …
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug Issue reporting a bug severity: low If the issue only affects a very niche base of users and an easily implemented workaround can solve source: plugin:documentation Source is plugin/documentation package status: confirmed Confirmed by a Strapi Team member or multiple community members
Projects
Status: Fixed/Shipped
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants