question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Constant values for enumSource broken

See original GitHub issue

The following schema is supposed to produce an select field with two constant values to chose from:

{
  "type": "string",
  "enumSource": [
    ["foo"],
    ["bar"]
  ]
}

However, the following error is thrown instead:

Uncaught TypeError: a.match is not a function

The error is apparently thrown in the compile method of the template engine.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:1
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
svendhhhcommented, Jun 30, 2016

We’ve managed to work around the bug by defining the constant as an enumsource as well, with just one static value as source:

"object": {
    "watch": {
        "ids": "somename.someIds"
    },
    "enumSource": [
        {
            "source": [
                {
                    "value": "None"
                }
            ],
            "title": "{{item.value}}",
            "value": "{{item.value}}"
        },
        {
            "source": "ids",
            "title": "{{item.id}}",
            "value": "{{item.id}}"
        }
    ]
}
0reactions
jeremyjannottacommented, Jun 28, 2016

+1 We are getting this error too, which is particularly an issue since support for the constant syntax is still in the documentation while it’s broken.

Read more comments on GitHub >

github_iconTop Results From Across the Web

org.junit.jupiter.params.provider.EnumSource.value java code ...
that fails our Gradle build which is configured with -Werror. Set allNames = stream(enumSource.value().
Read more >
Build Enumerations of Constants With Python's Enum
Create enumerations of constants using Python's Enum class ... Ensuring constant values that can't be changed during the code's execution ...
Read more >
EnumSource filtering · Issue #850 · junit-team/junit5 - GitHub
Many times I run into a situation where some test should be repeated only for a subset of enum values. Currently we can...
Read more >
JUnit 5 User Guide
@EnumSource provides a convenient way to use Enum constants. The annotation provides an optional names parameter that lets you specify which ...
Read more >
JUnit 5 Tutorial: Writing Parameterized Tests - Petri Kainulainen
If our parameterized test takes one enum value as a method parameter, we have to annotate our test method with the @EnumSource annotation ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found