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

add option to disable Jackson annotations#169

Merged
tangiel merged 5 commits intomasterfrom
jackson-opt
Sep 20, 2018
Merged

add option to disable Jackson annotations#169
tangiel merged 5 commits intomasterfrom
jackson-opt

Conversation

@tangiel
Copy link
Contributor

@tangiel tangiel commented Sep 19, 2018

Endpoints previously bundled the Jackson annotation introspector,
which didn't really have an effect when Jackson was a vendored and
repackaged dependency. Now that it's an explicit dependency, the
annotations can clash with previous Endpoints behavior when the
annotations are used outside of an Endpoints context.

This change adds an option to disable the Jackson behavior, which is
done so by setting ENDPOINTS_JSON_DISABLE_JACKSON_ANNOTATIONS to a
truthy value or the endpoints.json.disableJacksonAnnotations system
property.

Consequently, this change also refactors MapSchemaFlag into a general
EndpointsFlag class for future use, as it is more flexible and easy to
implement than the ServletInitializationParameters flags.

Endpoints previously bundled the Jackson annotation introspector,
which didn't really have an effect when Jackson was a vendored and
repackaged dependency. Now that it's an explicit dependency, the
annotations can clash with previous Endpoints behavior when the
annotations are used outside of an Endpoints context.

This change adds an option to disable the Jackson behavior, which is
done so by setting ENDPOINTS_JSON_DISABLE_JACKSON_ANNOTATIONS to a
truthy value or the endpoints.json.disableJacksonAnnotations system
property.

Consequently, this change also refactors MapSchemaFlag into a general
EndpointsFlag class for future use, as it is more flexible and easy to
implement than the ServletInitializationParameters flags.
@codecov-io
Copy link

codecov-io commented Sep 19, 2018

Codecov Report

Merging #169 into master will increase coverage by 0.02%.
The diff coverage is 90.47%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #169      +/-   ##
============================================
+ Coverage     80.22%   80.24%   +0.02%     
- Complexity     1712     1715       +3     
============================================
  Files           158      158              
  Lines          5698     5704       +6     
  Branches        751      755       +4     
============================================
+ Hits           4571     4577       +6     
- Misses          843      844       +1     
+ Partials        284      283       -1
Impacted Files Coverage Δ Complexity Δ
.../api/server/spi/config/model/SchemaRepository.java 92.42% <100%> (ø) 38 <0> (ø) ⬇️
...va/com/google/api/server/spi/ObjectMapperUtil.java 51.11% <100%> (ø) 5 <0> (+1) ⬆️
...gle/api/server/spi/config/model/EndpointsFlag.java 88.23% <88.23%> (ø) 5 <5> (?)
...c/main/java/com/google/api/server/spi/EnvUtil.java 70% <0%> (ø) 8% <0%> (ø) ⬇️
.../server/spi/discovery/CommonPathPrefixBuilder.java 100% <0%> (+5.55%) 9% <0%> (+1%) ⬆️

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 6bb25ed...0c830cb. Read the comment docs.

@tangiel tangiel requested a review from inklesspen September 20, 2018 16:47
@tangiel tangiel merged commit fc0b56e into master Sep 20, 2018
@tangiel tangiel deleted the jackson-opt branch September 20, 2018 19:21
Sign up for free to 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.

3 participants