Skip to content

Listener endpoints use schema resolver #280

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

Merged

Conversation

onobc
Copy link
Collaborator

@onobc onobc commented Jan 20, 2023

Removes the schema mapping code out of the method listener endpoints and into the SchemaResolver.

See #269

@SuppressWarnings({ "unchecked" })
@Override
@SuppressWarnings("unchecked")
public <T> Schema<T> getSchema(SchemaType schemaType, @Nullable ResolvableType messageType) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sobychacko you can use this API in the binder and pass in null for messsageType which will give mappings for all of the primitives.

	public Schema<?> toSchema(SchemaType schemaType) {
		SchemaResolver schemaResolver = new DefaultSchemaResolver();
		return schemaResolver.getSchema(schemaType, null);
	}

Then just need to make it possible for users to wire in custom mappings.

@sobychacko sobychacko merged commit e52ef5d into spring-projects:main Jan 20, 2023
@onobc onobc deleted the cbono-schemaresolver-method-endpoints branch March 5, 2023 17:30
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

Successfully merging this pull request may close these issues.

2 participants