@orval/core 6.22.0 → 6.23.0

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.d.ts CHANGED
@@ -68,6 +68,7 @@ type NormalizedOverrideOutput = {
68
68
  components: {
69
69
  schemas: {
70
70
  suffix: string;
71
+ itemSuffix: string;
71
72
  };
72
73
  responses: {
73
74
  suffix: string;
@@ -244,6 +245,7 @@ type OverrideOutput = {
244
245
  components?: {
245
246
  schemas?: {
246
247
  suffix?: string;
248
+ itemSuffix?: string;
247
249
  };
248
250
  responses?: {
249
251
  suffix?: string;
package/dist/index.js CHANGED
@@ -4108,7 +4108,7 @@ var require_lodash = __commonJS({
4108
4108
  function uniq2(array) {
4109
4109
  return array && array.length ? baseUniq(array) : [];
4110
4110
  }
4111
- function uniqBy2(array, iteratee2) {
4111
+ function uniqBy3(array, iteratee2) {
4112
4112
  return array && array.length ? baseUniq(array, getIteratee(iteratee2, 2)) : [];
4113
4113
  }
4114
4114
  function uniqWith2(array, comparator) {
@@ -5768,7 +5768,7 @@ var require_lodash = __commonJS({
5768
5768
  lodash.unionBy = unionBy;
5769
5769
  lodash.unionWith = unionWith;
5770
5770
  lodash.uniq = uniq2;
5771
- lodash.uniqBy = uniqBy2;
5771
+ lodash.uniqBy = uniqBy3;
5772
5772
  lodash.uniqWith = uniqWith2;
5773
5773
  lodash.unset = unset;
5774
5774
  lodash.unzip = unzip;
@@ -41288,11 +41288,11 @@ var getArray = ({
41288
41288
  if (schema.items) {
41289
41289
  const resolvedObject = resolveObject({
41290
41290
  schema: schema.items,
41291
- propName: name + "Item",
41291
+ propName: name + context.override.components.schemas.itemSuffix,
41292
41292
  context
41293
41293
  });
41294
41294
  return {
41295
- value: resolvedObject.value.includes("|") ? `(${resolvedObject.value})[]` : `${resolvedObject.value}[]`,
41295
+ value: `${schema.readOnly === true ? "readonly " : ""}${resolvedObject.value.includes("|") ? `(${resolvedObject.value})[]` : `${resolvedObject.value}[]`}`,
41296
41296
  imports: resolvedObject.imports,
41297
41297
  schemas: resolvedObject.schemas,
41298
41298
  isEnum: false,
@@ -41348,8 +41348,8 @@ var getResReqTypes = (responsesOrRequests, name, context, defaultType = "unknown
41348
41348
  isRef: true,
41349
41349
  hasReadonlyProps: false,
41350
41350
  originalSchema: mediaType?.schema,
41351
- example: mediaType.example,
41352
- examples: resolveExampleRefs(mediaType.examples, context),
41351
+ example: mediaType?.example,
41352
+ examples: resolveExampleRefs(mediaType?.examples, context),
41353
41353
  key,
41354
41354
  contentType
41355
41355
  }
@@ -44025,6 +44025,7 @@ var generateTargetForTags = (builder, options) => {
44025
44025
  };
44026
44026
 
44027
44027
  // src/writers/split-tags-mode.ts
44028
+ var import_lodash11 = __toESM(require("lodash.uniqby"));
44028
44029
  var writeSplitTagsMode = async ({
44029
44030
  builder,
44030
44031
  output,
@@ -44056,10 +44057,14 @@ var writeSplitTagsMode = async ({
44056
44057
  let implementationData = header;
44057
44058
  let mockData = header;
44058
44059
  const relativeSchemasPath = output.schemas ? "../" + path_exports.relativeSafe(dirname3, getFileInfo(output.schemas).dirname) : "../" + filename + ".schemas";
44060
+ const importsForBuilder = output.schemas ? (0, import_lodash11.default)(imports, "name").map((i3) => ({
44061
+ exports: [i3],
44062
+ dependency: path_exports.join(relativeSchemasPath, camel(i3.name))
44063
+ })) : [{ exports: imports, dependency: relativeSchemasPath }];
44059
44064
  implementationData += builder.imports({
44060
44065
  client: output.client,
44061
44066
  implementation,
44062
- imports: [{ exports: imports, dependency: relativeSchemasPath }],
44067
+ imports: importsForBuilder,
44063
44068
  specsName,
44064
44069
  hasSchemaDir: !!output.schemas,
44065
44070
  isAllowSyntheticDefaultImports,