Repository navigation
Ensure the body parameter name is preserved - #967
Conversation
|
Is there any feedback on this PR? Are you rejecting the proposition? A while ago I did open a similar issue about preserving the name of the body parameter from the v2 Spec as extension in v3: #748 Please let us know if we can do anything to help this feature to moving forward (this PR can be rewritten if an other design decision is considered) |
Port pull request swagger-api#967
|
Please move forward with this. It has been a month and still no response - this causes major issues in dependent projects. Thank you |
|
please build |
| formParams.add(param); | ||
| } else if ("body".equals(param.getIn())) { | ||
| operation.setRequestBody(convertParameterToRequestBody(param, v2Operation.getConsumes())); | ||
| operation.addExtension("x-codegen-request-body-name", param.getName()); |
There was a problem hiding this comment.
It seems as though the name field's intent has been replaced by title, as evidenced by how the string "body" gets resolved in the converter:
where
I would propose a different direction, instead of adding a vendor extension, to just setTitle(param.getName()) and let the rest of the infrastructure wire the parameter through.
This will seamlessly resolve the issue for those who have migrated to the new title infrastructure.
There was a problem hiding this comment.
@gracekarina Out of curiosity, any thoughts on the direction of this comment? I still suspect adding a vendor extension that duplicates in-built behavior is causing a needless fork in functionality, but maybe I've misunderstood an aspect about the semantics between name and title here.
There was a problem hiding this comment.
Hi @blast-hardcheese I'll review the comment you made, if what you say is right I'll revert the PR. thanks for pointing us to that.
|
@wing328 could you please describe the purposes of this "x-codegen-request-body-name" extension. I am trying to figure out it and decide is it needed in my case or not. Am I right that it's needed for code generation in some languages? |
For #966
Related: #748