Skip to content

Conversation

@diegomarquezp
Copy link
Contributor

@diegomarquezp diegomarquezp commented Oct 25, 2022

Added ArrayExpr to allow anonymous arrays (e.g. {"value1", "value2"}). Same type validation is enforced (e.g. {"string1", 1.2f} is not allowed).
AnnotationNode now allows an ArrayExpr as a single description. For multiple descriptions, a wrapping AssignmentExpr is still needed.

This PR is to help generate annotations with an anonymous array like this @EnableConfigurationProperties({LanguageProperties.class, SharedProperties.class})

It also enables assignments to arrays in the form String[] arr = {"str1", "str2"} - both arr and the anon array should be of type TypeNode.arrayOf(TypeNode.STRING) for this example (arrayOf() was also introduced in this PR)

@diegomarquezp diegomarquezp changed the title Autoconfig gen draft2 array annotation feat(ast): anonymous arrays for annotations Oct 25, 2022
@diegomarquezp diegomarquezp marked this pull request as ready for review October 26, 2022 19:27
@diegomarquezp diegomarquezp requested a review from a team October 26, 2022 19:27
@diegomarquezp diegomarquezp requested a review from a team as a code owner October 26, 2022 19:27
@diegomarquezp diegomarquezp marked this pull request as draft October 26, 2022 21:31
@diegomarquezp diegomarquezp force-pushed the autoconfig-gen-draft2-array-annotation branch from 222e841 to 6974740 Compare October 27, 2022 17:57
@diegomarquezp
Copy link
Contributor Author

Force pushed an alternate approach using ArrayValue

@diegomarquezp diegomarquezp force-pushed the autoconfig-gen-draft2-array-annotation branch from 609a6fc to 016dc32 Compare October 28, 2022 18:11
@diegomarquezp diegomarquezp force-pushed the autoconfig-gen-draft2-array-annotation branch from fdb794b to e2d08c4 Compare October 28, 2022 18:43
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 5 Code Smells

82.8% 82.8% Coverage
0.0% 0.0% Duplication

@diegomarquezp diegomarquezp marked this pull request as ready for review October 31, 2022 16:55
@diegomarquezp diegomarquezp changed the title feat(ast): anonymous arrays for annotations feat(ast): array expressions Oct 31, 2022
@blakeli0
Copy link
Contributor

blakeli0 commented Nov 1, 2022

Can you delete this PR and open another PR against main branch? As this would be a good feature added to the generator itself

@diegomarquezp
Copy link
Contributor Author

Closing by request

suztomo pushed a commit that referenced this pull request Mar 21, 2023
* deps: update dependency com.google.api:gax-bom to v2.21.0

* deps: Updating proto-google-common-protos to 2.12.0

Co-authored-by: Deepankar Dixit <90280028+ddixit14@users.noreply.github.com>
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.

2 participants