@orval/core 6.24.0 → 6.25.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
@@ -311,6 +311,7 @@ type AngularOptions = {
311
311
  type SwrOptions = {
312
312
  options?: any;
313
313
  useInfinite?: boolean;
314
+ swrOptions?: any;
314
315
  };
315
316
  type InputTransformerFn = (spec: OpenAPIObject) => OpenAPIObject;
316
317
  type InputTransformer = string | InputTransformerFn;
package/dist/index.js CHANGED
@@ -41831,8 +41831,10 @@ var getObject = ({
41831
41831
  hasReadonlyProps: item.readOnly || false
41832
41832
  };
41833
41833
  }
41834
+ const useTypeOverInterfaces = context?.output.override?.useTypeOverInterfaces;
41835
+ const blankValue = item.type === "object" ? "{ [key: string]: any }" : useTypeOverInterfaces ? "unknown" : "{}";
41834
41836
  return {
41835
- value: (item.type === "object" ? "{ [key: string]: any }" : "unknown") + nullable,
41837
+ value: blankValue + nullable,
41836
41838
  imports: [],
41837
41839
  schemas: [],
41838
41840
  isEnum: false,
@@ -41848,7 +41850,8 @@ var getScalar = ({
41848
41850
  name,
41849
41851
  context
41850
41852
  }) => {
41851
- const nullable = item.nullable ? " | null" : "";
41853
+ const isAngularClient = context.output.client === OutputClient.ANGULAR;
41854
+ const nullable = item.nullable && !isAngularClient ? " | null" : "";
41852
41855
  const enumItems = item.enum?.filter((enumItem) => enumItem !== null);
41853
41856
  if (!item.type && item.items) {
41854
41857
  item.type = "array";
@@ -43933,7 +43936,7 @@ var writeSplitMode = async ({
43933
43936
  });
43934
43937
  mockData += builder.importsMock({
43935
43938
  implementation: implementationMock,
43936
- imports: [{ exports: imports, dependency: relativeSchemasPath }],
43939
+ imports: [{ exports: importsMock, dependency: relativeSchemasPath }],
43937
43940
  specsName,
43938
43941
  hasSchemaDir: !!output.schemas,
43939
43942
  isAllowSyntheticDefaultImports,
@@ -44176,7 +44179,7 @@ var writeSplitTagsMode = async ({
44176
44179
  });
44177
44180
  mockData += builder.importsMock({
44178
44181
  implementation: implementationMock,
44179
- imports: importsForBuilder,
44182
+ imports: [{ exports: importsMock, dependency: relativeSchemasPath }],
44180
44183
  specsName,
44181
44184
  hasSchemaDir: !!output.schemas,
44182
44185
  isAllowSyntheticDefaultImports,
@@ -44309,7 +44312,9 @@ var writeTagsMode = async ({
44309
44312
  if (output.mock) {
44310
44313
  data += builder.importsMock({
44311
44314
  implementation: implementationMock,
44312
- imports: importsForBuilder,
44315
+ imports: [
44316
+ { exports: importsMock, dependency: schemasPathRelative }
44317
+ ],
44313
44318
  specsName,
44314
44319
  hasSchemaDir: !!output.schemas,
44315
44320
  isAllowSyntheticDefaultImports,