"oneOf" from superclass schema is propagated to subclasses unexpectedly #3054
              
                
                  
                  
                    Answered
                  
                  by
                    Mattias-Sehlstedt
                  
              
          
                  
                    
                      YoungHoney
                    
                  
                
                  asked this question in
                Q&A
              
            -
Beta Was this translation helpful? Give feedback.
      
      
          Answered by
          
            Mattias-Sehlstedt
          
      
      
        Aug 9, 2025 
      
    
    Replies: 1 comment 1 reply
-
| Hi @YoungHoney, This is an issue I am familiar with, it has been discussed here. It has to do with how swagger-core introspects. It both parses the  There are several different solutions to this, with the main thing being that you need to not have both annotations on the same object. | 
Beta Was this translation helpful? Give feedback.
                  
                    1 reply
                  
                
            
      Answer selected by
        YoungHoney
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    

Hi @YoungHoney,
This is an issue I am familiar with, it has been discussed here. It has to do with how swagger-core introspects. It both parses the
@JsonSubTypesannotation but also the@Schemaannotation, meaning that the generated OpenApi object tries to express two different ways of representing polymorphism.There are several different solutions to this, with the main thing being that you need to not have both annotations on the same object.