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

feat: support request body encoding option #108

Merged
merged 9 commits into from
Apr 1, 2023

Conversation

Himenon
Copy link
Owner

@Himenon Himenon commented Apr 1, 2023

Summary

close: #104

https://swagger.io/docs/specification/describing-request-body/#:~:text=The%20serialization%20strategy%20is%20specified%20in%20the%20encoding%20section

+ export interface Encoding {
+     contentType?: string;
+     headers?: Record<string, any>;
+     style?: string;
+     explode?: boolean;
+     allowReserved?: boolean;
+ }
 export interface RequestArgs {
     httpMethod: HttpMethod;
     url: string;
     headers: ObjectLike | any;
     requestBody: ObjectLike | any;
     queryParameters: QueryParameters | undefined;
+    requestBodyEncoding?: Record<string, Encoding>;
 }

Test Plan

snapshot

@Himenon Himenon changed the title WIP feat: support request body encoding option feat: support request body encoding option Apr 1, 2023
});
} else if (convertedParams.requestFirstContentType) {
identifier = factory.Identifier.create({
name: JSON.stringify({ [convertedParams.requestFirstContentType]: encodingMap[convertedParams.requestFirstContentType] }, null, 2),
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add

@Himenon Himenon merged commit 025d53e into main Apr 1, 2023
@Himenon Himenon deleted the feat/support-encoding-option branch April 1, 2023 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: encoding option in requestBody is not respected.
1 participant