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.

Config parameters that have defaults should be optional

See original GitHub issue

When a config parameter has a default value, the user should be able to optionally omit it from the config file.

For example, since playgroundEnabled has a default value of true, the user need not specify it.

Currently, the server throws an exception for missing parameters.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
hrjcommented, Jan 7, 2022

The defaults can be what is inside the automatically created config file:

{
  "randomSeed" : some random integer,
  "port" : 8888,
  "address" : "0.0.0.0",
  "captchaExpiryTimeLimit" : 5,
  "throttle" : 1000,
  "threadDelay" : 2,
  "playgroundEnabled" : true,
  "corsHeader" : "",
  "maxAttempts" : 10,
}
0reactions
hrjcommented, Jan 8, 2022

Ideally, we shouldn’t change the type because it will break existing configurations.

I have added a suggestion to the PR, please have a look.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Optional parameters must specify a default value - Visual Basic
Optional parameters must provide default values that can be used if no parameter is supplied by a calling procedure. Error ID: BC30812. Example....
Read more >
Default parameters - JavaScript - MDN Web Docs
Default function parameters allow named parameters to be initialized with default values if no value or undefined is passed.
Read more >
Should I set my optional parameters default as false or true
Since I worked a lot with Vue.js recently, I now tend to always have my optional parameters' default value set to false and...
Read more >
Using Python Optional Arguments When Defining Functions
In this tutorial, you'll learn about Python optional arguments and how to define functions with default values. You'll also learn how to create...
Read more >
[request] Add optional default value to config.get() #504 - GitHub
If the config contains a name property, thing will be set to its value. If name does not exist, instead of throwing the...
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