Comments (3)
Could be a bug from here:
orval/packages/query/src/index.ts
Lines 334 to 340 in b11e58b
When body.definition is something like this: "UserList[]", Regex assumes "[]" as a character class and so doesn't get replaced to "BodyType<UserList[]>".
I changed this to:
let bodyDefinition =body.definition.replace('\[\]','\\[\\]')
let propsImplementation =
mutator?.bodyTypeName && body.definition
? toObjectString(props, 'implementation').replace(
new RegExp(`(\\w*):\\s?${bodyDefinition}`),
`$1: ${mutator.bodyTypeName}<${body.definition}>`,
)
: toObjectString(props, 'implementation');
which solved the problem..
Lemme know if I need to open PR. Thank you.
from orval.
I am receiving this error with the client swr
as well.
@ctrlx-altf4 Thanks for your research into the problem!
from orval.
Please submit a a PR with the fix.
from orval.
Related Issues (20)
- Feature: Adding contributors section to the README.md file HOT 1
- Upgrade MSW to 2.0 HOT 1
- SWR: add useSwrMutation hook HOT 3
- Invalid type files are generated with Null-only enum or Empty enum HOT 5
- Code generation crashes when property "title" in "info" object is missing
- Vue: Uncaught (in promise) ReferenceError: headers is not defined when having `headers: true` in config
- Zod: schema with a file that contains minItems and maxItems in a two-dimensional array will result in an error HOT 2
- Zod: required field HOT 5
- Zod: Doesn't create Array only Object HOT 1
- MSW: faker object keys are wrapped in single quotes HOT 1
- Disable minification for output package
- Hangs at 100% CPU usage while generating client code HOT 8
- TanStack Query v5 HOT 13
- Zod: generate wrong validation for type string format date HOT 2
- Refs are not handled in schema properties HOT 2
- Keys of objects being CUIDs (randomly generated each run) HOT 2
- TanStack react query v5 marks `queryKey` as required HOT 17
- Nullable objects are missing ` | null` HOT 3
- SyntaxError: Unexpected token '||=' when running Orval on Linux on Github CI HOT 2
- SSR: Splitting react hooks and requests into separate files HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from orval.