Bug Report Checklist
Description
Xml annotations have wrong values if $ref is used
openapi-generator version
4.3.0
OpenAPI declaration file content or url
openapi: 3.0.0
info:
title: API
version: 1.0.0
paths:
/:
post:
requestBody:
required: true
content:
application/xml:
schema:
$ref: '#/components/schemas/Request'
responses:
'200':
description: OK
components:
schemas:
Request:
type: object
properties:
simpleAttribute:
type: string
xml:
attribute: true
name: ATTR
refAttribute:
$ref: '#/components/schemas/RefAttribute'
simpleNode:
type: object
properties:
prop1:
type: string
prop2:
type: string
xml:
name: NODE
refNode:
$ref: '#/components/schemas/RefNode'
simpleArray:
type: array
items:
type: string
xml:
name: ARR_ITEM
simpleWrappedArray:
type: array
items:
type: string
xml:
name: ARR_ITEM
xml:
wrapped: true
name: WRAPPED_ARRAY
nodeArray:
type: array
items:
$ref: '#/components/schemas/RefNode'
wrappedNodeArray:
type: array
items:
$ref: '#/components/schemas/RefNode'
xml:
wrapped: true
name: WRAPPED_NODE_ARRAY
xml:
name: Request
RefAttribute:
type: string
enum: [A, B, C]
xml:
name: REF_ATTR
attribute: true
RefNode:
type: object
properties:
prop1:
type: string
prop2:
type: string
xml:
name: REF_NODE
Command line used for generation
generate -g java --library resttemplate -o C:\openapi-generator-tests -i C:\openapi-generator-tests\Schema.yaml --additional-properties=withXml=true,serializationLibrary=jackson,dateLibrary=java8-localdatetime --model-package=com.my.project
Steps to reproduce
Actual
https://gist.github.com/jzrebiec/1eb12e8511403e11d459d6ebd8cbfc5d
Expected
https://gist.github.com/jzrebiec/bda6719eae8222859d11f13197a757e2
Related issues/PRs
#3223 #2417 #5078 #5371
Suggest a fix
#5371
Bug Report Checklist
Description
Xml annotations have wrong values if
$refis usedopenapi-generator version
4.3.0
OpenAPI declaration file content or url
Command line used for generation
Steps to reproduce
Actual
https://gist.github.com/jzrebiec/1eb12e8511403e11d459d6ebd8cbfc5d
Expected
https://gist.github.com/jzrebiec/bda6719eae8222859d11f13197a757e2
Related issues/PRs
#3223 #2417 #5078 #5371
Suggest a fix
#5371