Skip to content
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

Closed

Conversation

milesressler
Copy link

See issue 5215 relating to encoding not supported on form parameters

@mandrean @jimschubert @frankyjuang @shibayan

@auto-labeler
Copy link

auto-labeler bot commented Feb 5, 2020

👍 Thanks for opening this issue!
🏷 I have applied any labels matching special text in your 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;
Copy link
Contributor

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

Copy link
Member

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.

Copy link
Author

@milesressler milesressler Feb 6, 2020

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.

Copy link
Member

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:

Let me know if you need help. You can PM me via Slack (mentioned in the readme)

@wing328 wing328 mentioned this pull request Aug 25, 2020
6 tasks
@wing328
Copy link
Member

wing328 commented Aug 26, 2020

Closed via #7293

@wing328 wing328 closed this Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants