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

Invalid nesting in apiSuccess since Version 0.27.0 #968

Closed
a-tonchev opened this issue May 18, 2021 · 4 comments
Closed

Invalid nesting in apiSuccess since Version 0.27.0 #968

a-tonchev opened this issue May 18, 2021 · 4 comments
Labels
bug fixed on dev for issues fixed on dev branch

Comments

@a-tonchev
Copy link

a-tonchev commented May 18, 2021

Following code:

       ...
       * @apiSuccess (200) {Boolean} ok True when success
       * @apiSuccess (200) {Object} data Response data, that includes returned values
       * @apiSuccess (200) {Object} data.fileType File Type and Extension.
       * @apiSuccess (200) {String} data.fileType.ext Detected Image Extension from file type.
       * @apiSuccess (200) {String} data.fileType.mime Detected Image Mime Type from file type.
       * @apiSuccess (200) {Buffer} data.imageBuffer Image Buffer.
       * @apiSuccess (200) {String} data.extension Image Extension from URL.
       ...
  is causing invalid nesting:

image

I just tried it with 0.26.0 - it works just fine.

@a-tonchev a-tonchev changed the title Invalid nesting in apiResponse since Version 0.27.0 Invalid nesting in apiSuccess since Version 0.27.0 May 18, 2021
@a-tonchev
Copy link
Author

This is the correct one, that I get in 0.26.0:

image

@wecomgroup
Copy link

Rolling back version to 26 can solve the problem.
git checkout bf56f2f

leehw123 added a commit to leehw123/apidoc that referenced this issue Jun 22, 2021
Fixes issue apidoc#968 that was introduced by the fix apidoc#951 that tried to fix the original issue apidoc#206

This fixes is simply added OR hardcoded "Object[]" while filtering Object, so Object[] won't mess up the sorting (tested and worked for my apidoc)

The sorting of the @ApiSucess will fail if there is type {Object[]} exist as one of the @ApiSuccess type, this is due to this sorting ignored Object[] as "Object" type, and treat it as a normal params while sorting.
@leehw123 leehw123 mentioned this issue Jun 22, 2021
@NicolasCARPi
Copy link
Collaborator

Does it seem reasonable to all if I just remove the sorting function and let the order in which it was parsed be the one in the output doc? The code is not working anyway and seems hard to fix. Also, I love removing code ^^

@singla96
Copy link

singla96 commented Jun 27, 2021

@NicolasCARPi this will be helpful. also any new params can just b added at last of documentation, instead of comparing various versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fixed on dev for issues fixed on dev branch
Projects
None yet
Development

No branches or pull requests

4 participants