[ 
https://issues.apache.org/jira/browse/ARIES-2032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17272641#comment-17272641
 ] 

Carlos Sierra Andrés commented on ARIES-2032:
---------------------------------------------

Hi there,

as discussed in the slack channel this is caused by the default behavior of 
Swagger, that uses the simple name to name the types in the resulting schema.

In order to modify this behavior we are allowing to register {{ModelConverter}} 
services that affect (among other things) how these types names are generated.

Ideally we would build a whiteboard that would allow specific resolvers to be 
_registered_ to OpenAPI instances. Alas, swagger does not allow to do this 
since the {{ModelConverter}}s are registered globally for all the users of the 
library on a static level.

Carlos.

> Aries JAX-RS OpenAPI integration picks up wrong classes for spec generation
> ---------------------------------------------------------------------------
>
>                 Key: ARIES-2032
>                 URL: https://issues.apache.org/jira/browse/ARIES-2032
>             Project: Aries
>          Issue Type: Bug
>          Components: jax-rs-whiteboard
>    Affects Versions: jax-rs-whiteboard-1.1.0
>            Reporter: Thomas Driessen
>            Priority: Minor
>
> If two endpoints, e.g., /item and /test, have a return type that is named the 
> same, e.g., Metadata, but are from different packages, e.g., 
> io.jatoms.Metadata and io.jatoms.test.Metadata, then only one is picked up 
> for the spec generation and therefore one endpoint will have false 
> information in its description.
>  
> I've created a sample repository showcasing this bug: 
> [Sandared/osgi-openapi-example at openapi-bug 
> (github.com)|https://github.com/Sandared/osgi-openapi-example/tree/openapi-bug]
>  
> There two endpoint have return types that are named the same (Metadata), but 
> are actually two classes from different packages 
> (io.jatoms.osgi.openapi.model.test.Metadata and 
> io.jatoms.osgi.openapi.model.Metadata).
> One Metadata class defines a field "id" and the other one "testid", however 
> in the generated documentation only one of these is generated. 
>  
> Expected behavior would be that each endpoint documentation references its 
> respective Metadata type.
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to