Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark some properties on Resource classes with their correct property names #6254

Merged
merged 2 commits into from
Oct 5, 2021

Conversation

yawkat
Copy link
Member

@yawkat yawkat commented Sep 30, 2021

This PR marks some of the properties on Resource, AbstractResource and JsonError using @JsonProperty. These properties are already special cased in BeanIntrospectionModule and ResourceSerializerModifier, so this has no impact on jackson-based serialization, but it avoids having to implement the special case in generated serializers as well.

This change only adds a compileOnly dependency on jackson-annotations.

setLinks and setEmbedded have been marked public so that they can be accessed by deserializers generated for subclasses that are in a different package. setEmbedded has its parameter type changed to Map<String, Object> because there can be no generic deserializer for Resource anyway, and it doesn't matter because setEmbedded doesn't do anything anyway.

@yawkat yawkat added the type: improvement A minor improvement to an existing feature label Sep 30, 2021
@yawkat yawkat added this to the 3.1.0 milestone Sep 30, 2021
@jameskleeh jameskleeh merged commit 673ce76 into 3.1.x Oct 5, 2021
@jameskleeh jameskleeh deleted the mark-resource-properties-0 branch October 5, 2021 05:38
yawkat added a commit that referenced this pull request Mar 24, 2022
Support for JsonNaming was missing (same for the `property-naming-strategy` config property), and support for JsonProperty was spotty. This implements support for both.
Also removed some old code that special-cased the property names for `Resource`. Not needed anymore since #6254

Fixes #6904
Fixes #6665
Fixes #7129
Fixes micronaut-security/#946
sdelamo pushed a commit that referenced this pull request Mar 30, 2022
…7139)

Support for JsonNaming was missing (same for the `property-naming-strategy` config property), and support for JsonProperty was spotty. This implements support for both.
Also removed some old code that special-cased the property names for `Resource`. Not needed anymore since #6254

Fixes #6904
Fixes #6665
Fixes #7129
Fixes micronaut-security/#946
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: improvement A minor improvement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants