Skip to content

[oats-runtime] TS6133: types and RequestContext is declared but its value is never read. #468

@serbanghita

Description

@serbanghita

Problem:

A openapi.yaml file containing only models (schemas) and no urls, will generate a client.ts file what throws TS6133 in the context of tsconfig.json configured with

     "noUnusedLocals": true,
    "noUnusedParameters": true,  

This will cause builds that are using the generated code to fail at compile time.

How to reproduce:

Create openapi.yaml file with the following contents:

openapi: 3.0.0
info:
  title: A test without urls
  version: 0.0.1
  description: Types for
servers: []
paths: {}

components:
  schemas:
    User:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string

Run generate.js which contains the boilerplate code from README.md:

TS6133: types is declared but its value is never read.
TS6133: RequestContext is declared but its value is never read.

Screenshot 2024-09-12 at 10 05 53

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