Conversation
| String[] minimum = {"200", "202", "204", "301", "400", "404", "415", "500"}; | ||
| String[] standard = {"200", "201", "202", "203", "204", "301", "304", "307", | ||
| private final String[] minimum = {"200", "202", "204", "301", "400", "404", "415", "500"}; | ||
| private final String[] standard = {"200", "201", "202", "203", "204", "301", "304", "307", |
There was a problem hiding this comment.
Why not
private static final String[] MINIMUM = {...} and
private static final String[] STANDARD = {...}?
There was a problem hiding this comment.
Youre right, why not - it is a part fo the latest commit, thank you for pointing to that.
| } | ||
|
|
||
| private void ApplySpecificHeadersAndResponses(Swagger api, Set<String> codes) { | ||
| private String findFileFormat(String fileAndPathName) { |
There was a problem hiding this comment.
Could be realized with streams? Not sure whether its more readable or not but you avoid the branching. The extensions could maybe also be added to the OutputFormat enumeration since this seems to be somewhat related to the extension - actually looking at the method name findFileFormat I might have expected it to return a FileFormat - it is actually returning a file name - isn't it? :-)
private String findFileFormat(final String fileAndPathName) {
return Arrays.asList(".json", ".yaml", ".yml").stream()
.filter(ext -> Files.exists(Paths.get(fileAndPathName + ext)))
.findAny()
.orElse(fileAndPathName);
}There was a problem hiding this comment.
Is part of the latest commit - thanks for suggesting that.
|
I guess this solves #1 (just to link the PR to the issue :-) ) |
Added code quality tooling and changed code accordingly