Skip to content

Jackson2ObjectMapperBuilder does not support DatatypeFeature #31379

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

Closed
bramhaag opened this issue Oct 8, 2023 · 1 comment
Closed

Jackson2ObjectMapperBuilder does not support DatatypeFeature #31379

bramhaag opened this issue Oct 8, 2023 · 1 comment
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: superseded An issue that has been superseded by another type: enhancement A general enhancement

Comments

@bramhaag
Copy link
Contributor

bramhaag commented Oct 8, 2023

Affects: Latest Spring Boot 3.1.4 with Jackson 2.15.2

Jackson2ObjectMapperBuilder currently does not support Jackson's DatatypeFeature. This is caused by the following function not implementing this type:

	private void configureFeature(ObjectMapper objectMapper, Object feature, boolean enabled) {
		if (feature instanceof JsonParser.Feature jsonParserFeature) {
			objectMapper.configure(jsonParserFeature, enabled);
		}
		else if (feature instanceof JsonGenerator.Feature jsonGeneratorFeature) {
			objectMapper.configure(jsonGeneratorFeature, enabled);
		}
		else if (feature instanceof SerializationFeature serializationFeature) {
			objectMapper.configure(serializationFeature, enabled);
		}
		else if (feature instanceof DeserializationFeature deserializationFeature) {
			objectMapper.configure(deserializationFeature, enabled);
		}
		else if (feature instanceof MapperFeature mapperFeature) {
			objectMapper.configure(mapperFeature, enabled);
		}
		else {
			throw new IllegalArgumentException("Unknown feature class: " + feature.getClass().getName());
		}
	}

Adding another branch for DatatypeFeature would solve the issue.

@bramhaag bramhaag changed the title Jackson2ObjectMapperBuilderCustomizer does not support DatatypeFeature Jackson2ObjectMapperBuilder does not support DatatypeFeature Oct 8, 2023
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Oct 8, 2023
@sdeleuze sdeleuze self-assigned this Oct 9, 2023
@sdeleuze sdeleuze added this to the 6.0.13 milestone Oct 9, 2023
@sdeleuze sdeleuze added in: web Issues in web modules (web, webmvc, webflux, websocket) and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Oct 9, 2023
@sdeleuze sdeleuze removed this from the 6.0.13 milestone Oct 9, 2023
@sdeleuze
Copy link
Contributor

sdeleuze commented Oct 9, 2023

Superseded by #31380.

@sdeleuze sdeleuze closed this as not planned Won't fix, can't repro, duplicate, stale Oct 9, 2023
@sdeleuze sdeleuze added type: enhancement A general enhancement status: superseded An issue that has been superseded by another labels Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: superseded An issue that has been superseded by another type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants