Skip to content

Make use of custom types configurable in YamlProcessor #25152

Closed
@sbrannen

Description

@sbrannen

Overview

Since SnakeYaml allows for custom types to be loaded when they are specified inside the YAML document, we should make it possible to configure the types that can be constructed.

Proposal

Provide a mechanism in YamlProcessor for configuring the supported custom types for the Yaml instance created in org.springframework.beans.factory.config.YamlProcessor.createYaml().

For example, a new void setSupportedCustomTypes(Class<?>... types) method could be added to YamlProcessor. If no supported types are configured, the Yaml instance would be created as it is currently, without any restrictions. If supported types have been configured, the Yaml instance would be created with restrictions in place. The TypeLimitedConstructor recently introduced in Spring Boot can serve as inspiration for the latter.

Related Issues

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchestype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions