orval icon indicating copy to clipboard operation
orval copied to clipboard

React Query: Regression in 6.25.0 caused by #1207

Open melloware opened this issue 1 year ago • 5 comments

Regression caused by https://github.com/anymaniax/orval/issues/1207

@soartec-lab this broke React Query in 6.25.0 I now get these TypeScript errors.

  Line 26:40:  Don't use `{}` as a type. `{}` actually means "any non-nullish value".
- If you want a type meaning "any object", you probably want `object` instead.
- If you want a type meaning "any value", you probably want `unknown` instead.

in 6.24.0 code was this

export interface FilterConstraint {
	/** Filter match mode e.g. equals, notEquals, contains, notContains, gt, gte, lt, lte */
	matchMode?: string;
	/** Value to filter this column by */
	value?: unknown;
}

in 6.25.0 its this...

/**
 * Value to filter this column by
 */
export type FilterConstraintValue = {};

export interface FilterConstraint {
	/** Filter match mode e.g. equals, notEquals, contains, notContains, gt, gte, lt, lte */
	matchMode?: string;
	/** Value to filter this column by */
	value?: FilterConstraintValue;
}

Which is now broken.

melloware avatar Feb 18 '24 15:02 melloware

@melloware Wow, the value of type is now {} instead of unknown. Could you please provide a schema that reproduces the problem?

soartec-lab avatar Feb 18 '24 23:02 soartec-lab

Attached in the zip file is my openapi.json and orval.ts config! orval-1227.zip

melloware avatar Feb 19 '24 12:02 melloware

thanks!

soartec-lab avatar Feb 19 '24 23:02 soartec-lab

Just an FYI this is my public project where I use Orval and detected the issue: https://github.com/melloware/quarkus-primereact

melloware avatar Feb 21 '24 15:02 melloware

Thank you. I haven't had time recently, but I think I'll be able to respond next week.

soartec-lab avatar Feb 21 '24 23:02 soartec-lab