swagger2markup icon indicating copy to clipboard operation
swagger2markup copied to clipboard

separatedDefinitionsEnabled feature is broken or useless

Open alkemann opened this issue 8 years ago • 12 comments

If I enable the separatedDefinitionsEnabled feature I do get my definition objects created in individual files, but it still creates the "parent" page, which becomes just a list of H3 tags which anchor links to itself, when they obviously should link to individual files where the content is actually found.

Alternatively, who can I disable the generation of the definitions document, which is kinda pointless onces the content is moved out of it.

Swagger2Markup version: 1.3.1 & 1.3.2-SNAPSHOT

alkemann avatar Jul 06 '17 15:07 alkemann

Hi, true its pointless. Would you like to contribute a fix? I'm in vacation and afterwards busy at work. But I could merge a PR an create a new release.

RobWin avatar Jul 10 '17 10:07 RobWin

Yes I have the code running locally in Intellj but I cant figure out how to fix this. If you could give me some pointer in the right direction that would be great.

This isnt the only case of these broken links either. As far as I can see the default behavior is that the paths links to definitions also just link to an anchor in the same document.

alkemann avatar Jul 10 '17 11:07 alkemann

There is a swagger2markup configuration parameter which enables inter-document cross references.

RobWin avatar Jul 10 '17 12:07 RobWin

swagger2markup.interDocumentCrossReferencesEnabled

RobWin avatar Jul 10 '17 12:07 RobWin

I pressume you mean this: swagger2markup.interDocumentCrossReferencesEnabled

Why is this a config and how does it make sense to have it as false by default?

alkemann avatar Jul 10 '17 12:07 alkemann

Yes this did fix my issues. I would argue that the default setting for this option should be reversed, or even just removed at all as why someone wouldnt want their anchors to work I dont quite understand.

alkemann avatar Jul 10 '17 12:07 alkemann

Is there a way to just drop the list file when enabling the separetedenabled then becomes the remaining issue.

alkemann avatar Jul 10 '17 12:07 alkemann

Yes, you are right. I have to check the code again. I can't remember why it's false by default. It's some time ago since I programmed it.

RobWin avatar Jul 10 '17 12:07 RobWin

I can always just delete them after generation I guess.

So, of lower priority, this issue becomes a suggestion to reverse the default and to add a feature of optionally dropping the main documents, security, paths, definitions and/or overview

alkemann avatar Jul 10 '17 12:07 alkemann

Currently there is no way to skip the generation of the definitions file.

RobWin avatar Jul 10 '17 12:07 RobWin

most of these cross document links seems to work now, but the one that is still off is the link to security document from paths endpoints.

alkemann avatar Jul 10 '17 14:07 alkemann

Hi. I think separatedDefinitionsEnabled is false by default because in most cases you will generate single file (pdf or html) from markdown/asciidoc sources. In this case you need that references work within one file.

MaksimMyshkin avatar Oct 20 '19 08:10 MaksimMyshkin