@kubb/swagger-ts 2.0.0-beta.4 → 2.0.0-beta.6

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.
@@ -81,9 +81,9 @@ var __privateMethod = (obj, member, method) => {
81
81
  return method;
82
82
  };
83
83
 
84
- // ../../node_modules/.pnpm/tsup@8.0.1_ts-node@10.9.1_typescript@5.3.2/node_modules/tsup/assets/cjs_shims.js
84
+ // ../../node_modules/.pnpm/tsup@8.0.1_@microsoft+api-extractor@7.38.3_ts-node@10.9.1_typescript@5.3.2/node_modules/tsup/assets/cjs_shims.js
85
85
  var init_cjs_shims = __esm({
86
- "../../node_modules/.pnpm/tsup@8.0.1_ts-node@10.9.1_typescript@5.3.2/node_modules/tsup/assets/cjs_shims.js"() {
86
+ "../../node_modules/.pnpm/tsup@8.0.1_@microsoft+api-extractor@7.38.3_ts-node@10.9.1_typescript@5.3.2/node_modules/tsup/assets/cjs_shims.js"() {
87
87
  }
88
88
  });
89
89
 
@@ -3728,6 +3728,17 @@ getBaseTypeFromSchema_fn = function(_schema, baseName) {
3728
3728
  if (schema.properties || schema.additionalProperties) {
3729
3729
  return __privateMethod(this, _getTypeFromProperties, getTypeFromProperties_fn).call(this, schema, baseName);
3730
3730
  }
3731
+ if (version === "3.1" && "const" in schema) {
3732
+ if (schema["const"]) {
3733
+ if (typeof schema["const"] === "string") {
3734
+ return factory2__namespace.createLiteralTypeNode(factory2__namespace.createStringLiteral(schema["const"]));
3735
+ } else if (typeof schema["const"] === "number") {
3736
+ return factory2__namespace.createLiteralTypeNode(factory2__namespace.createNumericLiteral(schema["const"]));
3737
+ }
3738
+ } else {
3739
+ return factory2.keywordTypeNodes.null;
3740
+ }
3741
+ }
3731
3742
  if (schema.type) {
3732
3743
  if (Array.isArray(schema.type)) {
3733
3744
  const [type, nullable] = schema.type;
@@ -3754,9 +3765,6 @@ getBaseTypeFromSchema_fn = function(_schema, baseName) {
3754
3765
  if (schema.format === "binary") {
3755
3766
  return factory2__namespace.createTypeReferenceNode("Blob", []);
3756
3767
  }
3757
- if (version === "3.1" && typeof schema["const"] === "string") {
3758
- return factory2__namespace.createLiteralTypeNode(factory2__namespace.createStringLiteral(schema["const"]));
3759
- }
3760
3768
  return factory2__namespace.keywordTypeNodes.any;
3761
3769
  };
3762
3770