Skip to content
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

(fix) Fixed a bug loading the Kotlinx Module without use-fqn variable #733

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ plugins {
}

dependencies {
api project(":springwolf-core")

implementation "org.springframework:spring-context"
implementation "org.springframework:spring-beans"
implementation "org.springframework.boot:spring-boot-autoconfigure"

implementation "io.swagger.core.v3:swagger-core-jakarta:${swaggerVersion}"
implementation "io.swagger.core.v3:swagger-models-jakarta:${swaggerVersion}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@
package io.github.springwolf.addons.kotlinx_serialization_model_converter.configuration;

import io.github.springwolf.addons.kotlinx_serialization_model_converter.converter.KotlinxSerializationModelConverter;
import org.springframework.beans.factory.annotation.Value;
import io.github.springwolf.core.configuration.properties.SpringwolfConfigConstants;
import io.github.springwolf.core.configuration.properties.SpringwolfConfigProperties;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
* Spring AutoConfiguration adding an {@link KotlinxSerializationModelConverter} Bean to the spring context.
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnProperty(name = SpringwolfConfigConstants.SPRINGWOLF_ENABLED, havingValue = "true", matchIfMissing = true)
public class KotlinxSerializationModelConverterAutoConfiguration {

@Bean
public KotlinxSerializationModelConverter kotlinxSerializationTypeConverter(
@Value("${springwolf.use-fqn}") boolean useFqn) {
return new KotlinxSerializationModelConverter(useFqn);
public KotlinxSerializationModelConverter kotlinxSerializationTypeConverter(SpringwolfConfigProperties properties) {
return new KotlinxSerializationModelConverter(properties.isUseFqn());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public class SpringwolfConfigConstants {

public static final String SPRINGWOLF_ENABLED = SPRINGWOLF_CONFIG_PREFIX + ENABLED;

public static final String SPRINGWOLF_USE_FQN = SPRINGWOLF_CONFIG_PREFIX + ".use-fqn";

public static final String ENDPOINT_ACTUATOR = ".endpoint.actuator";

public static final String SPRINGWOLF_ENDPOINT_ACTUATOR_ENABLED =
Expand Down