Я использую openapi-generator-maven-plugin
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>4.1.3</version>
с опцией <withXml>true</withXml>
.
В моем файле определения сервиса yaml для описания моих действий REST (сообщения XML). У меня есть такая схема:
components:
schemas:
LoginRequest:
type: object
properties:
customerName:
type: string
xml:
name: customerName
attribute: false
wrapped: false
password:
type: string
xml:
name: hello
attribute: false
user:
type: string
xml:
name: user
attribute: false
wrapped: false
title: request
xml:
name: request
attribute: false
и определенный сервис:
paths:
/session/login:
post:
tags:
- sample-controller
summary: login
operationId: loginUsingPOST
requestBody:
content:
application/xml:
schema:
$ref: "#/components/schemas/LoginRequest"
description: request
required: true
responses:
"200":
description: OK
content:
application/xml:
schema:
$ref: "#/components/schemas/LoginResponse"
И я генерирую код клиента. Но когда я его использую, XML, отправляемый в запрос http, использует <LoginRequest>
, а не <request>
. Имеет имя тега. Кажется, что ни одна из моих данных -xml не учитывается генератором.