Skip to content

Commit

Permalink
fix: rename endpointObjectMapper to hillaEndpointObjectMapper
Browse files Browse the repository at this point in the history
Having Hilla related beans prefixed with hilla
prevents clash with other framework or user
beans.

Fixes #2955
  • Loading branch information
taefi committed Dec 5, 2024
1 parent b0da2f7 commit 2ebd3ca
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2023 Vaadin Ltd.
* Copyright 2000-2024 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
Expand Down Expand Up @@ -76,7 +76,7 @@ AccessAnnotationChecker accessAnnotationChecker() {
* Registers a default {@link EndpointAccessChecker} bean instance.
*
* @param accessAnnotationChecker
* the access controlks checker to use
* the access controls checker to use
* @return the default Vaadin endpoint access checker bean
*/
@Bean
Expand Down Expand Up @@ -112,7 +112,8 @@ CsrfChecker csrfChecker(ServletContext servletContext) {
* qualifier to override the mapper.
*/
@Bean
ObjectMapper endpointObjectMapper(ApplicationContext applicationContext,
ObjectMapper hillaEndpointObjectMapper(
ApplicationContext applicationContext,
@Autowired(required = false) @Qualifier(EndpointController.ENDPOINT_MAPPER_FACTORY_BEAN_QUALIFIER) JacksonObjectMapperFactory endpointMapperFactory) {
if (this.endpointMapper == null) {
this.endpointMapper = endpointMapperFactory != null
Expand All @@ -139,7 +140,7 @@ private static ObjectMapper createDefaultEndpointMapper(
*
* @param applicationContext
* The Spring application context
* @param endpointObjectMapper
* @param hillaEndpointObjectMapper
* ObjectMapper instance that is used for Hilla endpoints'
* serializing and deserializing request and response bodies.
* @param explicitNullableTypeChecker
Expand All @@ -154,11 +155,12 @@ private static ObjectMapper createDefaultEndpointMapper(
*/
@Bean
EndpointInvoker endpointInvoker(ApplicationContext applicationContext,
ObjectMapper endpointObjectMapper,
ObjectMapper hillaEndpointObjectMapper,
ExplicitNullableTypeChecker explicitNullableTypeChecker,
ServletContext servletContext, EndpointRegistry endpointRegistry) {
return new EndpointInvoker(applicationContext, endpointObjectMapper,
explicitNullableTypeChecker, servletContext, endpointRegistry);
return new EndpointInvoker(applicationContext,
hillaEndpointObjectMapper, explicitNullableTypeChecker,
servletContext, endpointRegistry);
}

/**
Expand Down Expand Up @@ -275,9 +277,9 @@ private RequestMappingInfo prependEndpointPrefixUrl(
}

/**
* Can re-generate the TypeScipt code.
* Can re-generate the TypeScript code.
*
* @param context
* @param servletContext
* the servlet context
* @param endpointController
* the endpoint controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ public class SignalsConfiguration {
private final EndpointInvoker endpointInvoker;

public SignalsConfiguration(EndpointInvoker endpointInvoker,
ObjectMapper endpointObjectMapper) {
ObjectMapper hillaEndpointObjectMapper) {
this.endpointInvoker = endpointInvoker;
Signal.setMapper(endpointObjectMapper);
Signal.setMapper(hillaEndpointObjectMapper);
}

/**
Expand Down

0 comments on commit 2ebd3ca

Please sign in to comment.