Skip to content

Refactored the way Play access config#4093

Merged
richdougherty merged 1 commit intoplayframework:masterfrom
jroper:config-refactor
Mar 18, 2015
Merged

Refactored the way Play access config#4093
richdougherty merged 1 commit intoplayframework:masterfrom
jroper:config-refactor

Conversation

@jroper
Copy link
Member

@jroper jroper commented Mar 18, 2015

  • Introduced PlayConfig helper which is more suited to idiomatic use of Typesafe config
  • Migrated a number of config options from old paths to new paths
  • Removed "modules" from configuration keys
  • Moved more settings to reference.conf
  • Introduced idiom of using "null" rather than blank or no setting for default values.

* Introduced PlayConfig helper which is more suited to idiomatic use of
Typesafe config
* Migrated a number of config options from old paths to new paths
* Removed "modules" from configuration keys
* Moved more settings to reference.conf
* Introduced idiom of using "null" rather than blank or no setting for
  default values.
@jroper jroper mentioned this pull request Mar 18, 2015
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe mention that ConfigException.Missing will still be thrown for entries that don't have a null value? I found it a bit hard to understand until I read the Typesafe Config docs and looked at PlayConfigSpec.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do in another pull request that I'm currently working on.

richdougherty added a commit that referenced this pull request Mar 18, 2015
Refactored the way Play access config
@richdougherty richdougherty merged commit be7e96a into playframework:master Mar 18, 2015
@richdougherty
Copy link
Member

@jroper, I had a minor suggestion for an extra comment but I'm merging this PR now because I know it's blocking you.

@richdougherty
Copy link
Member

👍 Overall, a nice improvement.

@jroper jroper deleted the config-refactor branch March 18, 2015 22:42
@He-Pin
Copy link
Contributor

He-Pin commented Mar 23, 2015

for the module configuration,how about ,using the annotation,like
@ModuleConfigPath(path = "play.ws") for ws,then there is no need to using Configuration.getConfig("play.ws") in the WSModule.and.
like

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Inherited
public @interface ModuleConfigPath{
    String path();
}

and then something like this

      val moduleConfigPath = moduleClass().getAnnotationsByType(classOf[ModuleConfigPath]).head.path()
val moduleConfig = Configuration.reference.getConfig(moduleConfigPath)

rtyley added a commit to guardian/atom-workshop that referenced this pull request Jan 26, 2024
Prompted by this error message in the logs:

application.conf @ file:/usr/share/atom-workshop/conf/application.conf: 9: parsers.text.maxLength is deprecated, use play.http.parser.maxMemoryBuffer instead

Apparently the parsers.text.maxLength property has been deprecated since
Play 2.4 and playframework/playframework#4093

https://www.playframework.com/documentation/2.9.x/ScalaBodyParsers#Max-content-length

In atom-workshop, the increased size was set to allow bigger chart atoms:

#272
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

Successfully merging this pull request may close these issues.

3 participants