Skip to content

OpenAPIV3Parser.readContents() encoding error #1196

@mkuraev

Description

@mkuraev

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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions