Comments (4)
This definitely sounds like a problem I'd like to resolve, however I'm having some trouble reproducing it.
Would you mind adding a test that demonstrates the issue, perferably to ScalaApplicationSpecIT
, but if you can't stomach that mass of code, a standalone test would be fine too.
Ideally, it should fail, I imagine with a 'NullPointerException, or other reason that clearly demonstrates the default being
null`.
FWIW, Scala's optional arguments will never work with Jersey, as it's completely unaware of them. The Jersey way to define defaults for an argument is to use the @DefaultValue(...)
annotation on the argument. However, this is for customising a default argument for your code, and it definitely makes sense that Option
should default to None
, instead of null
.
from dropwizard-scala.
Could you also confirm the version of both Scala and dropwizard-scala that you're using?
from dropwizard-scala.
Thanks for responding. I'm just trying to maintain the status quo while switching libraries here. Somehow defaults were supported before, so I'm curious as to whether or not I'm crazy or something bigger changed.
I have a PR with a couple tests, fwiw, but it sounds like this is working as expected per your comments above #7
from dropwizard-scala.
Yeah, so your tests pretty much confirm what I said above. I'm not sure how Scala's default arguments can ever have worked in Jersey, given the way they compile.
I'm afraid that, since this is the expected behaviour, there's nothing I can really do about it. Your best bet would be to use @DefaultValue(Some(...))
instead of Scala's default arguments. Not ideal, but then Jersey doesn't exactly integrate great with Scala anyway.
from dropwizard-scala.
Related Issues (15)
- Maven artefacts HOT 3
- Freemarker support HOT 1
- What is the relation of this project with metrics-scala? HOT 1
- ProductResultSetMapper doesn't properly handle null fields HOT 1
- add LICENSE
- ProdectResultsetMapper can not handle List[Int] as the return type from dao function. HOT 1
- Question on how to return query results as Seq HOT 3
- QueryParam of Option of scala primitive results in error HOT 3
- Disambiguate inTransaction(TransactionIsolationLevel)
- Support for Dropwizard 2.0.x HOT 4
- Support dropwizard 0.8.0 HOT 4
- Cross compile for Scala 2.11
- Error in reading default configuration in Scala application only HOT 1
- Approval to point official Dropwizard docs here HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dropwizard-scala.