Skip to content

Stale files within fn/ do not get deleted #399

@Ionaru

Description

@Ionaru

Description

Stale API function files within fn/ do not get deleted when the API that was previously generated is now excluded or deleted.

Repro:

  1. Generate a new client using default settings and this schema:
openapi: 3.1.0
info:
  title: Delete test
  version: "1"
paths:
  /first-path:
    get:
      tags:
        - pet
  /second-path:
    get:
      tags:
        - store

It generated src\app\api\fn\pet\first-path-get.ts and src\app\api\fn\store\second-path-get.ts.

  1. Modify the schema (delete the second path)
openapi: 3.1.0
info:
  title: Delete test
  version: "2"
paths:
  /first-path:
    get:
      tags:
        - pet
  1. Regenerate using the default settings

Both src\app\api\fn\pet\first-path-get.ts and src\app\api\fn\store\second-path-get.ts still exist while src\app\api\fn\store\second-path-get.ts should have been deleted.

This also seems to happen with models in models/.


Workaround

We currently remove the entire generated folder using rimraf before regenerating it.

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