@kubb/adapter-oas 5.13.0 → 5.13.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.
package/dist/index.js CHANGED
@@ -20,7 +20,7 @@ var compatibility = {
20
20
  };
21
21
  //#endregion
22
22
  //#region package.json
23
- var version = "5.13.0";
23
+ var version = "5.13.1";
24
24
  //#endregion
25
25
  //#region src/constants.ts
26
26
  /**
@@ -2024,6 +2024,7 @@ function convertNumeric(context, type) {
2024
2024
  * `options.unknownType`, otherwise parses it as a regular schema.
2025
2025
  */
2026
2026
  function resolveMapSchema(mapSchema, { options, parse }) {
2027
+ if (mapSchema === false) return ast.factory.createSchema({ type: "never" });
2027
2028
  if (mapSchema === true || typeof mapSchema === "object" && Object.keys(mapSchema).length === 0) return ast.factory.createSchema({ type: options.unknownType });
2028
2029
  return parse({ schema: mapSchema });
2029
2030
  }
@@ -2083,6 +2084,10 @@ function convertObject({ schema, name, nullable, defaultValue, options, parse })
2083
2084
  options,
2084
2085
  parse
2085
2086
  })])) : void 0;
2087
+ const propertyNames = "propertyNames" in schema && schema.propertyNames !== void 0 ? resolveMapSchema(schema.propertyNames, {
2088
+ options,
2089
+ parse
2090
+ }) : void 0;
2086
2091
  const objectNode = createNode({
2087
2092
  schema,
2088
2093
  name,
@@ -2094,6 +2099,7 @@ function convertObject({ schema, name, nullable, defaultValue, options, parse })
2094
2099
  properties,
2095
2100
  additionalProperties: additionalPropertiesNode,
2096
2101
  patternProperties,
2102
+ propertyNames,
2097
2103
  minProperties: schema.minProperties,
2098
2104
  maxProperties: schema.maxProperties
2099
2105
  });
@@ -2219,7 +2225,7 @@ const schemaRules = [
2219
2225
  convert: convertEnum
2220
2226
  },
2221
2227
  {
2222
- match: ({ schema, type }) => type === "object" || !!schema.properties || !!schema.additionalProperties || "patternProperties" in schema,
2228
+ match: ({ schema, type }) => type === "object" || !!schema.properties || !!schema.additionalProperties || "patternProperties" in schema || "propertyNames" in schema,
2223
2229
  convert: convertObject
2224
2230
  },
2225
2231
  {