org.openapitools.configuration.EnumConverterConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of openapi-analytics Show documentation
Show all versions of openapi-analytics Show documentation
Generates jar artifact containing compiled openapi classes based on generated openapi yaml files
The newest version!
package org.openapitools.configuration;
import dev.crashteam.openapi.analytics.model.Marketplace;
import dev.crashteam.openapi.analytics.model.QueryPeriod;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.convert.converter.Converter;
@Configuration
public class EnumConverterConfiguration {
@Bean(name = "org.openapitools.configuration.EnumConverterConfiguration.marketplaceConverter")
Converter marketplaceConverter() {
return new Converter() {
@Override
public Marketplace convert(String source) {
return Marketplace.fromValue(source);
}
};
}
@Bean(name = "org.openapitools.configuration.EnumConverterConfiguration.queryPeriodConverter")
Converter queryPeriodConverter() {
return new Converter() {
@Override
public QueryPeriod convert(String source) {
return QueryPeriod.fromValue(source);
}
};
}
}