Skip to content

Cannot find name 'ref' #265

@Diokuz

Description

@Diokuz

I have an OpenAPI json like that:

{
  "swagger": "2.0",
  "definitions": {
    "Messages": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/definitions/Message"
      }
    },
    "Message": {
      "type": "object",
      "properties": {
        "code": {
          "type": "integer"
        },
        "text": {
          "type": "string"
        }
      }
    }
  }
}

Which results in typescript:

export interface definitions {
  Messages: { [key: string]: ref }
  Message: { code?: number; text?: string }
}

It is not valid, because of ref. What is ref, and why it is not defined?

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