You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could there be a configurable way to clean up patterns before they are placed inside the mock? For this example I would like to remove the ^ and $ since Faker will just leave those in place. They do make sense in the source yaml so I wouldn't want to change that.
The text was updated successfully, but these errors were encountered:
While digging in the source code I found the undocumented feature of transforming the schema via de configuration and created the following workaround:
What version of
kubb
is running?kubb/2.6.5 win32-x64 node-v18.14.0
What platform is your computer?
Windows
What version of external packages are you using(
@tanstack-query
,MSW
,React
,Vue
, ...)What steps can reproduce the bug?
When using the following simple config to create MSW mocks with the spec below:
This will create the mocks for an MSW server, if you start one up and visit http://localhost:9090/test you get something like this:
How often does this bug happen?
Every time
What is the expected behavior?
I would expect the regex characters not to appear in the mocked output.
Swagger/OpenAPI file?
Additional information
I noticed the slashes are wrapped around the value by this lib which I'm not sure why (https://github.com/kubb-project/kubb/blob/main/packages/swagger-faker/src/FakerGenerator.ts#L334).
Could there be a configurable way to clean up patterns before they are placed inside the mock? For this example I would like to remove the ^ and $ since Faker will just leave those in place. They do make sense in the source yaml so I wouldn't want to change that.
The text was updated successfully, but these errors were encountered: