Skip to content
This repository was archived by the owner on Jun 30, 2023. It is now read-only.

Fix inconsistent enum constant names between schema and serialization - #181

Open
clementdenis wants to merge 1 commit into
cloudendpoints:masterfrom
AODocs:custom_enum_constant_name
Open

Fix inconsistent enum constant names between schema and serialization#181
clementdenis wants to merge 1 commit into
cloudendpoints:masterfrom
AODocs:custom_enum_constant_name

Conversation

@clementdenis

Copy link
Copy Markdown
Contributor
  • param and resource de/serialization uses Jackson configuration
  • schema generation used Enum.name(), should use Jackson instead

Use case: Having custom @JsonProperty("enumValue") on enum constants is useful when implementing an API with param values that are not valid Java identifiers (for example, with dots).

Note: the new method Types.getEnumValuesAndDescriptions might not be at an ideal location, but I could not find a better place to extract it.

- param and resource de/serialization uses Jackson configuration
- schema generation used Enum.name(), should use Jackson instead
@codecov-io

Copy link
Copy Markdown

Codecov Report

Merging #181 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@ Coverage Diff @@## master #181 +/- ##
============================================
+ Coverage 80.06% 80.09% +0.03% 
Complexity 1715 1715 ============================================
Files 159 159 Lines 5718 5727 +9 Branches 754 753 -1 ============================================
+ Hits 4578 4587 +9 
Misses 856 856 Partials 284 284
Impacted FilesCoverage ΔComplexity Δ
.../api/server/spi/config/model/SchemaRepository.java92.42% <100%> (ø)37 <0> (-2)⬇️
...e/api/server/spi/discovery/DiscoveryGenerator.java88.93% <100%> (ø)62 <0> (-2)⬇️
...oogle/api/server/spi/swagger/SwaggerGenerator.java78.08% <100%> (-0.26%)59 <1> (-1)
.../com/google/api/server/spi/config/model/Types.java91.93% <100%> (+1.93%)37 <5> (+5)⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 39b7374...1a12a04. Read the comment docs.

@codecov-commenter

codecov-commenter commented Jun 11, 2020

Copy link
Copy Markdown

Codecov Report

Merging #181 into master will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@ Coverage Diff @@## master #181 +/- ##
============================================
+ Coverage 80.06% 80.09% +0.03% 
Complexity 1715 1715 ============================================
Files 159 159 Lines 5718 5727 +9 Branches 754 753 -1 ============================================
+ Hits 4578 4587 +9 
Misses 856 856 Partials 284 284 
Impacted FilesCoverage ΔComplexity Δ
.../api/server/spi/config/model/SchemaRepository.java92.42% <100.00%> (ø)37.00 <0.00> (-2.00)
.../com/google/api/server/spi/config/model/Types.java91.93% <100.00%> (+1.93%)37.00 <5.00> (+5.00)
...e/api/server/spi/discovery/DiscoveryGenerator.java88.93% <100.00%> (ø)62.00 <0.00> (-2.00)
...oogle/api/server/spi/swagger/SwaggerGenerator.java78.08% <100.00%> (-0.26%)59.00 <1.00> (-1.00)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 39b7374...1a12a04. Read the comment docs.

Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@clementdenis@codecov-io@codecov-commenter@alarribeau