[JAVA] incorrect import mapping of alias types
Created by: bkoziak
[JAVA] incorrect import mapping of alias types
Description
Hi guys,
I've hit the wall trying to use importMapping together with type aliases. I'm a newbie when it comes to openapi so forgive me if I used wrong terms or something. Here's an example of what I wanted to achieve (use below yaml as a reference):
- I've created
TypeAlias
which aliasesstring
- I used
TypeAlias
as $ref for propertytypeAlias
ofParentType
schema - I configured openapi-generator-maven-plugin to map
TypeAlias
tofoo.bar.TypeAlias
- As a result
typeAlias
was generated asString
instead offoo.bar.TypeAlias
openapi-generator version
master - 4.1.0-SNAPSHOT, 4.0.0, 3.x.x
OpenAPI declaration file content or url
openapi: 3.0.0
info:
title: Sample API
description: API description in Markdown.
version: 1.0.0
paths:
/type-alias:
get:
responses:
200:
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ParentType'
components:
schemas:
ParentType:
title: ParentType
type: object
properties:
typeAlias:
$ref: '#/components/schemas/TypeAlias'
TypeAlias:
type: string
Command line used for generation
Maven plugin with following importMapping configuration:
<importMappings>
<importMapping>TypeAlias=foo.bar.TypeAlias</importMapping>
</importMappings>