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

Configuring JsonPOJOBuilder "withPrefix" on external configuration file #51

Open
ghost opened this issue Apr 12, 2018 · 2 comments
Open

Comments

@ghost
Copy link

ghost commented Apr 12, 2018

It would be really nice if the default withPrefix property in JsonPOJOBuilder could be exposed in a property file. (Same goes for some of the other properties, but this is the one I want to focus on)

That way, when I am writing my builder according to company standards, I don't have to worry about adding the annotation manually. Also consider that when using lombok, the @builder annotation, the builder methods are just variablename and not withVariablename.

I think the more configurable a project can be, the better.

@cowtowncoder
Copy link
Member

Jackson does not directly support any form of external configuration (either from properties or via system properties), and this is by design.

I would be open to additional module(s) for support such configurability, but I don't think it belongs in core jackson-databind. It probably would make sense to do that as part of 3.0 version as well, since that will use builder-style construction where this might plug in nicely (maybe).

So you may want to file this at:

https://github.com/FasterXML/jackson-future-ideas/

Another thing to consider is that on short term you can sub-class JacksonAnnotationIntrospector and use different mechanism for exposing configuration same as if annotations were used.
Source could be external config file or such.
And finally, mix-in annotations can sometimes work as well.

@cowtowncoder cowtowncoder changed the title Property for JsonPOJOBuilder withPrefix Configuring JsonPOJOBuilder "withPrefix" on external configuration file May 24, 2020
@cowtowncoder
Copy link
Member

I have no plans to implement configuration system that uses external configuration files: this sounds like something an extension project could tackle, or maybe module.
Will move to "future ideas" repo.

@cowtowncoder cowtowncoder transferred this issue from FasterXML/jackson-databind May 24, 2020
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

No branches or pull requests

1 participant