nestjs-openapi 0.2.2 → 0.3.1

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.
@@ -1141,10 +1141,10 @@ interface ExtractParametersOptions {
1141
1141
  }
1142
1142
  declare const getMethodInfo: (controller: ClassDeclaration, method: MethodDeclaration, options?: ExtractParametersOptions) => Option.Option<MethodInfo>;
1143
1143
  declare const getMethodInfoEffect: (controller: ClassDeclaration, method: MethodDeclaration, options?: ExtractParametersOptions | undefined) => Effect.Effect<Option.Option<{
1144
- readonly httpMethod: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD" | "ALL";
1145
1144
  readonly path: string;
1146
- readonly methodName: string;
1147
1145
  readonly controllerName: string;
1146
+ readonly methodName: string;
1147
+ readonly httpMethod: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD" | "ALL";
1148
1148
  readonly controllerTags: readonly string[];
1149
1149
  readonly returnType: {
1150
1150
  readonly filePath: Option.Option<string>;
@@ -1167,8 +1167,8 @@ declare const getMethodInfoEffect: (controller: ClassDeclaration, method: Method
1167
1167
  readonly deprecated: Option.Option<boolean>;
1168
1168
  };
1169
1169
  readonly responses: readonly {
1170
- readonly type: Option.Option<string>;
1171
1170
  readonly description: Option.Option<string>;
1171
+ readonly type: Option.Option<string>;
1172
1172
  readonly statusCode: number;
1173
1173
  readonly isArray: boolean;
1174
1174
  }[];
@@ -1182,10 +1182,10 @@ declare const getMethodInfoEffect: (controller: ClassDeclaration, method: Method
1182
1182
  }>, never, never>;
1183
1183
  declare const getControllerMethodInfos: (controller: ClassDeclaration, options?: ExtractParametersOptions) => readonly MethodInfo[];
1184
1184
  declare const getControllerMethodInfosEffect: (controller: ClassDeclaration, options?: ExtractParametersOptions | undefined) => Effect.Effect<{
1185
- readonly httpMethod: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD" | "ALL";
1186
1185
  readonly path: string;
1187
- readonly methodName: string;
1188
1186
  readonly controllerName: string;
1187
+ readonly methodName: string;
1188
+ readonly httpMethod: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD" | "ALL";
1189
1189
  readonly controllerTags: readonly string[];
1190
1190
  readonly returnType: {
1191
1191
  readonly filePath: Option.Option<string>;
@@ -1208,8 +1208,8 @@ declare const getControllerMethodInfosEffect: (controller: ClassDeclaration, opt
1208
1208
  readonly deprecated: Option.Option<boolean>;
1209
1209
  };
1210
1210
  readonly responses: readonly {
1211
- readonly type: Option.Option<string>;
1212
1211
  readonly description: Option.Option<string>;
1212
+ readonly type: Option.Option<string>;
1213
1213
  readonly statusCode: number;
1214
1214
  readonly isArray: boolean;
1215
1215
  }[];
@@ -1225,10 +1225,10 @@ declare const MethodExtractionService_base: Effect.Service.Class<MethodExtractio
1225
1225
  readonly accessors: true;
1226
1226
  readonly effect: Effect.Effect<{
1227
1227
  getMethodInfo: (controller: ClassDeclaration, method: MethodDeclaration, options?: ExtractParametersOptions | undefined) => Effect.Effect<Option.Option<{
1228
- readonly httpMethod: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD" | "ALL";
1229
1228
  readonly path: string;
1230
- readonly methodName: string;
1231
1229
  readonly controllerName: string;
1230
+ readonly methodName: string;
1231
+ readonly httpMethod: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD" | "ALL";
1232
1232
  readonly controllerTags: readonly string[];
1233
1233
  readonly returnType: {
1234
1234
  readonly filePath: Option.Option<string>;
@@ -1251,8 +1251,8 @@ declare const MethodExtractionService_base: Effect.Service.Class<MethodExtractio
1251
1251
  readonly deprecated: Option.Option<boolean>;
1252
1252
  };
1253
1253
  readonly responses: readonly {
1254
- readonly type: Option.Option<string>;
1255
1254
  readonly description: Option.Option<string>;
1255
+ readonly type: Option.Option<string>;
1256
1256
  readonly statusCode: number;
1257
1257
  readonly isArray: boolean;
1258
1258
  }[];
@@ -1265,10 +1265,10 @@ declare const MethodExtractionService_base: Effect.Service.Class<MethodExtractio
1265
1265
  }[];
1266
1266
  }>, never, never>;
1267
1267
  getControllerMethodInfos: (controller: ClassDeclaration, options?: ExtractParametersOptions | undefined) => Effect.Effect<{
1268
- readonly httpMethod: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD" | "ALL";
1269
1268
  readonly path: string;
1270
- readonly methodName: string;
1271
1269
  readonly controllerName: string;
1270
+ readonly methodName: string;
1271
+ readonly httpMethod: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD" | "ALL";
1272
1272
  readonly controllerTags: readonly string[];
1273
1273
  readonly returnType: {
1274
1274
  readonly filePath: Option.Option<string>;
@@ -1291,8 +1291,8 @@ declare const MethodExtractionService_base: Effect.Service.Class<MethodExtractio
1291
1291
  readonly deprecated: Option.Option<boolean>;
1292
1292
  };
1293
1293
  readonly responses: readonly {
1294
- readonly type: Option.Option<string>;
1295
1294
  readonly description: Option.Option<string>;
1295
+ readonly type: Option.Option<string>;
1296
1296
  readonly statusCode: number;
1297
1297
  readonly isArray: boolean;
1298
1298
  }[];
@@ -1335,9 +1335,9 @@ declare const ConfigService_base: Effect.Service.Class<ConfigService, "ConfigSer
1335
1335
  readonly format?: "json" | "yaml" | undefined;
1336
1336
  readonly extends?: string | undefined;
1337
1337
  readonly files?: {
1338
- readonly dtoGlob?: string | readonly string[] | undefined;
1339
1338
  readonly tsconfig?: string | undefined;
1340
1339
  readonly entry?: string | readonly string[] | undefined;
1340
+ readonly dtoGlob?: string | readonly string[] | undefined;
1341
1341
  readonly include?: readonly string[] | undefined;
1342
1342
  readonly exclude?: readonly string[] | undefined;
1343
1343
  } | undefined;
@@ -1346,20 +1346,20 @@ declare const ConfigService_base: Effect.Service.Class<ConfigService, "ConfigSer
1346
1346
  readonly security?: {
1347
1347
  readonly schemes?: readonly ({
1348
1348
  readonly name: string;
1349
- readonly type: "http";
1350
1349
  readonly description?: string | undefined;
1350
+ readonly type: "http";
1351
1351
  readonly scheme: string;
1352
1352
  readonly bearerFormat?: string | undefined;
1353
1353
  } | {
1354
1354
  readonly name: string;
1355
- readonly type: "apiKey";
1356
1355
  readonly description?: string | undefined;
1356
+ readonly type: "apiKey";
1357
1357
  readonly in: "query" | "header" | "cookie";
1358
1358
  readonly parameterName: string;
1359
1359
  } | {
1360
1360
  readonly name: string;
1361
- readonly type: "oauth2";
1362
1361
  readonly description?: string | undefined;
1362
+ readonly type: "oauth2";
1363
1363
  readonly flows: {
1364
1364
  readonly implicit?: {
1365
1365
  readonly scopes?: {
@@ -1396,8 +1396,8 @@ declare const ConfigService_base: Effect.Service.Class<ConfigService, "ConfigSer
1396
1396
  };
1397
1397
  } | {
1398
1398
  readonly name: string;
1399
- readonly type: "openIdConnect";
1400
1399
  readonly description?: string | undefined;
1400
+ readonly type: "openIdConnect";
1401
1401
  readonly openIdConnectUrl: string;
1402
1402
  })[] | undefined;
1403
1403
  readonly global?: readonly {
@@ -1411,8 +1411,8 @@ declare const ConfigService_base: Effect.Service.Class<ConfigService, "ConfigSer
1411
1411
  readonly version?: "3.0.3" | "3.1.0" | "3.2.0" | undefined;
1412
1412
  readonly info: {
1413
1413
  readonly description?: string | undefined;
1414
- readonly version: string;
1415
1414
  readonly title: string;
1415
+ readonly version: string;
1416
1416
  readonly contact?: {
1417
1417
  readonly name?: string | undefined;
1418
1418
  readonly email?: string | undefined;
@@ -1445,9 +1445,9 @@ declare const ConfigService_base: Effect.Service.Class<ConfigService, "ConfigSer
1445
1445
  readonly format?: "json" | "yaml" | undefined;
1446
1446
  readonly extends?: string | undefined;
1447
1447
  readonly files?: {
1448
- readonly dtoGlob?: string | readonly string[] | undefined;
1449
1448
  readonly tsconfig?: string | undefined;
1450
1449
  readonly entry?: string | readonly string[] | undefined;
1450
+ readonly dtoGlob?: string | readonly string[] | undefined;
1451
1451
  readonly include?: readonly string[] | undefined;
1452
1452
  readonly exclude?: readonly string[] | undefined;
1453
1453
  } | undefined;
@@ -1456,20 +1456,20 @@ declare const ConfigService_base: Effect.Service.Class<ConfigService, "ConfigSer
1456
1456
  readonly security?: {
1457
1457
  readonly schemes?: readonly ({
1458
1458
  readonly name: string;
1459
- readonly type: "http";
1460
1459
  readonly description?: string | undefined;
1460
+ readonly type: "http";
1461
1461
  readonly scheme: string;
1462
1462
  readonly bearerFormat?: string | undefined;
1463
1463
  } | {
1464
1464
  readonly name: string;
1465
- readonly type: "apiKey";
1466
1465
  readonly description?: string | undefined;
1466
+ readonly type: "apiKey";
1467
1467
  readonly in: "query" | "header" | "cookie";
1468
1468
  readonly parameterName: string;
1469
1469
  } | {
1470
1470
  readonly name: string;
1471
- readonly type: "oauth2";
1472
1471
  readonly description?: string | undefined;
1472
+ readonly type: "oauth2";
1473
1473
  readonly flows: {
1474
1474
  readonly implicit?: {
1475
1475
  readonly scopes?: {
@@ -1506,8 +1506,8 @@ declare const ConfigService_base: Effect.Service.Class<ConfigService, "ConfigSer
1506
1506
  };
1507
1507
  } | {
1508
1508
  readonly name: string;
1509
- readonly type: "openIdConnect";
1510
1509
  readonly description?: string | undefined;
1510
+ readonly type: "openIdConnect";
1511
1511
  readonly openIdConnectUrl: string;
1512
1512
  })[] | undefined;
1513
1513
  readonly global?: readonly {
@@ -1521,8 +1521,8 @@ declare const ConfigService_base: Effect.Service.Class<ConfigService, "ConfigSer
1521
1521
  readonly version?: "3.0.3" | "3.1.0" | "3.2.0" | undefined;
1522
1522
  readonly info: {
1523
1523
  readonly description?: string | undefined;
1524
- readonly version: string;
1525
1524
  readonly title: string;
1525
+ readonly version: string;
1526
1526
  readonly contact?: {
1527
1527
  readonly name?: string | undefined;
1528
1528
  readonly email?: string | undefined;
@@ -1555,9 +1555,9 @@ declare const ConfigService_base: Effect.Service.Class<ConfigService, "ConfigSer
1555
1555
  readonly format?: "json" | "yaml" | undefined;
1556
1556
  readonly extends?: string | undefined;
1557
1557
  readonly files?: {
1558
- readonly dtoGlob?: string | readonly string[] | undefined;
1559
1558
  readonly tsconfig?: string | undefined;
1560
1559
  readonly entry?: string | readonly string[] | undefined;
1560
+ readonly dtoGlob?: string | readonly string[] | undefined;
1561
1561
  readonly include?: readonly string[] | undefined;
1562
1562
  readonly exclude?: readonly string[] | undefined;
1563
1563
  } | undefined;
@@ -1566,20 +1566,20 @@ declare const ConfigService_base: Effect.Service.Class<ConfigService, "ConfigSer
1566
1566
  readonly security?: {
1567
1567
  readonly schemes?: readonly ({
1568
1568
  readonly name: string;
1569
- readonly type: "http";
1570
1569
  readonly description?: string | undefined;
1570
+ readonly type: "http";
1571
1571
  readonly scheme: string;
1572
1572
  readonly bearerFormat?: string | undefined;
1573
1573
  } | {
1574
1574
  readonly name: string;
1575
- readonly type: "apiKey";
1576
1575
  readonly description?: string | undefined;
1576
+ readonly type: "apiKey";
1577
1577
  readonly in: "query" | "header" | "cookie";
1578
1578
  readonly parameterName: string;
1579
1579
  } | {
1580
1580
  readonly name: string;
1581
- readonly type: "oauth2";
1582
1581
  readonly description?: string | undefined;
1582
+ readonly type: "oauth2";
1583
1583
  readonly flows: {
1584
1584
  readonly implicit?: {
1585
1585
  readonly scopes?: {
@@ -1616,8 +1616,8 @@ declare const ConfigService_base: Effect.Service.Class<ConfigService, "ConfigSer
1616
1616
  };
1617
1617
  } | {
1618
1618
  readonly name: string;
1619
- readonly type: "openIdConnect";
1620
1619
  readonly description?: string | undefined;
1620
+ readonly type: "openIdConnect";
1621
1621
  readonly openIdConnectUrl: string;
1622
1622
  })[] | undefined;
1623
1623
  readonly global?: readonly {
@@ -1631,8 +1631,8 @@ declare const ConfigService_base: Effect.Service.Class<ConfigService, "ConfigSer
1631
1631
  readonly version?: "3.0.3" | "3.1.0" | "3.2.0" | undefined;
1632
1632
  readonly info: {
1633
1633
  readonly description?: string | undefined;
1634
- readonly version: string;
1635
1634
  readonly title: string;
1635
+ readonly version: string;
1636
1636
  readonly contact?: {
1637
1637
  readonly name?: string | undefined;
1638
1638
  readonly email?: string | undefined;
@@ -1661,22 +1661,21 @@ declare const ConfigService_base: Effect.Service.Class<ConfigService, "ConfigSer
1661
1661
  readonly pathFilter?: RegExp | ((path: string) => boolean) | undefined;
1662
1662
  } | undefined;
1663
1663
  }, configPath?: string | undefined) => Effect.Effect<{
1664
+ readonly tsconfig: string;
1665
+ readonly entry: readonly string[];
1664
1666
  readonly format: "json" | "yaml";
1665
1667
  readonly dtoGlob: readonly string[];
1666
- readonly tsconfig: string;
1667
1668
  readonly tags: readonly {
1668
1669
  readonly name: string;
1669
1670
  readonly description?: string | undefined;
1670
1671
  }[];
1671
- readonly entry: readonly string[];
1672
+ readonly version?: string | undefined;
1672
1673
  readonly include: readonly string[];
1673
1674
  readonly exclude: readonly string[];
1674
- readonly output: string;
1675
- readonly version?: string | undefined;
1676
1675
  readonly info: {
1677
1676
  readonly description?: string | undefined;
1678
- readonly version: string;
1679
1677
  readonly title: string;
1678
+ readonly version: string;
1680
1679
  readonly contact?: {
1681
1680
  readonly name?: string | undefined;
1682
1681
  readonly email?: string | undefined;
@@ -1691,27 +1690,28 @@ declare const ConfigService_base: Effect.Service.Class<ConfigService, "ConfigSer
1691
1690
  readonly description?: string | undefined;
1692
1691
  readonly url: string;
1693
1692
  }[];
1693
+ readonly aliasRefs: "collapse" | "preserve";
1694
1694
  readonly basePath?: string | undefined;
1695
1695
  readonly extractValidation: boolean;
1696
1696
  readonly excludeDecorators: readonly string[];
1697
- readonly aliasRefs: "collapse" | "preserve";
1698
1697
  readonly pathFilter?: RegExp | ((path: string) => boolean) | undefined;
1698
+ readonly output: string;
1699
1699
  readonly securitySchemes: readonly ({
1700
1700
  readonly name: string;
1701
- readonly type: "http";
1702
1701
  readonly description?: string | undefined;
1702
+ readonly type: "http";
1703
1703
  readonly scheme: string;
1704
1704
  readonly bearerFormat?: string | undefined;
1705
1705
  } | {
1706
1706
  readonly name: string;
1707
- readonly type: "apiKey";
1708
1707
  readonly description?: string | undefined;
1708
+ readonly type: "apiKey";
1709
1709
  readonly in: "query" | "header" | "cookie";
1710
1710
  readonly parameterName: string;
1711
1711
  } | {
1712
1712
  readonly name: string;
1713
- readonly type: "oauth2";
1714
1713
  readonly description?: string | undefined;
1714
+ readonly type: "oauth2";
1715
1715
  readonly flows: {
1716
1716
  readonly implicit?: {
1717
1717
  readonly scopes?: {
@@ -1748,8 +1748,8 @@ declare const ConfigService_base: Effect.Service.Class<ConfigService, "ConfigSer
1748
1748
  };
1749
1749
  } | {
1750
1750
  readonly name: string;
1751
- readonly type: "openIdConnect";
1752
1751
  readonly description?: string | undefined;
1752
+ readonly type: "openIdConnect";
1753
1753
  readonly openIdConnectUrl: string;
1754
1754
  })[];
1755
1755
  readonly securityRequirements: readonly {
@@ -1757,22 +1757,21 @@ declare const ConfigService_base: Effect.Service.Class<ConfigService, "ConfigSer
1757
1757
  }[];
1758
1758
  }, ConfigValidationError, never>;
1759
1759
  loadAndResolveConfig: (configPath?: string | undefined, cwd?: string | undefined) => Effect.Effect<{
1760
+ readonly tsconfig: string;
1761
+ readonly entry: readonly string[];
1760
1762
  readonly format: "json" | "yaml";
1761
1763
  readonly dtoGlob: readonly string[];
1762
- readonly tsconfig: string;
1763
1764
  readonly tags: readonly {
1764
1765
  readonly name: string;
1765
1766
  readonly description?: string | undefined;
1766
1767
  }[];
1767
- readonly entry: readonly string[];
1768
+ readonly version?: string | undefined;
1768
1769
  readonly include: readonly string[];
1769
1770
  readonly exclude: readonly string[];
1770
- readonly output: string;
1771
- readonly version?: string | undefined;
1772
1771
  readonly info: {
1773
1772
  readonly description?: string | undefined;
1774
- readonly version: string;
1775
1773
  readonly title: string;
1774
+ readonly version: string;
1776
1775
  readonly contact?: {
1777
1776
  readonly name?: string | undefined;
1778
1777
  readonly email?: string | undefined;
@@ -1787,27 +1786,28 @@ declare const ConfigService_base: Effect.Service.Class<ConfigService, "ConfigSer
1787
1786
  readonly description?: string | undefined;
1788
1787
  readonly url: string;
1789
1788
  }[];
1789
+ readonly aliasRefs: "collapse" | "preserve";
1790
1790
  readonly basePath?: string | undefined;
1791
1791
  readonly extractValidation: boolean;
1792
1792
  readonly excludeDecorators: readonly string[];
1793
- readonly aliasRefs: "collapse" | "preserve";
1794
1793
  readonly pathFilter?: RegExp | ((path: string) => boolean) | undefined;
1794
+ readonly output: string;
1795
1795
  readonly securitySchemes: readonly ({
1796
1796
  readonly name: string;
1797
- readonly type: "http";
1798
1797
  readonly description?: string | undefined;
1798
+ readonly type: "http";
1799
1799
  readonly scheme: string;
1800
1800
  readonly bearerFormat?: string | undefined;
1801
1801
  } | {
1802
1802
  readonly name: string;
1803
- readonly type: "apiKey";
1804
1803
  readonly description?: string | undefined;
1804
+ readonly type: "apiKey";
1805
1805
  readonly in: "query" | "header" | "cookie";
1806
1806
  readonly parameterName: string;
1807
1807
  } | {
1808
1808
  readonly name: string;
1809
- readonly type: "oauth2";
1810
1809
  readonly description?: string | undefined;
1810
+ readonly type: "oauth2";
1811
1811
  readonly flows: {
1812
1812
  readonly implicit?: {
1813
1813
  readonly scopes?: {
@@ -1844,8 +1844,8 @@ declare const ConfigService_base: Effect.Service.Class<ConfigService, "ConfigSer
1844
1844
  };
1845
1845
  } | {
1846
1846
  readonly name: string;
1847
- readonly type: "openIdConnect";
1848
1847
  readonly description?: string | undefined;
1848
+ readonly type: "openIdConnect";
1849
1849
  readonly openIdConnectUrl: string;
1850
1850
  })[];
1851
1851
  readonly securityRequirements: readonly {
@@ -2058,7 +2058,7 @@ interface ClassValidationInfo {
2058
2058
  */
2059
2059
  declare const extractPropertyConstraints: (property: PropertyDeclaration) => ValidationConstraints;
2060
2060
  /**
2061
- * Check if a property has @IsOptional() decorator
2061
+ * Check if a property is optional.
2062
2062
  */
2063
2063
  declare const isPropertyOptional: (property: PropertyDeclaration) => boolean;
2064
2064
  /**
@@ -2146,7 +2146,7 @@ declare const makeProjectContext: (options: ProjectOptions) => Effect.Effect<{
2146
2146
  project: Project;
2147
2147
  entrySourceFile: SourceFile;
2148
2148
  entryClass: ClassDeclaration;
2149
- }, EntryNotFoundError | ProjectInitError, never>;
2149
+ }, ProjectInitError | EntryNotFoundError, never>;
2150
2150
  declare const ProjectService_base: Effect.Service.Class<ProjectService, "ProjectService", {
2151
2151
  readonly accessors: true;
2152
2152
  readonly effect: Effect.Effect<{
@@ -2154,7 +2154,7 @@ declare const ProjectService_base: Effect.Service.Class<ProjectService, "Project
2154
2154
  project: Project;
2155
2155
  entrySourceFile: SourceFile;
2156
2156
  entryClass: ClassDeclaration;
2157
- }, EntryNotFoundError | ProjectInitError, never>;
2157
+ }, ProjectInitError | EntryNotFoundError, never>;
2158
2158
  }, never, never>;
2159
2159
  }>;
2160
2160
  declare class ProjectService extends ProjectService_base {
@@ -2271,5 +2271,5 @@ declare const generate: (options: GenerateOptions) => Effect.Effect<{
2271
2271
  }, ProjectInitError | EntryNotFoundError, ModuleTraversalService | ProjectService | MethodExtractionService>;
2272
2272
  declare const generateAsync: (options: GenerateOptions) => Promise<OpenApiPaths>;
2273
2273
 
2274
- export { MissingGenericSchemaTempFileCleanupError as $, generatePathsAsync as A, generateFromConfigEffect as B, ConfigService as C, generateFromConfigAsync as D, ParameterLocation as F, ReturnTypeInfo as H, HttpMethod as J, OpenApiGeneratorConfig as K, MethodInfo as M, ResolvedConfig as N, ProjectService as P, ProjectInitError as Q, ResolvedParameter as R, SpecFileNotFoundError as S, EntryNotFoundError as U, ValidationService as V, ConfigNotFoundError as W, ConfigLoadError as X, ConfigValidationError as Y, DtoGlobResolutionError as Z, InvalidMethodError as _, SpecFileReadError as a, MissingGenericSchemaTempFileWriteError as a0, PublicApiError as a1, ProjectServiceLive as a6, makeProjectContext as a7, findConfigFile as aA, loadConfigFromFile as aB, loadConfig as aC, resolveConfig as aD, loadAndResolveConfig as aE, validateSpec as aF, categorizeBrokenRefs as aG, formatValidationResult as aH, getModules as aa, getAllControllers as ab, getMethodInfo as ad, getMethodInfoEffect as ae, getControllerMethodInfos as af, getControllerMethodInfosEffect as ag, generateSchemas as ah, generateSchemasFromFiles as ai, SchemaGenerationError as aj, extractPropertyConstraints as an, isPropertyOptional as ao, extractPropertyValidationInfo as ap, extractClassValidationInfo as aq, extractClassValidationInfoEffect as ar, extractClassConstraints as as, getRequiredProperties as at, applyConstraintsToSchema as au, mergeValidationConstraints as av, mergeValidationConstraintsEffect as aw, SpecFileParseError as b, OpenApiOperation as d, OutputService as g, SchemaService as h, ModuleTraversalService as i, MethodExtractionService as j, generate$1 as k, defineConfig as m, generate as x, generateAsync as y, generatePathsEffect as z };
2274
+ export { MissingGenericSchemaTempFileCleanupError as $, generatePathsAsync as A, generateFromConfigEffect as B, ConfigService as C, generateFromConfigAsync as D, ParameterLocation as F, ReturnTypeInfo as H, HttpMethod as J, OpenApiGeneratorConfig as K, MethodInfo as M, ResolvedConfig as N, ProjectService as P, ProjectInitError as Q, ResolvedParameter as R, SpecFileNotFoundError as S, EntryNotFoundError as U, ValidationService as V, ConfigNotFoundError as W, ConfigLoadError as X, ConfigValidationError as Y, DtoGlobResolutionError as Z, InvalidMethodError as _, SpecFileReadError as a, MissingGenericSchemaTempFileWriteError as a0, PublicApiError as a1, ProjectServiceLive as a6, makeProjectContext as a7, findConfigFile as aA, loadConfigFromFile as aB, loadConfig as aC, resolveConfig as aD, loadAndResolveConfig as aE, validateSpec as aF, categorizeBrokenRefs as aG, formatValidationResult as aH, getModules as aa, getAllControllers as ab, getMethodInfo as ad, getMethodInfoEffect as ae, getControllerMethodInfos as af, getControllerMethodInfosEffect as ag, generateSchemas as ah, generateSchemasFromFiles as ai, SchemaGenerationError as aj, extractPropertyConstraints as an, isPropertyOptional as ao, extractPropertyValidationInfo as ap, extractClassValidationInfo as aq, extractClassValidationInfoEffect as ar, extractClassConstraints as as, getRequiredProperties as at, applyConstraintsToSchema as au, mergeValidationConstraints as av, mergeValidationConstraintsEffect as aw, SpecFileParseError as b, OpenApiOperation as d, SchemaService as g, OutputService as h, ModuleTraversalService as i, MethodExtractionService as j, generate$1 as k, defineConfig as m, generate as x, generateAsync as y, generatePathsEffect as z };
2275
2275
  export type { GenerateOptions as E, GeneratedSchemas as G, InfoConfig as I, LicenseConfig as L, OpenApiSpec as O, TagConfig as T, ProjectError as a2, ConfigError as a3, AnalysisError as a4, GeneratorError as a5, ProjectContext as a8, ProjectOptions as a9, ValidationResult as aI, BrokenRef as aJ, BrokenRefCategories as aK, ModuleWithControllers as ac, SchemaError as ak, SchemaGeneratorOptions as al, JsonSchema as am, ValidationConstraints as ax, PropertyValidationInfo as ay, ClassValidationInfo as az, OpenApiPaths as c, OpenApiPaths$1 as e, OpenApiSchema$1 as f, GenerateResult as l, Config as n, ContactConfig as o, ServerConfig as p, OutputFormat as q, TelemetryConfig as r, GenerateOverrides as s, OpenApiOperation$1 as t, OpenApiParameter as u, OpenApiRequestBody as v, OpenApiResponse as w };
@@ -1057,12 +1057,12 @@ const decoratorHandlers = {
1057
1057
  })
1058
1058
  ),
1059
1059
  ApiProperty: apiPropertyDecoratorHandler,
1060
- ApiPropertyOptional: apiPropertyDecoratorHandler
1060
+ ApiPropertyOptional: (state, decorator) => apiPropertyDecoratorHandler({ ...state, isOptional: true }, decorator)
1061
1061
  };
1062
- const INITIAL_PROPERTY_VALIDATION_INFO = {
1063
- isOptional: false,
1062
+ const createInitialPropertyValidationInfo = (property) => ({
1063
+ isOptional: property.hasQuestionToken(),
1064
1064
  constraints: {}
1065
- };
1065
+ });
1066
1066
  const applyDecorator = (state, decorator) => getDecoratorName(decorator).pipe(
1067
1067
  Option.flatMap((name) => Option.fromNullable(decoratorHandlers[name])),
1068
1068
  Option.match({
@@ -1072,7 +1072,7 @@ const applyDecorator = (state, decorator) => getDecoratorName(decorator).pipe(
1072
1072
  );
1073
1073
  const extractPropertyState = (property) => property.getDecorators().reduce(
1074
1074
  applyDecorator,
1075
- INITIAL_PROPERTY_VALIDATION_INFO
1075
+ createInitialPropertyValidationInfo(property)
1076
1076
  );
1077
1077
  const hasConstraints = (constraints) => Object.keys(constraints).length > 0;
1078
1078
  const extractPropertyConstraints = (property) => extractPropertyState(property).constraints;
@@ -5500,4 +5500,4 @@ const generate = async (configPath, overrides) => {
5500
5500
  return runGeneratorApiPromise(program);
5501
5501
  };
5502
5502
 
5503
- export { generateSchemasFromFiles as $, getControllerMethodInfosEffect as A, MethodExtractionService as B, ConfigNotFoundError as C, DtoGlobResolutionError as D, EntryNotFoundError as E, transformMethod as F, transformMethodEffect as G, transformMethods as H, InvalidMethodError as I, transformMethodsEffect as J, mergeSchemas as K, mergeSchemasEffect as L, MissingGenericSchemaTempFileCleanupError as M, mergeGeneratedSchemas as N, mergeGeneratedSchemasEffect as O, ProjectInitError as P, filterSchemas as Q, filterSchemasEffect as R, SpecFileNotFoundError as S, normalizeSchemas as T, normalizeSchemasEffect as U, filterInternalSchemas as V, filterInternalSchemasEffect as W, normalizeStructureRefs as X, normalizeStructureRefsEffect as Y, toPascalCase as Z, generateSchemas as _, SpecFileReadError as a, SchemaGenerationError as a0, SchemaService as a1, extractPropertyConstraints as a2, isPropertyOptional as a3, extractPropertyValidationInfo as a4, extractClassValidationInfo as a5, extractClassValidationInfoEffect as a6, extractClassConstraints as a7, getRequiredProperties as a8, applyConstraintsToSchema as a9, runGeneratorApiPromise as aA, mergeValidationConstraints as aa, mergeValidationConstraintsEffect as ab, ValidationService as ac, OutputService as ad, ConfigService as ae, findConfigFile as af, loadConfigFromFile as ag, loadConfig as ah, resolveConfig as ai, loadAndResolveConfig as aj, generatorServicesLayer as ak, resolveClassFromSymbol as al, getArrayInitializer as am, getStringLiteralValue as an, getSymbolFromIdentifier as ao, isModuleClass as ap, getModuleDecoratorArg as aq, resolveClassFromExpression as ar, resolveArrayOfClasses as as, getModuleMetadata as at, validateSpec as au, categorizeBrokenRefs as av, formatValidationResult as aw, generateEffect as ax, runProjectApiPromise as ay, runtimeLayerFor as az, SpecFileParseError as b, ConfigLoadError as c, defineConfig as d, ConfigValidationError as e, MissingGenericSchemaTempFileWriteError as f, generate as g, PublicApiError as h, ProjectService as i, ProjectServiceLive as j, getModules as k, getAllControllers as l, makeProjectContext as m, ModuleTraversalService as n, getControllerPrefix as o, getControllerName as p, isHttpMethod as q, getHttpMethods as r, getDecoratorName$1 as s, getControllerTags as t, getHttpDecorator as u, isHttpDecorator as v, normalizePath as w, getMethodInfo as x, getMethodInfoEffect as y, getControllerMethodInfos as z };
5503
+ export { generateSchemasFromFiles as $, getControllerMethodInfosEffect as A, MethodExtractionService as B, ConfigNotFoundError as C, DtoGlobResolutionError as D, EntryNotFoundError as E, transformMethod as F, transformMethodEffect as G, transformMethods as H, InvalidMethodError as I, transformMethodsEffect as J, mergeSchemas as K, mergeSchemasEffect as L, MissingGenericSchemaTempFileCleanupError as M, mergeGeneratedSchemas as N, mergeGeneratedSchemasEffect as O, ProjectInitError as P, filterSchemas as Q, filterSchemasEffect as R, SpecFileNotFoundError as S, normalizeSchemas as T, normalizeSchemasEffect as U, filterInternalSchemas as V, filterInternalSchemasEffect as W, normalizeStructureRefs as X, normalizeStructureRefsEffect as Y, toPascalCase as Z, generateSchemas as _, SpecFileParseError as a, SchemaGenerationError as a0, SchemaService as a1, extractPropertyConstraints as a2, isPropertyOptional as a3, extractPropertyValidationInfo as a4, extractClassValidationInfo as a5, extractClassValidationInfoEffect as a6, extractClassConstraints as a7, getRequiredProperties as a8, applyConstraintsToSchema as a9, runGeneratorApiPromise as aA, mergeValidationConstraints as aa, mergeValidationConstraintsEffect as ab, ValidationService as ac, OutputService as ad, ConfigService as ae, findConfigFile as af, loadConfigFromFile as ag, loadConfig as ah, resolveConfig as ai, loadAndResolveConfig as aj, generatorServicesLayer as ak, resolveClassFromSymbol as al, getArrayInitializer as am, getStringLiteralValue as an, getSymbolFromIdentifier as ao, isModuleClass as ap, getModuleDecoratorArg as aq, resolveClassFromExpression as ar, resolveArrayOfClasses as as, getModuleMetadata as at, validateSpec as au, categorizeBrokenRefs as av, formatValidationResult as aw, generateEffect as ax, runProjectApiPromise as ay, runtimeLayerFor as az, SpecFileReadError as b, ConfigLoadError as c, defineConfig as d, ConfigValidationError as e, MissingGenericSchemaTempFileWriteError as f, generate as g, PublicApiError as h, ProjectService as i, ProjectServiceLive as j, getModules as k, getAllControllers as l, makeProjectContext as m, ModuleTraversalService as n, getControllerPrefix as o, getControllerName as p, isHttpMethod as q, getHttpMethods as r, getDecoratorName$1 as s, getControllerTags as t, getHttpDecorator as u, isHttpDecorator as v, normalizePath as w, getMethodInfo as x, getMethodInfoEffect as y, getControllerMethodInfos as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nestjs-openapi",
3
- "version": "0.2.2",
3
+ "version": "0.3.1",
4
4
  "description": "Static code analysis tool to generate OpenAPI specifications from NestJS applications",
5
5
  "main": "./dist/index.mjs",
6
6
  "module": "./dist/index.mjs",