Description
Stale API function files within fn/ do not get deleted when the API that was previously generated is now excluded or deleted.
Repro:
- 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.
- Modify the schema (delete the second path)
openapi: 3.1.0
info:
title: Delete test
version: "2"
paths:
/first-path:
get:
tags:
- pet
- 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.
Description
Stale API function files within
fn/do not get deleted when the API that was previously generated is now excluded or deleted.Repro:
It generated
src\app\api\fn\pet\first-path-get.tsandsrc\app\api\fn\store\second-path-get.ts.Both
src\app\api\fn\pet\first-path-get.tsandsrc\app\api\fn\store\second-path-get.tsstill exist whilesrc\app\api\fn\store\second-path-get.tsshould have been deleted.This also seems to happen with models in
models/.Workaround
We currently remove the entire generated folder using
rimrafbefore regenerating it.