Skip to content

RESPONSE refs can not be internal references. Why? #1388

@ChrisTitos

Description

@ChrisTitos

Hi,

I'm having troubles using the latest swagger-codegen. I get this error:

RESPONSE refs can not be internal references 
(through reference chain: io.swagger.models.RefResponse["$ref"]) 
(through reference chain: io.swagger.models.Path["get"]->io.swagger.models.Operation["responses"]->java.util.LinkedHashMap["404"]) 
(through reference chain: io.swagger.models.Swagger["paths"]->java.util.LinkedHashMap["/companies/{id}"])

This exception is thrown by swagger-core here:
https://github.com/swagger-api/swagger-core/blob/master/modules/swagger-models/src/main/java/io/swagger/models/refs/GenericRef.java#L37

In the comment it says "PATH AND RESPONSE refs can only be URL or RELATIVE", but my question is, where does it say this in the spec? The Responses object doesn't mention any limitations to a reference object.

I might be missing something, but this exception confused me (especially because the online codegen doesn't complain)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions