palantir / palantir/conjure-java
Conjure-generated client does not properly serialize nested aliases in PLAIN context
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 39
- Forks
- 49
- Avg merge
- 8h 22m
- Merged PRs (30d)
- 32
Description
Generate a Conjure client using the following definition:
types:
definitions:
default-package: com.palantir.product
objects:
AliasOne:
alias: string
AliasTwo:
alias: optional<AliasOne>
AliasThree:
alias: AliasTwo
services:
EteService:
name: Ete Service
package: com.palantir.product
base-path: /base
endpoints:
aliasThree:
http: GET /aliasThree
args:
queryParamName:
param-type: query
type: AliasThree
returns: AliasThree
Make the following client call:
eteService.aliasThree(AliasThree.of(AliasTwo.of(Optional.empty()))
Expected
Calls the endpoint with no query parameters (because serialized equivalent is Optional.empty())
Actual
Calls the endpoint with a query parameter that consists of the literal string Optional.empty
The same issue exists for non-optional calls:
eteService.aliasThree(
AliasThree.of(AliasTwo.of(Optional.of(AliasOne.of("hello"))))
Expected
Query parameter value is hello
Actual
Query parameter value is Optional[hello]
Based on this, it appears that PLAIN serialization does not properly work for alias types nested in optionals.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Generate the client from the provided Conjure definition and reproduce the aliasThree calls in the generated client. Start at the PLAIN serialization path used for the query parameter; done means Optional.empty produces no parameter and the nested value produces hello rather than Optional[hello].
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100