@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 +1 -0
- package/dist/index.js +10 -5
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
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:
|
|
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
|
|
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:
|
|
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:
|
|
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:
|
|
44315
|
+
imports: [
|
|
44316
|
+
{ exports: importsMock, dependency: schemasPathRelative }
|
|
44317
|
+
],
|
|
44313
44318
|
specsName,
|
|
44314
44319
|
hasSchemaDir: !!output.schemas,
|
|
44315
44320
|
isAllowSyntheticDefaultImports,
|