@nestia/sdk 2.5.4 → 2.5.5-dev.20240213

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -309,8 +309,8 @@ export namespace SwaggerGenerator {
309
309
  const index: number = description.indexOf(".");
310
310
  if (index <= 0) return undefined;
311
311
 
312
- const content: string = description.substring(0, index).trim();
313
- return content.length ? content : undefined;
312
+ const str: string = description.substring(0, index).trim();
313
+ return str.length && str.includes("\n") === false ? str : undefined;
314
314
  })();
315
315
  const deprecated = route.jsDocTags.find(
316
316
  (tag) => tag.name === "deprecated",
@@ -17,8 +17,10 @@ export namespace SdkSimulationProgrammer {
17
17
  (checker: ts.TypeChecker) =>
18
18
  (config: INestiaConfig) =>
19
19
  (importer: ImportDictionary) =>
20
- (route: IRoute): ts.VariableStatement =>
21
- constant("random")(
20
+ (route: IRoute): ts.VariableStatement => {
21
+ const output =
22
+ SdkAliasCollection.responseBody(checker)(config)(importer)(route);
23
+ return constant("random")(
22
24
  ts.factory.createArrowFunction(
23
25
  undefined,
24
26
  undefined,
@@ -38,17 +40,23 @@ export namespace SdkSimulationProgrammer {
38
40
  ),
39
41
  ),
40
42
  ],
41
- undefined,
43
+ config.primitive === false
44
+ ? output
45
+ : ts.factory.createTypeReferenceNode(
46
+ SdkImportWizard.Resolved(importer),
47
+ [output],
48
+ ),
42
49
  undefined,
43
50
  ts.factory.createCallExpression(
44
51
  IdentifierFactory.access(
45
52
  ts.factory.createIdentifier(SdkImportWizard.typia(importer)),
46
53
  )("random"),
47
- [SdkAliasCollection.responseBody(checker)(config)(importer)(route)],
54
+ [output],
48
55
  [ts.factory.createIdentifier("g")],
49
56
  ),
50
57
  ),
51
58
  );
59
+ };
52
60
 
53
61
  export const simulate =
54
62
  (config: INestiaConfig) =>