[jboss-jira] [JBoss JIRA] (WFLY-13333) Openapi endpoint returns empty file if schema definition contains non ASCII character

Paul Ferraro (Jira) issues at jboss.org
Thu Apr 2 14:10:15 EDT 2020


     [ https://issues.redhat.com/browse/WFLY-13333?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Ferraro updated WFLY-13333:
--------------------------------
    Git Pull Request: https://github.com/wildfly/wildfly/pull/13171, https://github.com/wildfly/wildfly/pull/13172  (was: https://github.com/wildfly/wildfly/pull/13171)


> Openapi endpoint returns empty file if schema definition contains non ASCII character
> -------------------------------------------------------------------------------------
>
>                 Key: WFLY-13333
>                 URL: https://issues.redhat.com/browse/WFLY-13333
>             Project: WildFly
>          Issue Type: Bug
>          Components: MP OpenAPI
>    Affects Versions: 19.0.0.Final
>            Reporter: Márk Petrényi
>            Assignee: Paul Ferraro
>            Priority: Major
>
> Currently the {{/openapi}} endpoint returns empty file if the OpenAPI schema definition contains non ASCII characters (ie. accented letters like á,í...).
> I extended the openapi quickstart for demonstration: https://github.com/petrenyi-mark/quickstart/commit/44096980ff36ff2655859f9b10f8d0bd4c76bfbb
> It seems like it is related to the content-length, since in {{OpenAPIHttpHandler}} the content-length header is set by {{String.length()}} (line 125). However before the response is actually returned, undertow validates that the actual content-length based on ByteBuffer size is not greater then the one declared in the response header. Since non ASCII characters are usually represented by 2 bytes undertow will fail, thus no content will be returned.
> In {{OpenAPIHttpHandler}} setting {{string.getBytes(charset).length}} as Conetnt-Length instead of {{String.length()}} would likely resolve this issue.



--
This message was sent by Atlassian Jira
(v7.13.8#713008)



More information about the jboss-jira mailing list