Cannot find name 'ref'

See original GitHub issue

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?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
wmonkcommented, Jul 1, 2020

Also facing this issue. Any ideas on a timeframe for a fix?

0reactions
drwpowcommented, Aug 8, 2020

Fixed (hopefully) in #266

Read more comments on GitHub >

github_iconTop Results From Across the Web

Typescript cannot find name even though it is referenced
I have an angular project I'm writing in typescript. This worked well for me under VS, and now I'm trying the same with...
Read more >
project refs gives "cannot find name" error #30424 - GitHub
In your project-refs-typeroots-bug/tsconfig because you don't have "files": [] its including all files in the tree which do include files from ...
Read more >
Angular - Cannot find name 'ElementRef' - Solved
This tutorial will provide example of Cannot find name 'ElementRef' in angular. this example will help you angular error ts2304 cannot find ...
Read more >
Fix the Cannot Find Name 'require' Error in TypeScript
To fix the “cannot find name 'require'” error in TypeScript, install the @types/node package into your project by running npm i -D @types/node...
Read more >
TypeScript error TS2304 cannot find name require - Edureka
The error that I'm getting is the "TS2304: Cannot find name 'require' " when I attempt to transpile a simple TypeScript Node.js page....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found