Skip to content

[Scala] Overriden objectmapper wasn't used in deserialisation #4532

@lachatak

Description

@lachatak
Description

Overriden objectmapper is not used in deserialisation because in the api.mustache there is a typo so there is a new ApiInvoker creation every time you deserialise a response via the companion object. The side effect is that you cannot override the object mapper in the invoker.

api.mustache
{{#returnType}} Some(ApiInvoker.deserialize(s, "{{returnContainer}}", classOf[{{returnBaseType}}]).asInstanceOf[{{returnType}}])

Steps to reproduce

Generate any Scala client from any swagger document. See samples..

Suggest a Fix

Change api.mustache to be the following
{{#returnType}} Some(apiInvoker.deserialize(s, "{{returnContainer}}", classOf[{{returnBaseType}}]).asInstanceOf[{{returnType}}])

I have a fix ready to PR.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions