Optional headers with an empty value are converted to the empty string
Los mantenedores suelen responder en 1 día
@uschi2000 ya está trabajando en esto.
Desde el 13/8/2018.
- #1337 de @pkoenig10 — cerrado sin fusionar
Evaluación
Este issue todavía no se ha evaluado.
Descripción
What happened?
I have an endpoint method with an optional argument annotated by @HeaderParam:
@GET
@Path("/doStuff")
String doStuff(@HeaderParam("value") Optional<String> value);
I passed it the value Optional.empty() via a JaxRsClient:
MyService service = JaxRsClient.create(...
service.doStuff(Optional.empty())
However, the implementation of doStuff receives the value Optional.of(""), rather than Optional.empty().
There is a failing test case to show this at https://github.com/palantir/http-remoting/compare/develop...DoronShapiro:optional-header-tests.
This behavior happens because the implementation of Java8OptionalAwareContract serializes empty headers as an empty string, but when they are deserialized by the Java8OptionalParamConverterProvider, it is assumed that the value will be null if empty (and that the empty string represents a non-empty value).
What did you want to happen?
The server should receive a value of Optional.empty() for the header argument.
One solution is for the client to not include the header at all if its value is Optional.empty().
- Lenguaje dominante
- Java
- Estrellas
- 96
- Forks
- 95
- Merge medio
- 8 min
- PR fusionados (30 d)
- 55
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de palantir/conjure-java-runtime
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
palantir/conjure-java-runtime#3585 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 50/100
palantir/conjure-java-runtime#3166 ·
Los mantenedores suelen responder en 1 día
-
Support duration based retriesAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
palantir/conjure-java-runtime#2490 · 3 reacciones ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
palantir/conjure-java-runtime#2248 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
palantir/conjure-java-runtime#2131 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de palantir/conjure-java-runtime
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
micronaut-projects/micronaut-redis#844 ·
Los mantenedores suelen responder en 4 días
-
ai-driven-fuzzing bug claude Major
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
linagora/tmail-backend#2862 ·
Los mantenedores suelen responder en 1 día
-
ai-driven-fuzzing bug claude Minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
linagora/twake-calendar-side-service#1435 ·
Los mantenedores suelen responder en 1 día
-
Poetry updater rejects OR (||) Python constraints in PyprojectPreparer#update_python_requirementAbiertoL: python L: ruby:bundler
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
dependabot/dependabot-core#16819 ·
Los mantenedores suelen responder en 1 día
-
[Bug] Auto-trusted serialization allow list skips array component classesPosiblemente ocupada @Icesource la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día