Bug Report Checklist
Description
When providing --global-property models to generate only models, the resultant TypeScript references ../api for importing RequestFile.
openapi-generator version
Not a regression that I know of.
OpenAPI declaration file content or url
Any valid OpenAPI file containing models will reproduce this.
openapi: 3.0.2
info:
version: 0.3.0
description: null
title: '@devsupply/core-types-typedefs'
paths:
/foo:
get:
tags:
- foo
operationId: getFoo
responses:
"204":
description: Foo
components:
schemas:
CloudProvider:
type: string
enum:
- AWS
- AZURE
- GOOGLE
x-enum-descriptions:
- Amazon AWS
- Microsoft Azure
- Google Cloud Platform
Generation Details
npx openapi-generator generate
-g typescript-node
--global-property models
-i ./example.yml -o gen/
Steps to reproduce
Generate code as above. Attempt to build via TypeScript:
npx tsc gen/model/cloudProvider.ts
Results in:
13 import { RequestFile } from '../api';
~~~~~~~~
Found 1 error.
Suggest a fix
Suggest moving the RequestFile definition into models.ts and also generating this file when --global-property models is provided. Will submit a PR with this fix...
Related Issue: #7040 (it should be noted that moving the RequestFile definition will not work until #7040 is addressed, as the validators import things from request)
Bug Report Checklist
Description
When providing
--global-property modelsto generate only models, the resultant TypeScript references../apifor importingRequestFile.openapi-generator version
Not a regression that I know of.
OpenAPI declaration file content or url
Any valid OpenAPI file containing models will reproduce this.
Generation Details
Steps to reproduce
Generate code as above. Attempt to build via TypeScript:
Results in:
Suggest a fix
Suggest moving the
RequestFiledefinition intomodels.tsand also generating this file when--global-property modelsis provided. Will submit a PR with this fix...Related Issue: #7040 (it should be noted that moving the
RequestFiledefinition will not work until #7040 is addressed, as the validators import things fromrequest)