spring-projects / spring-projects/spring-framework

Document default property converters [SPR-15269]

Open
#19,834 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

in: core type: documentation
Dominant language
Java
Stars
60.2k
Forks
38.8k
Avg merge
5d 2h
Merged PRs (30d)
27

Description

Arend v. Reinersdorff opened SPR-15269 and commented

Spring includes by default a number of useful property converters. Ie values for the targetType parameter in PropertyResolver.getProperty(String key, Class targetType).

Unfortunately these default converters are not documented. The best answer on Stackoverflow suggests executing ConversionService.toString() to get a list of converters.

I was looking for documentation because I was surprised that java.io.File works as targetType while java.nio.file.Path does not. (Turns out File probably works because of the ObjectToObjectConverter that finds the File(String) constructor via reflection)


Affects: 4.3.6

Reference URL: http://docs.spring.io/spring/docs/4.3.6.RELEASE/spring-framework-reference/html/validation.html

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the validation reference documentation linked in the issue and the PropertyResolver.getProperty(String key, Class targetType) entry point. Inspect the default ConversionService converters, including the behavior noted for java.io.File and java.nio.file.Path; done means the supported default property target types and relevant limitations are documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.