-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
[aspnetcore] Fix new keyword collection #385
[aspnetcore] Fix new keyword collection #385
Conversation
@@ -58,7 +58,7 @@ | |||
public Set<String> allMandatory; | |||
|
|||
public Set<String> imports = new TreeSet<String>(); | |||
public boolean hasVars, emptyVars, hasMoreModels, hasEnums, isEnum, hasRequired, hasOptional, isArrayModel, hasChildren; | |||
public boolean hasVars, emptyVars, hasMoreModels, hasEnums, isEnum, hasRequired, hasOptional, isArrayModel, hasChildren, isCollectionModel; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I may be wrong as I'm new to aspnetcore)
How about add isMapModel
instead of isCollectionModel
?
I think isCollectionModel
is a bit complicated: It is ArraySchema and also MapSchema.
To keep our project as simple as possible, I think isMapModel
may be better.
For template creator:
- in case of treating ArraySchema =>
{{isArrayModel}}
- in case of treating MapSchema =>
{{isMapModel}}
- in case of treating something collection =>
{{isArrayModel}}
&{{isMapModel}}
Assuming that isMapModel
exists, it is a good idea to add isCollectionModel
as it can be possible handling some collection models transparently. But if we can satify our requirements without it for now, we need to postpone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update. Looks good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Will merge this at the end of the day if there is no more comment :) |
@JFCote: I have added milestone |
@jmini Oups sorry, that was my first merge. I've taken note of this and will take care of that next time! Thanks! |
;) |
@JFCote: No worry and thank you a lot for merging PRs. Please continue to merge stuff you are comfortable with. An other feedback, in this project we tend to prefer the "Squash and merge" option on GitHub: The debate about which option to select is infinite. There are pro and contra for each way. What matters the most to me: we try to all work the same way. This produce a certain homogeneity in the project. |
Added this PR to 3.0.3 release note. |
PR checklist
./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\
.master
,3.1.x
,4.0.x
. Default:master
.Description of the PR
Add
isMapModel
toCodegenModel
to allow distinguishing if a Model is inherited fromICollection
.Small refactor in
model.mustache
to allow removal of some VS hints.Solves #275
@mandrean @jimschubert
cc core team for
DefaultCodegen
andCodegenModel
Changes@wing328 @jimschubert @cbornet @jaz-ah @ackintosh @JFCote @jmini