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

Hotfix/out of memory error 6394 #7625

Closed

Conversation

xmeng1
Copy link
Contributor

@xmeng1 xmeng1 commented Feb 9, 2018

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

(details of the change, additional tests that have been done, reference to the issue for tracking, etc)

Hotfix for the issue #6394

Copy link
Contributor

@dariota dariota left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see the comments on the files, and if you could fill out the description in the PR summary as well for when this gets to being merged that would help as well.

@@ -1,18 +1,39 @@
package io.swagger.codegen.examples;

import static io.swagger.models.properties.StringProperty.Format.URI;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of these changes to the imports are unnecessary - could you change them back to how they were?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because of the automatically format of IntelliJ. And I have changed the import back.

@@ -179,6 +179,7 @@ private Object resolvePropertyToExample(String propertyName, String mediaType, P
if (innerType != null) {
int arrayLength = null == ((ArrayProperty) property).getMaxItems() ? 2 : ((ArrayProperty) property).getMaxItems();
if(arrayLength>10000) {
logger.warn("The max item is too large to new Object array and set it to 10000, the previous value is {}", arrayLength);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This warning message is a bit unclear. Could you change it to something like logger.warn("The max items allowed in property {} is too large ({} items), restricting it to 10,000 items", property, arrayLength)?

Copy link
Contributor

@dariota dariota left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks fine to me. I'm fairly confident the CirleCI failures are unrelated.

@dariota dariota mentioned this pull request May 13, 2018
Wagan8r added a commit to Wagan8r/swagger-codegen that referenced this pull request Jan 24, 2019
Applied the fix listed in a PR on the official swagger-codegen project: swagger-api#7625. The maintainers are dragging their feet on merging it...
@frantuma
Copy link
Member

Thanks for the PR; a fix, limiting to 10 examples, has been applied in #9553, therefore closing this one.

@frantuma frantuma closed this Jul 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants