[scala-sttp4-jsoniter] extend Primitive type with UUID, LocalDate and OffsetDateTime#23801
Conversation
|
thanks for the PR cc @clasnake (2017/07), @shijinkui (2018/01), @ramzimaalej (2018/03), @chameleon82 (2020/03), @Bouillie (2020/04) @Fish86 (2023/06) |
|
@reynaldjoabet are you using this change in your production environment to confirm it works for your use cases? |
|
Is there a minimal spec to easily reproduce the issue and confirm the fix? That will help speed up the review and get it merged sooner |
Yes. Three single-parameter snippets, each one independently reproduces a failure on the current 1.
|
Extend the
Primitiveunion type inhelpers.mustachewithUUID,LocalDate, andOffsetDateTimeso that path, query, header, cookie, andform parameters typed with these formats serialize via
.toString()on thefast primitive path. Without this, fields generated from
format: uuid,format: date, andformat: date-timefall through to the Mirror-basedobject path and fail at compile time because they are not products or sums.
@lbialy @flsh86
PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master(upcoming7.x.0minor release - breaking changes with fallbacks),8.0.x(breaking changes without fallbacks)"fixes #123"present in the PR description)Summary by cubic
Extended
Primitiveinscala-sttp4-jsoniterto includeUUID,LocalDate, andOffsetDateTime, enabling fast-path.toString()serialization foruuid,date, anddate-timeparams. This removes the Mirror fallback and fixes compile errors in generated clients.Primitiveunion.Written for commit 95ad1f8. Summary will update on new commits. Review in cubic