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

Fix request body content type bug of SDK library. #987

Merged
merged 1 commit into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deploy/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const setup = (tag) => (version) => (directory) => {

// SETUP UPDATED DEPENDENCIES
fs.writeFileSync(file, JSON.stringify(info, null, 2), "utf8");
// execute(directory)("npm cache clean --force");
execute(directory)("npm cache clean --force");
execute(directory)(`npm install`);
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@nestia/station",
"version": "3.11.0",
"version": "3.11.1",
"description": "Nestia station",
"scripts": {
"build": "node build/index.js",
Expand Down
6 changes: 3 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nestia/core",
"version": "3.11.0",
"version": "3.11.1",
"description": "Super-fast validation decorators of NestJS",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down Expand Up @@ -36,7 +36,7 @@
},
"homepage": "https://nestia.io",
"dependencies": {
"@nestia/fetcher": "^3.11.0",
"@nestia/fetcher": "^3.11.1",
"@nestjs/common": ">=7.0.1",
"@nestjs/core": ">=7.0.1",
"@samchon/openapi": "^0.4.5",
Expand All @@ -53,7 +53,7 @@
"ws": "^7.5.3"
},
"peerDependencies": {
"@nestia/fetcher": ">=3.11.0",
"@nestia/fetcher": ">=3.11.1",
"@nestjs/common": ">=7.0.1",
"@nestjs/core": ">=7.0.1",
"reflect-metadata": ">=0.1.12",
Expand Down
2 changes: 1 addition & 1 deletion packages/fetcher/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nestia/fetcher",
"version": "3.11.0",
"version": "3.11.1",
"description": "Fetcher library of Nestia SDK",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down
10 changes: 5 additions & 5 deletions packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nestia/sdk",
"version": "3.11.0",
"version": "3.11.1",
"description": "Nestia SDK and Swagger generator",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down Expand Up @@ -32,8 +32,8 @@
},
"homepage": "https://nestia.io",
"dependencies": {
"@nestia/core": "^3.11.0",
"@nestia/fetcher": "^3.11.0",
"@nestia/core": "^3.11.1",
"@nestia/fetcher": "^3.11.1",
"@samchon/openapi": "^0.4.5",
"@wrtnio/openai-function-schema": "^0.2.3",
"cli": "^1.0.1",
Expand All @@ -48,8 +48,8 @@
"typia": "^6.8.0"
},
"peerDependencies": {
"@nestia/core": ">=3.11.0",
"@nestia/fetcher": ">=3.11.0",
"@nestia/core": ">=3.11.1",
"@nestia/fetcher": ">=3.11.1",
"@nestjs/common": ">=7.0.1",
"@nestjs/core": ">=7.0.1",
"reflect-metadata": ">=0.1.12",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export namespace SdkHttpFunctionProgrammer {
: [TypeFactory.keyword("any"), TypeFactory.keyword("any")]
: undefined,
[
props.input?.contentType !== "multipart/form-data"
props.input && props.input.contentType !== "multipart/form-data"
? ts.factory.createObjectLiteralExpression(
[
ts.factory.createSpreadAssignment(
Expand Down
38 changes: 10 additions & 28 deletions test/features/app/src/api/functional/bbs/articles/comments/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,11 @@ export async function index(
articleId: string & Format<"uuid">,
query: index.Query,
): Promise<index.Output> {
return PlainFetcher.fetch(
{
...connection,
headers: {
...connection.headers,
"Content-Type": "application/json",
},
},
{
...index.METADATA,
template: index.METADATA.path,
path: index.path(section, articleId, query),
},
);
return PlainFetcher.fetch(connection, {
...index.METADATA,
template: index.METADATA.path,
path: index.path(section, articleId, query),
});
}
export namespace index {
export type Query = Resolved<IPage.IRequest>;
Expand Down Expand Up @@ -81,20 +72,11 @@ export async function at(
articleId: string & Format<"uuid">,
id: string & Format<"uuid">,
): Promise<at.Output> {
return PlainFetcher.fetch(
{
...connection,
headers: {
...connection.headers,
"Content-Type": "application/json",
},
},
{
...at.METADATA,
template: at.METADATA.path,
path: at.path(section, articleId, id),
},
);
return PlainFetcher.fetch(connection, {
...at.METADATA,
template: at.METADATA.path,
path: at.path(section, articleId, id),
});
}
export namespace at {
export type Output = Primitive<IBbsComment>;
Expand Down
38 changes: 10 additions & 28 deletions test/features/app/src/api/functional/bbs/articles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,11 @@ export async function index(
section: string,
query: index.Query,
): Promise<index.Output> {
return PlainFetcher.fetch(
{
...connection,
headers: {
...connection.headers,
"Content-Type": "application/json",
},
},
{
...index.METADATA,
template: index.METADATA.path,
path: index.path(section, query),
},
);
return PlainFetcher.fetch(connection, {
...index.METADATA,
template: index.METADATA.path,
path: index.path(section, query),
});
}
export namespace index {
export type Query = Resolved<IPage.IRequest>;
Expand Down Expand Up @@ -77,20 +68,11 @@ export async function at(
section: string,
id: string & Format<"uuid">,
): Promise<at.Output> {
return PlainFetcher.fetch(
{
...connection,
headers: {
...connection.headers,
"Content-Type": "application/json",
},
},
{
...at.METADATA,
template: at.METADATA.path,
path: at.path(section, id),
},
);
return PlainFetcher.fetch(connection, {
...at.METADATA,
template: at.METADATA.path,
path: at.path(section, id),
});
}
export namespace at {
export type Output = Primitive<IBbsArticle>;
Expand Down
19 changes: 5 additions & 14 deletions test/features/app/src/api/functional/health/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,11 @@ import { PlainFetcher } from "@nestia/fetcher/lib/PlainFetcher";
* @nestia Generated by Nestia - https://github.com/samchon/nestia
*/
export async function get(connection: IConnection): Promise<void> {
return PlainFetcher.fetch(
{
...connection,
headers: {
...connection.headers,
"Content-Type": "application/json",
},
},
{
...get.METADATA,
template: get.METADATA.path,
path: get.path(),
},
);
return PlainFetcher.fetch(connection, {
...get.METADATA,
template: get.METADATA.path,
path: get.path(),
});
}
export namespace get {
export const METADATA = {
Expand Down
19 changes: 5 additions & 14 deletions test/features/app/src/api/functional/performance/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,11 @@ import type { IPerformance } from "../../structures/IPerformance";
* @nestia Generated by Nestia - https://github.com/samchon/nestia
*/
export async function get(connection: IConnection): Promise<get.Output> {
return PlainFetcher.fetch(
{
...connection,
headers: {
...connection.headers,
"Content-Type": "application/json",
},
},
{
...get.METADATA,
template: get.METADATA.path,
path: get.path(),
},
);
return PlainFetcher.fetch(connection, {
...get.METADATA,
template: get.METADATA.path,
path: get.path(),
});
}
export namespace get {
export type Output = Primitive<IPerformance>;
Expand Down
8 changes: 4 additions & 4 deletions test/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@samchon/nestia-test",
"version": "3.11.0",
"version": "3.11.1",
"description": "Test program of Nestia",
"main": "index.js",
"scripts": {
Expand All @@ -26,7 +26,7 @@
},
"homepage": "https://nestia.io",
"devDependencies": {
"@nestia/sdk": "^3.11.0",
"@nestia/sdk": "^3.11.1",
"@nestjs/swagger": "^7.1.2",
"@samchon/openapi": "^0.4.5",
"@types/express": "^4.17.17",
Expand All @@ -40,9 +40,9 @@
},
"dependencies": {
"@fastify/multipart": "^8.1.0",
"@nestia/core": "^3.11.0",
"@nestia/core": "^3.11.1",
"@nestia/e2e": "^0.7.0",
"@nestia/fetcher": "^3.11.0",
"@nestia/fetcher": "^3.11.1",
"@nestjs/common": "^10.3.5",
"@nestjs/core": "^10.3.5",
"@nestjs/platform-express": "^10.3.5",
Expand Down