Openapi-generator: Inconsistent filenames in Typescript

Created on 16 Oct 2018  路  7Comments  路  Source: OpenAPITools/openapi-generator

Description

When using the argument fileNaming=kebab-case, the names in the api services are inconsistent with the actual filenames.

Api: MySetType1Type2 -> my_set_type1_type2
Filename: mysettype1_type2

openapi-generator version

3.3.1

Steps to reproduce

Declarations which include special characters (https://github.com/OpenAPITools/openapi-generator/issues/1137) and generate with: fileNaming=kebab-case

TypeScript Bug

All 7 comments

@smasala do you mind sharing a spec to reproduce the issue more easily?

cc @TiFu (2017/07) @taxpon (2017/07) @sebastianhaas (2017/07) @kenisteward (2017/07) @Vrolijkx (2017/09) @macjohnny (2018/01) @nicokoenig (2018/09)

I have a similar issue with camelCase:

MySet[Type1] in spec file becomes:
mySet_Type1.ts

but import in api service is:

import { MySetType1 } from '../model/mySetType1';

I used 3.3.1 with typescript-angular generator.

We use a .Net Core backend with Swashbuckle generator. We have classes like MySet<Type1> which results in MySet[Type1] in the swagger.json file.

Version 3.2.3 didn't have this issue (filenames didn't get the underscore).

@andrehaveman I've merged the PR by @smasala into master. Can you give it a try using the SNAPSHOT version or the docker image?

@wing328 Yes, it's working again. @smasala Thanks for fixing this :+1:.

@wing328 did this really make it into 3.3.3? The dock hub image generates wrong file names still but locally on master branch it is correct with the same spec.

Was this page helpful?
0 / 5 - 0 ratings