geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Meen (JIRA)" <j...@apache.org>
Subject [jira] [Created] (GERONIMO-6692) OpenAPI SchemaProcessor causes a StackOverflowException when processing schema for a class field that reference's it's own class
Date Mon, 04 Feb 2019 11:13:00 GMT
James Meen created GERONIMO-6692:
------------------------------------

             Summary: OpenAPI SchemaProcessor causes a StackOverflowException when processing
schema for a class field that reference's it's own class
                 Key: GERONIMO-6692
                 URL: https://issues.apache.org/jira/browse/GERONIMO-6692
             Project: Geronimo
          Issue Type: Bug
      Security Level: public (Regular issues)
    Affects Versions: OpenAPI_1.0.5
            Reporter: James Meen


A webapp being scanned by SchemaProcessor class of the Geronimo OpenAPI extension has a field
that references the class it is a part of, for example...
{code:java}
public class aClass 
{ 
... 
  public List<aClass> getAList() { ... }
... 
}
{code}
There is no check in OpenAPI SchemaProcessor for this and it eventually causes a StackOverflowException.

I doubt this issue is limited to List and will probably also happen if the field type is singular
of the same parent class.

The front-end exception the user sees is completely unrelated to the real exception.  This
causes a great amount of debugging time stepping through to determine the root cause for a
relatively large application.

Propose to somehow either support this when mapping to an OpenAPI model.

Also, failing the possibility of a solution as above, this case should be detected by the
schema processor and handled accordingly either skipping the field and/or raising a suitable
warning/exception in a way that the user knows what/why it is failing or excluded (ultimately
to save the user having to debug through the schema processing).  A stackoverflow should
not happen.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message