OpenAPITools / OpenAPITools/openapi-generator

[BUG] kotlin-spring doesn't process xml.name(but java-spring does)

Open
#9,612 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

java-spring generated code like: (notice the @XmlRootElement annotation)

/**
 * 微信支付结果通知响应报文
 */
@ApiModel(description = "微信支付结果通知响应报文")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@JacksonXmlRootElement(localName = "xml")
@XmlRootElement(name = "xml")
@XmlAccessorType(XmlAccessType.FIELD)
public class WxPayNotifyRes  implements Serializable {
// ...
}

kotlin-spring generated code like:

/**
 * 微信支付结果通知响应报文
 * @param returnCode SUCCESS/FAIL  SUCCESS表示商户接收通知成功并校验成功
 * @param returnMsg 返回信息,如非空,为错误原因:  签名失败  参数格式校验错误
 */
data class WxPayNotifyRes(

    @field:JsonProperty("return_code", required = true) val returnCode: kotlin.String,

    @field:JsonProperty("return_msg", required = true) val returnMsg: kotlin.String
) {

}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare the java-spring and kotlin-spring generators using the XML schema property described in the issue, starting with how each generator processes xml.name. Reproduce the generated models and verify that kotlin-spring emits the equivalent XML root metadata when xml.name is set.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kotlin, openapi, spring
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.