Get "Invalid UTF-8 middle byte ..." error when run java with default character encoding different from UTF-* (for example -Dfile.encoding=windows-1251) and call readContents() for swagger specification containing characters other than Latin (for example Cyrillic).
Problem in line:
mapper.readTree(swaggerAsString.getBytes());
where the default encoding is used
Should be
mapper.readTree(swaggerAsString);
since there is no need to call getBytes()