Skip to content

Java Generics creating special characters in file names when generating typescript files #1137

@smasala

Description

@smasala
Description

When generating typescript files from Java classes that use generics, filenames are created with special characters. These characters themselves are not a problem, however they are not identical to the import declared in another generated file.

class MyClass<MyGenericType> ->generates -> MyClass«MyGenericType».ts.

SomeOtherGeneratedFile.ts -> imports -> import { MyClass } from 'MyClass-MyGenericType.ts';

openapi-generator version

latest

OpenAPI declaration file content or url
"MyClass«MyGeneric»": {
	"type": "object",
	"properties": {
		"messages": {
			"type": "array",
			"description": "list of additional messages to inform the client about tasks and activities performed and stuff processed during the execution",
			"items": {
				"$ref": "#/definitions/Message"
			}
		},
		"payload": {
			"description": "real data payload to be sent across as part of the envelope",
			"$ref": "#/definitions/MyGeneric"
		}
	},
	"title": "Envelope«MyGeneric»",
	"description": "Envelope holding metadata around the payload to be delivered from an endpoint"
}
Steps to reproduce

Java to Typescript generation

Suggest a fix/enhancement

A single and consistent convention.

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