Swagger2Markup / swagger2markup

A Swagger to AsciiDoc or Markdown converter to simplify the generation of an up-to-date RESTful API documentation by combining documentation that’s been hand-written with auto-generated API documentation.
Apache License 2.0
2.5k stars 381 forks source link

Why not just skip empty tags? #303

Open marcelstoer opened 6 years ago

marcelstoer commented 6 years ago

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?

RobWin commented 6 years ago

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

marcelstoer commented 6 years ago

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.

RobWin commented 6 years ago

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

ecoSakuraSou commented 4 years ago

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