title: Swagger doesn't resolve part of the references or resolve for one object but doesn't resolve for another object
body: <p>I'm trying to generate a Client with swagger. I have a yaml file that have references to another yaml files. All these files are in the same directory. The problem is that part of references are resolved, but part of them are not.</p>
  <p>For example, in my yaml file there 2 objects with the same reference:</p>
  <pre><code>$ref: TS29571_CommonData.yaml#/components/schemas/Snssai
  </code></pre>
  <p>In TS29571_CommonData.yaml it looks like:</p>
  <pre><code>Snssai:
    type: object
    properties:
      sst:
        type: integer
        minimum: 0
        maximum: 255
      sd:
        type: string
        pattern: '^[A-Fa-f0-9]{6}$'
    required:
      - sst
  </code></pre>
  <p>In one generated file it's resolved, there is correct import <code>import generated.model.Snssai;</code> and correct usage of this object. But in another file it looks like <code>import generated.model.TS29571CommonDataYamlcomponentsschemasSnssai;</code> and its red.</p>
  <p>This is my pom.xml</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
      xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;2.5.1&lt;/version&gt;
          &lt;relativePath/&gt; &lt;!-- lookup parent from repository --&gt;
      &lt;/parent&gt;
      &lt;groupId&gt;com.example&lt;/groupId&gt;
      &lt;artifactId&gt;SwaggerMultipleYaml&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;name&gt;SwaggerMultipleYaml&lt;/name&gt;
      &lt;description&gt;Demo project for Spring Boot&lt;/description&gt;
      &lt;properties&gt;
          &lt;java.version&gt;1.8&lt;/java.version&gt;
      &lt;/properties&gt;
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.swagger.core.v3&lt;/groupId&gt;
              &lt;artifactId&gt;swagger-annotations&lt;/artifactId&gt;
              &lt;version&gt;2.1.4&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate.validator&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-validator&lt;/artifactId&gt;
              &lt;version&gt;6.0.10.Final&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
              &lt;artifactId&gt;httpclient&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.squareup.okhttp3&lt;/groupId&gt;
              &lt;artifactId&gt;okhttp&lt;/artifactId&gt;
              &lt;version&gt;4.9.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.squareup.okhttp3&lt;/groupId&gt;
              &lt;artifactId&gt;logging-interceptor&lt;/artifactId&gt;
              &lt;version&gt;4.9.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.google.code.gson&lt;/groupId&gt;
              &lt;artifactId&gt;gson&lt;/artifactId&gt;
              &lt;version&gt;2.8.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.gsonfire&lt;/groupId&gt;
              &lt;artifactId&gt;gson-fire&lt;/artifactId&gt;
              &lt;version&gt;1.8.3&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.threeten&lt;/groupId&gt;
              &lt;artifactId&gt;threetenbp&lt;/artifactId&gt;
              &lt;version&gt;0.7.2&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;${project.parent.version}&lt;/version&gt;
              &lt;/plugin&gt;
  
              &lt;plugin&gt;
                  &lt;groupId&gt;io.swagger.codegen.v3&lt;/groupId&gt;
                  &lt;artifactId&gt;swagger-codegen-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.0.25&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;id&gt;c&lt;/id&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;generate&lt;/goal&gt;
                          &lt;/goals&gt;
                          &lt;configuration&gt;
                              &lt;inputSpec&gt;${project.basedir}/src/main/resources/specs/TS29508_Nsmf_EventExposure.yaml&lt;/inputSpec&gt;
                              &lt;language&gt;java&lt;/language&gt;
                              &lt;modelPackage&gt;generated.model&lt;/modelPackage&gt;
                              &lt;apiPackage&gt;generated.api&lt;/apiPackage&gt;
                              &lt;invokerPackage&gt;generated.invoker&lt;/invokerPackage&gt;
                              &lt;configOptions&gt;
                                  &lt;groupId&gt;${project.groupId}&lt;/groupId&gt;
                                  &lt;artifactId&gt;${project.artifactId}&lt;/artifactId&gt;
                                  &lt;artifactVersion&gt;${project.version}&lt;/artifactVersion&gt;
                                  &lt;library&gt;okhttp-gson&lt;/library&gt;
                              &lt;/configOptions&gt;
                          &lt;/configuration&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  <p>What could be a reason?</p>