-
Notifications
You must be signed in to change notification settings - Fork 6k
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
JS client: Model methods should be added to prototype #2044
Labels
Comments
I submitted a PR. Note that it does not deal with the two "additional comments" above. |
delenius
pushed a commit
to delenius/swagger-codegen
that referenced
this issue
Feb 6, 2016
delenius
added a commit
to delenius/swagger-codegen
that referenced
this issue
Feb 6, 2016
delenius
added a commit
to delenius/swagger-codegen
that referenced
this issue
Feb 8, 2016
This is just the result of running ./bin/javascript-petstore.sh after the fix for swagger-api#2044.
delenius
added a commit
to delenius/swagger-codegen
that referenced
this issue
Feb 8, 2016
Fixes "additional comment swagger-api#2" in swagger-api#2044. Saves memory by not repeating the `toJson` method in every model class. The new `ApiModel` base class may also be useful for other purposes in the future.
delenius
added a commit
to delenius/swagger-codegen
that referenced
this issue
Feb 9, 2016
Fixes "additional comment swagger-api#2" in swagger-api#2044. Saves memory by not repeating the `toJson` method in every model class. The new `ApiModel` base class may also be useful for other purposes in the future.
delenius
added a commit
to delenius/swagger-codegen
that referenced
this issue
Feb 12, 2016
Fixes "additional comment swagger-api#2" in swagger-api#2044. Saves memory by not repeating the `toJson` method in every model class. The new `ApiModel` base class may also be useful for other purposes in the future.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In the generated model classes, each instance contains the methods
constructFromObject
,toJson
, plus getters and setters for all the fields. Currently, these methods are added as anonymous functions to each instance. Meaning, if I have 100 instances of some class, I have 100 copies of each of the methods.These should be added to the class's prototype instead. For example, instead of (current version)
it should generate (new version):
Two additional comments:
The text was updated successfully, but these errors were encountered: