Skip to content

[kotlin-client] add ignoreUnknownKeys for kotlinx serialization#13016

Closed
kassim wants to merge 1 commit intoOpenAPITools:masterfrom
kassim:kotlinx_serialization_unknown_keys
Closed

[kotlin-client] add ignoreUnknownKeys for kotlinx serialization#13016
kassim wants to merge 1 commit intoOpenAPITools:masterfrom
kassim:kotlinx_serialization_unknown_keys

Conversation

@kassim
Copy link
Copy Markdown
Contributor

@kassim kassim commented Jul 26, 2022

fixes #13013

initialises the Json instance for kotlinx serialization with ignoreUnknownKeys = true so that deserialisation doesn't fail when new keys are added to the API

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    
    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*.
    For Windows users, please run the script in Git BASH.
  • File the PR against the correct branch: master (6.1.0) (minor release - breaking changes with fallbacks), 7.0.x (breaking changes without fallbacks)
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@jimschubert (2017/09) ❤️, @dr4ke616 (2018/08) @karismann (2019/03) @Zomzog (2019/04) @andrewemery (2019/10) @4brunu (2019/11) @yutaka0m (2020/03)

@4brunu
Copy link
Copy Markdown
Contributor

4brunu commented Jul 26, 2022

@kassim Hey, thanks for opening this PR.
I have created #12930 that among other things it also fixes this.
Could you please take a look at it to see if it fixes this issue?
Thanks

@kassim
Copy link
Copy Markdown
Contributor Author

kassim commented Jul 26, 2022

@4brunu it does fix it – thank you!

@kassim kassim closed this Jul 26, 2022
@kassim kassim deleted the kotlinx_serialization_unknown_keys branch July 26, 2022 08:49
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.

[BUG] [kotlin-client] kotlinx_serialization deserialization fails on unexpected/unknown keys

2 participants