swagger2markup icon indicating copy to clipboard operation
swagger2markup copied to clipboard

Why not just skip empty tags?

Open marcelstoer opened this issue 7 years ago • 4 comments

With swagger2markup.pathsGroupedBy=TAGS the evaluation fails if there are no tags due to

https://github.com/Swagger2Markup/swagger2markup/blob/8e22dd817e5d4bef276894c0d5975d3c7254253d/src/main/java/io/github/swagger2markup/internal/document/PathsDocument.java#L121

I would argue that a hard failure is inappropriate here. Why not just log a warning and group by AS_IS (the default) instead?

marcelstoer avatar Mar 06 '18 08:03 marcelstoer

To signal that the user made a mistake and forgot to provide tags. If he wants to group by tags, he must provide tags.

RobWin avatar Mar 06 '18 13:03 RobWin

Now that we can process entire folders of Swagger files the case is slightly different I'd argue. I basically want to say "Group by tags if tags are available". Smaller service contracts in that folder may not have (and not need) tags.

marcelstoer avatar Mar 08 '18 07:03 marcelstoer

Would you like to provide a PR? Automatic fallback to AS_IS and output a warning.

RobWin avatar Mar 09 '18 16:03 RobWin

I meet the same problem and solved it with reflection.Maybe Setting the tag to some value is a solution.

ecoSakuraSou avatar Apr 01 '20 08:04 ecoSakuraSou