Skip to content

Commit

Permalink
Update transform error messaging (#222)
Browse files Browse the repository at this point in the history
  • Loading branch information
samchungy authored Feb 15, 2024
1 parent 3c635e2 commit 87e2663
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions src/create/schema/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,11 +404,11 @@ describe('createSchema', () => {
This may cause the schema to render incorrectly and is most likely a mistake. You can resolve this by:
1. Setting an \`effectType\` on the transformation to \`same\` or \`output\` eg. \`.openapi({type: 'same'})\`
1. Setting an \`effectType\` on one of the transformations to \`same\` (Not applicable for ZodDefault), \`input\` or \`output\` eg. \`.openapi({type: 'same'})\`
2. Wrapping the transformation in a ZodPipeline
3. Assigning a manual type to the transformation eg. \`.openapi({type: 'string'})\`
4. Removing the transformation
5. Deregistering the component containing the transformation"
5. Deregister the component containing the transformation"
`);
});

Expand Down Expand Up @@ -445,11 +445,11 @@ This may cause the schema to render incorrectly and is most likely a mistake. Yo
This may cause the schema to render incorrectly and is most likely a mistake. You can resolve this by:
1. Setting an \`effectType\` on the transformation to \`same\` or \`output\` eg. \`.openapi({type: 'same'})\`
1. Setting an \`effectType\` on one of the transformations to \`same\` (Not applicable for ZodDefault), \`input\` or \`output\` eg. \`.openapi({type: 'same'})\`
2. Wrapping the transformation in a ZodPipeline
3. Assigning a manual type to the transformation eg. \`.openapi({type: 'string'})\`
4. Removing the transformation
5. Deregistering the component containing the transformation"
5. Deregister the component containing the transformation"
`);
});

Expand Down Expand Up @@ -577,11 +577,11 @@ This may cause the schema to render incorrectly and is most likely a mistake. Yo
This may cause the schema to render incorrectly and is most likely a mistake. You can resolve this by:
1. Setting an \`effectType\` on the transformation to \`same\` or \`output\` eg. \`.openapi({type: 'same'})\`
1. Setting an \`effectType\` on one of the transformations to \`same\` (Not applicable for ZodDefault), \`input\` or \`output\` eg. \`.openapi({type: 'same'})\`
2. Wrapping the transformation in a ZodPipeline
3. Assigning a manual type to the transformation eg. \`.openapi({type: 'string'})\`
4. Removing the transformation
5. Deregistering the component containing the transformation"
5. Deregister the component containing the transformation"
`);
});

Expand Down Expand Up @@ -618,11 +618,11 @@ This may cause the schema to render incorrectly and is most likely a mistake. Yo
This may cause the schema to render incorrectly and is most likely a mistake. You can resolve this by:
1. Setting an \`effectType\` on the transformation to \`same\` or \`input\` eg. \`.openapi({type: 'same'})\`
1. Setting an \`effectType\` on one of the transformations to \`same\` (Not applicable for ZodDefault), \`input\` or \`output\` eg. \`.openapi({type: 'same'})\`
2. Wrapping the transformation in a ZodPipeline
3. Assigning a manual type to the transformation eg. \`.openapi({type: 'string'})\`
4. Removing the transformation
5. Deregistering the component containing the transformation"
5. Deregister the component containing the transformation"
`);
});
});
4 changes: 2 additions & 2 deletions src/create/schema/parsers/transform.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,11 @@ describe('throwTransformError', () => {
This may cause the schema to render incorrectly and is most likely a mistake. You can resolve this by:
1. Setting an \`effectType\` on the transformation to \`same\` or \`output\` eg. \`.openapi({type: 'same'})\`
1. Setting an \`effectType\` on one of the transformations to \`same\` (Not applicable for ZodDefault), \`input\` or \`output\` eg. \`.openapi({type: 'same'})\`
2. Wrapping the transformation in a ZodPipeline
3. Assigning a manual type to the transformation eg. \`.openapi({type: 'string'})\`
4. Removing the transformation
5. Deregistering the component containing the transformation"
5. Deregister the component containing the transformation"
`);
});
});
4 changes: 2 additions & 2 deletions src/create/schema/parsers/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ export const throwTransformError = (effect: ResolvedEffect) => {
This may cause the schema to render incorrectly and is most likely a mistake. You can resolve this by:
1. Setting an \`effectType\` on the transformation to \`same\` or \`${opposite}\` eg. \`.openapi({type: 'same'})\`
1. Setting an \`effectType\` on one of the transformations to \`same\` (Not applicable for ZodDefault), \`input\` or \`output\` eg. \`.openapi({type: 'same'})\`
2. Wrapping the transformation in a ZodPipeline
3. Assigning a manual type to the transformation eg. \`.openapi({type: 'string'})\`
4. Removing the transformation
5. Deregistering the component containing the transformation`,
5. Deregister the component containing the transformation`,
);
};

Expand Down

0 comments on commit 87e2663

Please sign in to comment.