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

Issue 9926 #9930

Merged
merged 11 commits into from
Apr 9, 2020
Merged

Issue 9926 #9930

merged 11 commits into from
Apr 9, 2020

Conversation

mitchnull
Copy link
Contributor

@mitchnull mitchnull commented Dec 10, 2019

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: 3.0.0 branch for changes related to OpenAPI spec 3.0. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

implement issue #9926 ("parentContainer" property). Add "itemsDepth" property for proper nested variable name creation in templates (without shadowing violations).

@mitchnull
Copy link
Contributor Author

Erm, how can I add a reviewer? Any chance of this getting merged?

@HugoMario
Copy link
Contributor

Hi @mitchnull, i can help with review, thanks a lot for PR btw!

@mitchnull
Copy link
Contributor Author

Hi @mitchnull, i can help with review, thanks a lot for PR btw!

Hello,

Thanks! Let me know what are the next steps to take with this.

cheers,
mitch

@HugoMario
Copy link
Contributor

The PR looks good to me, i don't see this could affect current output code from generators, i just have one doubt, why public CodegenModel parentModel is not working for what you need on #9926 ?

@mitchnull
Copy link
Contributor Author

mitchnull commented Apr 9, 2020

TBH, I haven't found parentModel when I tried to solve my problem, I'll check it now... At a quick glance it seems to only work for polymorphic models. The parentContainer is set when the parent is just a plain List or Map, like with this model:

ArrOfString:
  type: array
  items:
    type: string

I believe parentModel doesn't help with the above case. Also, I still need the itemsDepth for the variable-declarations to avoid shadowing.

@HugoMario HugoMario merged commit 1ebde9c into swagger-api:master Apr 9, 2020
@HugoMario
Copy link
Contributor

got it, thanks again for PR!

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.

3 participants