Skip to content

[BUG][SCALA] instantiationType array is missed in Scalatra generator #5507

@chameleon82

Description

@chameleon82

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)

Scalatra server template generating wrong default value new null[]() instead of 'List[String].emptydue missedarray` instantiationType

Description
openapi-generator version

2.3.0-SNAPSHOT

OpenAPI declaration file content or url

https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml

Command line used for generation
Steps to reproduce

regenerate scalatra server - default value has incorrect value new null[](). should be List[String].empty

Related issues/PRs

Related code 25036e4#diff-62e3a15550247bb6a76bdc7745faa850R265

Suggest a fix

Add instantiationTypes.put("array", "List"); at abstract level or per template if array has specific meaning

@jimschubert

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions