Skip to content

Conversation

@streibeb
Copy link
Contributor

@streibeb streibeb commented Feb 5, 2021

Toggle the inclusion of the @generated annotation

@jxnu-liguobin
Copy link
Collaborator

sbt must use mappingConfig to set for every project, like this
image

@kobylynskyi kobylynskyi self-requested a review February 7, 2021 01:27
@kobylynskyi kobylynskyi self-assigned this Feb 7, 2021
@kobylynskyi kobylynskyi added the enhancement New feature or request label Feb 7, 2021
Copy link
Owner

@kobylynskyi kobylynskyi left a comment

Choose a reason for hiding this comment

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

@streibeb, thanks for the contribution. I think this change may be useful.
In addition to all the comments I made in individual files, could you please add some unit tests?
Thank you!

generateClient := MappingConfigConstants.DEFAULT_GENERATE_CLIENT,
generateParameterizedFieldsResolvers := MappingConfigConstants.DEFAULT_GENERATE_PARAMETERIZED_FIELDS_RESOLVERS,
generateExtensionFieldsResolvers := MappingConfigConstants.DEFAULT_GENERATE_EXTENSION_FIELDS_RESOLVERS,
addGeneratedAnnotation := MappingConfigConstants.DEFAULT_ADD_GENERATED_ANNOTATION,
Copy link
Owner

Choose a reason for hiding this comment

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

Isn't this duplicated?

}
}
}
protected final MappingConfig mappingConfig;
Copy link
Owner

Choose a reason for hiding this comment

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

In this repository, we use spaces instead of tabs, sorry 😄
Could you please change only the required lines and use spaces?
Thanks

private List<ParameterDefinition> getFields(List<ExtendedFieldDefinition> fieldDefinitions, ExtendedDefinition<?, ?> parentDefinition) {
return this.dataModelMapperFactory.getFieldDefinitionToParameterMapper().mapFields(this, fieldDefinitions, parentDefinition);
}
private final MappingConfig config;
Copy link
Owner

Choose a reason for hiding this comment

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

It's hard to tell which changes were made to the class. Could you please use spaces instead of tabs? Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, sorry!

</#list>
*/
</#if>
<#if generatedAnnotation>
Copy link
Owner

Choose a reason for hiding this comment

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

You can merge two statements:

<#if generatedAnnotation && generatedInfo.getGeneratedType()?has_content>

This refers to all .ftl files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was looking for the and operator and couldn't find anything about it! Will fix!

@streibeb streibeb requested a review from kobylynskyi February 8, 2021 16:52
Copy link
Owner

@kobylynskyi kobylynskyi left a comment

Choose a reason for hiding this comment

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

@streibeb, looks good. Thanks for the contribution. I will update codegen-options.md

@kobylynskyi kobylynskyi merged commit dd048a3 into kobylynskyi:master Feb 8, 2021
@kobylynskyi kobylynskyi added this to the 4.1.3 milestone Feb 8, 2021
generateClient := MappingConfigConstants.DEFAULT_GENERATE_CLIENT,
generateParameterizedFieldsResolvers := MappingConfigConstants.DEFAULT_GENERATE_PARAMETERIZED_FIELDS_RESOLVERS,
generateExtensionFieldsResolvers := MappingConfigConstants.DEFAULT_GENERATE_EXTENSION_FIELDS_RESOLVERS,
addGeneratedAnnotation := MappingConfigConstants.DEFAULT_ADD_GENERATED_ANNOTATION,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please use mappingConfig to assign values to each project scope, Otherwise, the configuration is invalid

Copy link
Owner

Choose a reason for hiding this comment

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

@jxnu-liguobin could you please make the change? I already merged the PR to master branch. Thank you!

Copy link
Collaborator

Choose a reason for hiding this comment

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

@kobylynskyi The merged code no problem, has been modified

Copy link
Collaborator

@jxnu-liguobin jxnu-liguobin left a comment

Choose a reason for hiding this comment

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

lgtm

@kobylynskyi
Copy link
Owner

@streibeb, was released in 4.1.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants