Skip to content

Commit

Permalink
chore(code-gen): cleanup RouteBuilder internalSettings
Browse files Browse the repository at this point in the history
Legacy code-gen used this, but the current code-gen has `metadata`. This is also settable via the public interface, `R.post().preferFormData()`.
  • Loading branch information
dirkdev98 committed May 13, 2023
1 parent 4bf6848 commit 1cd8f62
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
3 changes: 0 additions & 3 deletions packages/code-gen/src/builders/RouteBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,6 @@ export class RouteBuilder extends TypeBuilder {
this.data.metadata ??= {};
this.data.metadata.requestBodyType = "form-data";

this.data.internalSettings ??= {};
this.data.internalSettings.requestBodyType = "form-data";

return this;
}

Expand Down
5 changes: 0 additions & 5 deletions packages/code-gen/src/open-api-importer.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,12 @@ function extractRoute(context, path, method) {
compasStruct.metadata = {
requestBodyType: "json",
};
compasStruct.internalSettings = {
requestBodyType: "json",
stripTrailingSlash: !path.endsWith("/"),
};

if (
isNil(item.requestBody?.content?.["application/json"]) &&
!isNil(item.requestBody?.content?.["multipart/form-data"])
) {
contentKey = "multipart/form-data";
compasStruct.internalSettings.requestBodyType = "form-data";
compasStruct.metadata.requestBodyType = "form-data";
}

Expand Down

0 comments on commit 1cd8f62

Please sign in to comment.