Skip to content
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

Array with mixed typed value #75

Open
visko-sc opened this issue Nov 18, 2021 · 1 comment
Open

Array with mixed typed value #75

visko-sc opened this issue Nov 18, 2021 · 1 comment

Comments

@visko-sc
Copy link

Currently, an array takes only generator arrayContent. There are two problems with it:

  • it is not possible to generate mixed-value list: ['one', 2]
  • it is not possible to define an array with constant values: ['one', 'two'] - although workaround could be possible with Enum support, it would be better to have support for constant values in an array:
"fieldName": {
    "type": "array",
    "arrayContent": [
        {
             "type": "constant",
             "constVal": "one"
         },
        {
             "type": "constant",
             "constVal": 2
         }
    ]
}
@feliixx
Copy link
Owner

feliixx commented Nov 19, 2021

Yes, this is currently not possible :/ Mixed-value list never felt right to me, so I didn't implemented it, but if you want feel free to send a PR !

@feliixx feliixx changed the title fixed length array Array with mixed typed value Mar 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants