-
-
Notifications
You must be signed in to change notification settings - Fork 56
Definition for Objects with dynamic keys #252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hey, @brogine. Thanks for your kind words! Dynamic object property support is not currently present. Moreover, I can't say for certain how it would align with the current API. If you have some proposals on this, I'd be glad to support you in making this happen. But if this support implies rewriting the library, I'd recommend against it, as I'm in a middle of such a rewrite already (that's been going on for quite some time but it's destined to land eventually). |
I have this same issue. Basically I have a field on a model that is an array of objects that can be one of 2 types. But there is no way in mswjs/data to model an object that can have variable properties. |
Any updates on this? I have a |
Same, I need to mock an external API that returns different properties for different types of entities, from the same endpoint. |
Hi everyone!
First of all, thanks a lot for this project. It was the missing feature that MSW was lacking.
So far I've found it easy to use and extremely simple to setup.
Let me describe the issue that I'm facing at the moment.
I was not able to find a way to describe an estructure with dynamic object keys.
Let's say I've this in TS:
Is there a way to do it? I tried adding
Object
as a type, but when I create elements, they are created as an empty object.Please, let me know if this is a missing feature. I'll try to create a PR for it.
The text was updated successfully, but these errors were encountered: