Closed
Description
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- Have you validated the input using an OpenAPI validator (example)?
- What's the version of OpenAPI Generator used?
- Have you search for related issues/PRs?
- What's the actual output vs expected output?
- [Optional] Bounty to sponsor the fix (example)
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