Skip to content

Conversation

@deepak2016
Copy link
Contributor

…models related files.

This is an initial change to fix imports for java files. (Formatting appearing in visual studio and in github change looks a bit different)
These changes in templates only fixes the import statements and doesn't change any other content of the java files.

Testing steps:

  1. Generated models and requests files using generator code.
  2. Copied over models-generated and requests-generated completely to java sdk corresponding directory
  3. Copied over new models-extensions and requests-extensions file to java sdk corresponding locations
  4. Built java sdk with success

@MIchaelMainer MIchaelMainer self-requested a review May 29, 2018 18:10
@MIchaelMainer MIchaelMainer self-assigned this May 29, 2018
Copy link
Collaborator

@MIchaelMainer MIchaelMainer left a comment

Choose a reason for hiding this comment

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

This looks good. I've add a couple minor review entries.

import java.util.EnumSet;", host.CurrentModel.NamespaceName());

sb.Append("\n");
var format = @"import {0}.{1}.{2};";
Copy link
Collaborator

Choose a reason for hiding this comment

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

rename 'format' to 'importFormat'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed.

"models.extensions",
"PlannerChecklistItem");
sb.Append("\n");
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why are we special casing BasePlannerAssignments and BasePlannerChecklistItems? What are we getting here that we don't get from within the if(baseClassNameType != ""). Assuming there is good reason for this, we should consider maintaining a list of extension files outside of the template logic code and then document the use of this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are due to overrides present in CustomOverwrites.cs file. Needed to handle these cases separately.

{
foreach (var property in properties.Where(p => p.IsCollection() && p.IsNavigation()))
{
var propertyType = BaseTypeCollectionResponse(property);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Move this statement after the OdcmPrimitiveType check and continue statement.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved.

}
return "<" + BaseTypeCollectionResponse(c) + ", " + ITypeCollectionPage(c) + ">";
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Provide comments for the functions you add.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added comments

@MIchaelMainer
Copy link
Collaborator

I'd like to add a step 1A to the review for change steps:
1A) Compared the files generated with the changes against existing files and see the expected changes in existing files.

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