-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[csharp] - fix json encoding override on form params #5217
Conversation
👍 Thanks for opening this issue! The team will review the labels and make any necessary changes. |
@@ -22,7 +22,7 @@ | |||
public class CodegenParameter implements IJsonSchemaValidationProperties { | |||
public boolean isFormParam, isQueryParam, isPathParam, isHeaderParam, | |||
isCookieParam, isBodyParam, hasMore, isContainer, | |||
secondaryParam, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode; | |||
secondaryParam, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, jsonEncoding; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In OAI 3.0, encoding can be specified besides application/json
, so this method seems to have low extensibility.
This change will affect the entire openapi-generator and will require a maintainers review.
cc. @wing328 @jimschubert
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. If you need custom logic, I think a vendor extension would be more appropriate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not quite sure I follow - from what I read about vendor extensions on the docs, they are meant for functionality that is not covered by the standard OpenAPI Specification . This isn't custom logic, this is functionality that is part of the OAI specification, and is currently ignored by the OAI generator.
I do agree that other encoding types can be specified and should be supported as well, but since the objects already include a ToJson(), it seemed like an easy win for those that need it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@milesressler please follow isJson
approach in Dart client generator:
Line 272 in 8d6286d
boolean isJson = true; //default to JSON |
Let me know if you need help. You can PM me via Slack (mentioned in the readme)
Closed via #7293 |
See issue 5215 relating to encoding not supported on form parameters
@mandrean @jimschubert @frankyjuang @shibayan