Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expose parentContainer to templates #9926

Open
mitchnull opened this issue Dec 10, 2019 · 0 comments
Open

expose parentContainer to templates #9926

mitchnull opened this issue Dec 10, 2019 · 0 comments

Comments

@mitchnull
Copy link
Contributor

mitchnull commented Dec 10, 2019

Description

I'm extending the models generated from swaggers with a deepCopy() method for java. For this I need to generate code based on the property types, but in case the basetype is List or Map, the detailed type information is lost to the templates.

I propose exposing the "parentContainer" type in these cases similar to how "items" are exposed for container properties.

The proof-of-concept code is ready, I'll file a PR soon.

Swagger-codegen version

2.4.10, 2.4.11-SNAPSHOT (HEAD)

Swagger declaration file content or url
swagger: "2.0"
info:
  version: "1.0.0"
  title: "test"

paths: {}

definitions:
  ArrType:
    type: array
    items:
      type: string
      format: date-time
Command line used for generation

java -jar ~/.m2/repository/io/swagger/swagger-codegen-cli/2.4.10/swagger-codegen-cli-2.4.10.jar generate -i testarr.yaml -l java -o /tmp/test -DdebugModels=true > logarr-orig.txt

java -jar ~/src/swagger-codegen/modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -i testarr.yaml -l java -o /tmp/test -DdebugModels=true > logarr.txt

Steps to reproduce

N/A

Related issues/PRs

The PR will include the fix for #9918

Suggest a fix/enhancement

will file a PR

logarr-orig.txt
logarr.txt

@mitchnull mitchnull mentioned this issue Dec 10, 2019
4 tasks
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

No branches or pull requests

1 participant