proj_name stringclasses 131
values | relative_path stringlengths 30 228 | class_name stringlengths 1 68 | func_name stringlengths 1 48 | masked_class stringlengths 78 9.82k | func_body stringlengths 46 9.61k | len_input int64 29 2.01k | len_output int64 14 1.94k | total int64 55 2.05k | relevant_context stringlengths 0 38.4k |
|---|---|---|---|---|---|---|---|---|---|
spring-projects_spring-retry | spring-retry/src/main/java/org/springframework/classify/SubclassClassifier.java | SubclassClassifier | classify | class SubclassClassifier<T, C> implements Classifier<T, C> {
private ConcurrentMap<Class<? extends T>, C> classified;
private C defaultValue;
/**
* Create a {@link SubclassClassifier} with null default value.
*/
public SubclassClassifier() {
this(null);
}
/**
* Create a {@link SubclassClassifier} with... |
if (classifiable == null) {
return this.defaultValue;
}
@SuppressWarnings("unchecked")
Class<? extends T> exceptionClass = (Class<? extends T>) classifiable.getClass();
if (this.classified.containsKey(exceptionClass)) {
return this.classified.get(exceptionClass);
}
// check for subclasses
C val... | 692 | 361 | 1,053 | <no_super_class> |
spring-projects_spring-retry | spring-retry/src/main/java/org/springframework/classify/util/AnnotationMethodResolver.java | AnnotationMethodResolver | findMethod | class AnnotationMethodResolver implements MethodResolver {
private final Class<? extends Annotation> annotationType;
/**
* Create a MethodResolver for the specified Method-level annotation type
* @param annotationType the type of the annotation
*/
public AnnotationMethodResolver(Class<? extends Annotation> a... |
Assert.notNull(candidate, "candidate object must not be null");
Class<?> targetClass = AopUtils.getTargetClass(candidate);
if (targetClass == null) {
targetClass = candidate.getClass();
}
return this.findMethod(targetClass);
| 577 | 79 | 656 | <no_super_class> |
spring-projects_spring-retry | spring-retry/src/main/java/org/springframework/classify/util/MethodInvokerUtils.java | MethodInvokerUtils | getMethodInvokerForSingleArgument | class MethodInvokerUtils {
/**
* Create a {@link MethodInvoker} using the provided method name to search.
* @param object to be invoked
* @param methodName of the method to be invoked
* @param paramsRequired boolean indicating whether the parameters are required, if
* false, a no args version of the method ... |
final AtomicReference<Method> methodHolder = new AtomicReference<>();
ReflectionUtils.doWithMethods(target.getClass(), method -> {
if ((method.getModifiers() & Modifier.PUBLIC) == 0 || method.isBridge()) {
return;
}
if (method.getParameterTypes() == null || method.getParameterTypes().length != 1) {
... | 1,801 | 213 | 2,014 | <no_super_class> |
spring-projects_spring-retry | spring-retry/src/main/java/org/springframework/classify/util/SimpleMethodInvoker.java | SimpleMethodInvoker | invokeMethod | class SimpleMethodInvoker implements MethodInvoker {
private final Object object;
private final Method method;
private final Class<?>[] parameterTypes;
private volatile Object target;
public SimpleMethodInvoker(Object object, Method method) {
Assert.notNull(object, "Object to invoke must not be null");
As... |
Assert.state(this.parameterTypes.length == args.length,
"Wrong number of arguments, expected no more than: [" + this.parameterTypes.length + "]");
try {
// Extract the target from an Advised as late as possible
// in case it contains a lazy initialization
Object target = extractTarget(this.object, th... | 775 | 174 | 949 | <no_super_class> |
spring-projects_spring-retry | spring-retry/src/main/java/org/springframework/retry/annotation/RetryConfiguration.java | RetryConfiguration | afterPropertiesSet | class RetryConfiguration extends AbstractPointcutAdvisor
implements IntroductionAdvisor, BeanFactoryAware, InitializingBean, SmartInitializingSingleton, ImportAware {
@Nullable
protected AnnotationAttributes enableRetry;
private AnnotationAwareRetryOperationsInterceptor advice;
private Pointcut pointcut;
pri... |
this.retryContextCache = findBean(RetryContextCache.class);
this.methodArgumentsKeyGenerator = findBean(MethodArgumentsKeyGenerator.class);
this.newMethodArgumentsIdentifier = findBean(NewMethodArgumentsIdentifier.class);
this.sleeper = findBean(Sleeper.class);
Set<Class<? extends Annotation>> retryableAnnot... | 1,703 | 196 | 1,899 | <methods>public void <init>() ,public boolean equals(java.lang.Object) ,public int getOrder() ,public int hashCode() ,public void setOrder(int) <variables>private java.lang.Integer order |
spring-projects_spring-retry | spring-retry/src/main/java/org/springframework/retry/backoff/BackOffPolicyBuilder.java | BackOffPolicyBuilder | build | class BackOffPolicyBuilder {
private static final long DEFAULT_INITIAL_DELAY = 1000L;
private Long delay = DEFAULT_INITIAL_DELAY;
private Long maxDelay;
private Double multiplier;
private Boolean random;
private Sleeper sleeper;
private Supplier<Long> delaySupplier;
private Supplier<Long> maxDelaySuppli... |
if (this.multiplier != null && this.multiplier > 0 || this.multiplierSupplier != null) {
ExponentialBackOffPolicy policy;
if (Boolean.TRUE.equals(this.random)) {
policy = new ExponentialRandomBackOffPolicy();
}
else {
policy = new ExponentialBackOffPolicy();
}
if (this.delay != null) {
... | 1,129 | 705 | 1,834 | <no_super_class> |
spring-projects_spring-retry | spring-retry/src/main/java/org/springframework/retry/backoff/ExponentialBackOffPolicy.java | ExponentialBackOffContext | getInterval | class ExponentialBackOffContext implements BackOffContext {
private final double multiplier;
private long interval;
private final long maxInterval;
private Supplier<Long> initialIntervalSupplier;
private Supplier<Double> multiplierSupplier;
private Supplier<Long> maxIntervalSupplier;
public Exponen... |
if (this.initialIntervalSupplier != null) {
this.interval = this.initialIntervalSupplier.get();
this.initialIntervalSupplier = null;
}
return this.interval;
| 429 | 54 | 483 | <no_super_class> |
spring-projects_spring-retry | spring-retry/src/main/java/org/springframework/retry/backoff/ExponentialRandomBackOffPolicy.java | ExponentialRandomBackOffContext | getSleepAndIncrement | class ExponentialRandomBackOffContext extends ExponentialBackOffPolicy.ExponentialBackOffContext {
private final Random r = new Random();
public ExponentialRandomBackOffContext(long expSeed, double multiplier, long maxInterval,
Supplier<Long> expSeedSupplier, Supplier<Double> multiplierSupplier,
Supplier<... |
long next = super.getSleepAndIncrement();
next = (long) (next * (1 + r.nextFloat() * (getMultiplier() - 1)));
if (next > super.getMaxInterval()) {
next = super.getMaxInterval();
}
return next;
| 164 | 81 | 245 | <methods>public non-sealed void <init>() ,public void backOff(org.springframework.retry.backoff.BackOffContext) throws org.springframework.retry.backoff.BackOffInterruptedException,public long getInitialInterval() ,public long getMaxInterval() ,public double getMultiplier() ,public void initialIntervalSupplier(Supplier... |
spring-projects_spring-retry | spring-retry/src/main/java/org/springframework/retry/backoff/FixedBackOffPolicy.java | FixedBackOffPolicy | doBackOff | class FixedBackOffPolicy extends StatelessBackOffPolicy implements SleepingBackOffPolicy<FixedBackOffPolicy> {
/**
* Default back off period - 1000ms.
*/
private static final long DEFAULT_BACK_OFF_PERIOD = 1000L;
/**
* The back off period in milliseconds. Defaults to 1000ms.
*/
private Supplier<Long> back... |
try {
sleeper.sleep(this.backOffPeriod.get());
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new BackOffInterruptedException("Thread interrupted while sleeping", e);
}
| 649 | 70 | 719 | <methods>public non-sealed void <init>() ,public final void backOff(org.springframework.retry.backoff.BackOffContext) throws org.springframework.retry.backoff.BackOffInterruptedException,public org.springframework.retry.backoff.BackOffContext start(org.springframework.retry.RetryContext) <variables> |
spring-projects_spring-retry | spring-retry/src/main/java/org/springframework/retry/backoff/ObjectWaitSleeper.java | ObjectWaitSleeper | sleep | class ObjectWaitSleeper implements Sleeper {
/*
* (non-Javadoc)
*
* @see org.springframework.batch.retry.backoff.Sleeper#sleep(long)
*/
public void sleep(long backOffPeriod) throws InterruptedException {<FILL_FUNCTION_BODY>}
} |
Object mutex = new Object();
synchronized (mutex) {
mutex.wait(backOffPeriod);
}
| 86 | 38 | 124 | <no_super_class> |
spring-projects_spring-retry | spring-retry/src/main/java/org/springframework/retry/interceptor/RetryInterceptorBuilder.java | CircuitBreakerInterceptorBuilder | build | class CircuitBreakerInterceptorBuilder
extends RetryInterceptorBuilder<StatefulRetryOperationsInterceptor> {
private final StatefulRetryOperationsInterceptor interceptor = new StatefulRetryOperationsInterceptor();
private MethodArgumentsKeyGenerator keyGenerator;
@Override
public CircuitBreakerInterceptor... |
if (this.recoverer != null) {
this.interceptor.setRecoverer(this.recoverer);
}
if (this.retryOperations != null) {
this.interceptor.setRetryOperations(this.retryOperations);
}
else {
this.interceptor.setRetryOperations(this.retryTemplate);
}
if (this.keyGenerator != null) {
this.in... | 364 | 201 | 565 | <no_super_class> |
spring-projects_spring-retry | spring-retry/src/main/java/org/springframework/retry/interceptor/RetryOperationsInterceptor.java | RetryOperationsInterceptor | doWithRetry | class RetryOperationsInterceptor implements MethodInterceptor {
private RetryOperations retryOperations = new RetryTemplate();
@Nullable
private MethodInvocationRecoverer<?> recoverer;
private String label;
public void setLabel(String label) {
this.label = label;
}
public void setRetryOperations(RetryOper... |
context.setAttribute(RetryContext.NAME, this.label);
context.setAttribute("ARGS", new Args(invocation.getArguments()));
/*
* If we don't copy the invocation carefully it won't keep a reference to
* the other interceptors in the chain. We don't have a choice here but to
* specialise to Refl... | 480 | 293 | 773 | <no_super_class> |
spring-projects_spring-retry | spring-retry/src/main/java/org/springframework/retry/interceptor/StatefulRetryOperationsInterceptor.java | StatefulRetryOperationsInterceptor | createKey | class StatefulRetryOperationsInterceptor implements MethodInterceptor {
private transient final Log logger = LogFactory.getLog(getClass());
private MethodArgumentsKeyGenerator keyGenerator;
private MethodInvocationRecoverer<?> recoverer;
private NewMethodArgumentsIdentifier newMethodArgumentsIdentifier;
priva... |
Object generatedKey = defaultKey;
if (this.keyGenerator != null) {
generatedKey = this.keyGenerator.getKey(invocation.getArguments());
}
if (generatedKey == null) {
// If there's a generator and he still says the key is null, that means he
// really doesn't want to retry.
return null;
}
if (thi... | 1,666 | 160 | 1,826 | <no_super_class> |
spring-projects_spring-retry | spring-retry/src/main/java/org/springframework/retry/listener/MethodInvocationRetryListenerSupport.java | MethodInvocationRetryListenerSupport | close | class MethodInvocationRetryListenerSupport implements RetryListener {
@Override
public <T, E extends Throwable> void close(RetryContext context, RetryCallback<T, E> callback,
Throwable throwable) {<FILL_FUNCTION_BODY>}
@Override
public <T, E extends Throwable> void onSuccess(RetryContext context, RetryCallback... |
if (callback instanceof MethodInvocationRetryCallback) {
MethodInvocationRetryCallback<T, E> methodInvocationRetryCallback = (MethodInvocationRetryCallback<T, E>) callback;
doClose(context, methodInvocationRetryCallback, throwable);
}
| 1,105 | 74 | 1,179 | <no_super_class> |
spring-projects_spring-retry | spring-retry/src/main/java/org/springframework/retry/policy/BinaryExceptionClassifierRetryPolicy.java | BinaryExceptionClassifierRetryPolicy | canRetry | class BinaryExceptionClassifierRetryPolicy implements RetryPolicy {
private final BinaryExceptionClassifier exceptionClassifier;
public BinaryExceptionClassifierRetryPolicy(BinaryExceptionClassifier exceptionClassifier) {
this.exceptionClassifier = exceptionClassifier;
}
public BinaryExceptionClassifier getExc... |
Throwable t = context.getLastThrowable();
return t == null || exceptionClassifier.classify(t);
| 221 | 33 | 254 | <no_super_class> |
spring-projects_spring-retry | spring-retry/src/main/java/org/springframework/retry/policy/CircuitBreakerRetryPolicy.java | CircuitBreakerRetryContext | isOpen | class CircuitBreakerRetryContext extends RetryContextSupport {
private volatile RetryContext context;
private final RetryPolicy policy;
private volatile long start = System.currentTimeMillis();
private final long timeout;
private final long openWindow;
private final AtomicInteger shortCircuitCount = n... |
long time = System.currentTimeMillis() - this.start;
boolean retryable = this.policy.canRetry(this.context);
if (!retryable) {
if (time > this.timeout) {
logger.trace("Closing");
this.context = createDelegateContext(policy, getParent());
this.start = System.currentTimeMillis();
retryab... | 402 | 345 | 747 | <no_super_class> |
spring-projects_spring-retry | spring-retry/src/main/java/org/springframework/retry/policy/CompositeRetryPolicy.java | CompositeRetryPolicy | open | class CompositeRetryPolicy implements RetryPolicy {
RetryPolicy[] policies = new RetryPolicy[0];
private boolean optimistic = false;
/**
* Setter for optimistic.
* @param optimistic should this retry policy be optimistic
*/
public void setOptimistic(boolean optimistic) {
this.optimistic = optimistic;
}
... |
List<RetryContext> list = new ArrayList<>();
for (RetryPolicy policy : this.policies) {
list.add(policy.open(parent));
}
return new CompositeRetryContext(parent, list, this.policies);
| 1,311 | 70 | 1,381 | <no_super_class> |
spring-projects_spring-retry | spring-retry/src/main/java/org/springframework/retry/policy/ExceptionClassifierRetryPolicy.java | ExceptionClassifierRetryContext | getContext | class ExceptionClassifierRetryContext extends RetryContextSupport implements RetryPolicy {
final private Classifier<Throwable, RetryPolicy> exceptionClassifier;
// Dynamic: depends on the latest exception:
private RetryPolicy policy;
// Dynamic: depends on the policy:
private RetryContext context;
final... |
RetryContext context = contexts.get(policy);
if (context == null) {
context = policy.open(parent);
contexts.put(policy, context);
}
return context;
| 417 | 57 | 474 | <no_super_class> |
spring-projects_spring-retry | spring-retry/src/main/java/org/springframework/retry/policy/ExpressionRetryPolicy.java | ExpressionRetryPolicy | getExpression | class ExpressionRetryPolicy extends SimpleRetryPolicy implements BeanFactoryAware {
private static final Log logger = LogFactory.getLog(ExpressionRetryPolicy.class);
private static final TemplateParserContext PARSER_CONTEXT = new TemplateParserContext();
private final Expression expression;
private final Standa... |
if (isTemplate(expression)) {
logger.warn("#{...} syntax is not required for this run-time expression "
+ "and is deprecated in favor of a simple expression string");
return new SpelExpressionParser().parseExpression(expression, PARSER_CONTEXT);
}
return new SpelExpressionParser().parseExpression(expr... | 915 | 87 | 1,002 | <methods>public void <init>() ,public void <init>(int) ,public void <init>(int, Map<Class<? extends java.lang.Throwable>,java.lang.Boolean>) ,public void <init>(int, Map<Class<? extends java.lang.Throwable>,java.lang.Boolean>, boolean) ,public void <init>(int, Map<Class<? extends java.lang.Throwable>,java.lang.Boolean>... |
spring-projects_spring-retry | spring-retry/src/main/java/org/springframework/retry/policy/MapRetryContextCache.java | MapRetryContextCache | put | class MapRetryContextCache implements RetryContextCache {
/**
* Default value for maximum capacity of the cache. This is set to a reasonably low
* value (4096) to avoid users inadvertently filling the cache with item keys that are
* inconsistent.
*/
public static final int DEFAULT_CAPACITY = 4096;
private ... |
if (map.size() >= capacity) {
throw new RetryCacheCapacityExceededException("Retry cache capacity limit breached. "
+ "Do you need to re-consider the implementation of the key generator, "
+ "or the equals and hashCode of the items that failed?");
}
map.put(key, context);
| 417 | 89 | 506 | <no_super_class> |
spring-projects_spring-retry | spring-retry/src/main/java/org/springframework/retry/policy/SoftReferenceMapRetryContextCache.java | SoftReferenceMapRetryContextCache | containsKey | class SoftReferenceMapRetryContextCache implements RetryContextCache {
/**
* Default value for maximum capacity of the cache. This is set to a reasonably low
* value (4096) to avoid users inadvertently filling the cache with item keys that are
* inconsistent.
*/
public static final int DEFAULT_CAPACITY = 409... |
if (!map.containsKey(key)) {
return false;
}
if (map.get(key).get() == null) {
// our reference was garbage collected
map.remove(key);
}
return map.containsKey(key);
| 511 | 69 | 580 | <no_super_class> |
spring-projects_spring-retry | spring-retry/src/main/java/org/springframework/retry/policy/TimeoutRetryPolicy.java | TimeoutRetryPolicy | registerThrowable | class TimeoutRetryPolicy implements RetryPolicy {
/**
* Default value for timeout (milliseconds).
*/
public static final long DEFAULT_TIMEOUT = 1000;
private long timeout;
/**
* Create a new instance with the timeout set to {@link #DEFAULT_TIMEOUT}.
*/
public TimeoutRetryPolicy() {
this(DEFAULT_TIMEOU... |
((RetryContextSupport) context).registerThrowable(throwable);
// otherwise no-op - we only time out, otherwise retry everything...
| 552 | 39 | 591 | <no_super_class> |
spring-projects_spring-retry | spring-retry/src/main/java/org/springframework/retry/stats/DefaultRetryStatistics.java | DefaultRetryStatistics | toString | class DefaultRetryStatistics extends AttributeAccessorSupport
implements RetryStatistics, MutableRetryStatistics {
private String name;
private final AtomicInteger startedCount = new AtomicInteger();
private final AtomicInteger completeCount = new AtomicInteger();
private final AtomicInteger recoveryCount = n... |
return "DefaultRetryStatistics [name=" + name + ", startedCount=" + startedCount + ", completeCount="
+ completeCount + ", recoveryCount=" + recoveryCount + ", errorCount=" + errorCount + ", abortCount="
+ abortCount + "]";
| 462 | 73 | 535 | <methods>public void <init>() ,public java.lang.String[] attributeNames() ,public T computeAttribute(java.lang.String, Function<java.lang.String,T>) ,public boolean equals(java.lang.Object) ,public java.lang.Object getAttribute(java.lang.String) ,public boolean hasAttribute(java.lang.String) ,public int hashCode() ,pub... |
spring-projects_spring-retry | spring-retry/src/main/java/org/springframework/retry/stats/DefaultStatisticsRepository.java | DefaultStatisticsRepository | getStatistics | class DefaultStatisticsRepository implements StatisticsRepository {
private final ConcurrentMap<String, MutableRetryStatistics> map = new ConcurrentHashMap<>();
private RetryStatisticsFactory factory = new DefaultRetryStatisticsFactory();
public void setRetryStatisticsFactory(RetryStatisticsFactory factory) {
t... |
MutableRetryStatistics stats;
if (!map.containsKey(name)) {
map.putIfAbsent(name, factory.create(name));
}
stats = map.get(name);
return stats;
| 331 | 63 | 394 | <no_super_class> |
spring-projects_spring-retry | spring-retry/src/main/java/org/springframework/retry/stats/ExponentialAverageRetryStatistics.java | ExponentialAverageRetryStatistics | getRollingErrorRate | class ExponentialAverageRetryStatistics extends DefaultRetryStatistics {
private long window = 15000;
private ExponentialAverage started;
private ExponentialAverage error;
private ExponentialAverage complete;
private ExponentialAverage recovery;
private ExponentialAverage abort;
public ExponentialAverageR... |
if (Math.round(started.getValue()) == 0) {
return 0.;
}
return (abort.getValue() + recovery.getValue()) / started.getValue();
| 751 | 48 | 799 | <methods>public void <init>(java.lang.String) ,public int getAbortCount() ,public int getCompleteCount() ,public int getErrorCount() ,public java.lang.String getName() ,public int getRecoveryCount() ,public int getStartedCount() ,public void incrementAbortCount() ,public void incrementCompleteCount() ,public void incre... |
spring-projects_spring-retry | spring-retry/src/main/java/org/springframework/retry/stats/StatisticsListener.java | StatisticsListener | onError | class StatisticsListener implements RetryListener {
private final StatisticsRepository repository;
public StatisticsListener(StatisticsRepository repository) {
this.repository = repository;
}
@Override
public <T, E extends Throwable> void close(RetryContext context, RetryCallback<T, E> callback,
Throwable ... |
String name = getName(context);
if (name != null) {
if (!hasState(context)) {
// Stateless retry involves starting the retry callback once per error
// without closing the context, so we need to increment the started count
repository.addStarted(name);
}
repository.addError(name);
}
| 639 | 92 | 731 | <no_super_class> |
spring-projects_spring-retry | spring-retry/src/main/java/org/springframework/retry/support/DefaultRetryState.java | DefaultRetryState | rollbackFor | class DefaultRetryState implements RetryState {
final private Object key;
final private boolean forceRefresh;
final private Classifier<? super Throwable, Boolean> rollbackClassifier;
/**
* Create a {@link DefaultRetryState} representing the state for a new retry attempt.
*
* @see RetryOperations#execute(R... |
if (rollbackClassifier == null) {
return true;
}
return rollbackClassifier.classify(exception);
| 804 | 36 | 840 | <no_super_class> |
spring-projects_spring-retry | spring-retry/src/main/java/org/springframework/retry/support/RetrySimulation.java | RetrySimulation | getPercentile | class RetrySimulation {
private final List<SleepSequence> sleepSequences = new ArrayList<>();
private final List<Long> sleepHistogram = new ArrayList<>();
public RetrySimulation() {
}
/**
* Add a sequence of sleeps to the simulation.
* @param sleeps the times to be created as a {@link SleepSequence}
*/
... |
Collections.sort(sleepHistogram);
int size = sleepHistogram.size();
double pos = p * (size - 1);
int i0 = (int) pos;
int i1 = i0 + 1;
double weight = pos - i0;
return sleepHistogram.get(i0) * (1 - weight) + sleepHistogram.get(i1) * weight;
| 661 | 104 | 765 | <no_super_class> |
spring-projects_spring-retry | spring-retry/src/main/java/org/springframework/retry/support/RetrySimulator.java | RetrySimulator | executeSimulation | class RetrySimulator {
private final SleepingBackOffPolicy<?> backOffPolicy;
private final RetryPolicy retryPolicy;
public RetrySimulator(SleepingBackOffPolicy<?> backOffPolicy, RetryPolicy retryPolicy) {
this.backOffPolicy = backOffPolicy;
this.retryPolicy = retryPolicy;
}
/**
* Execute the simulator fo... |
RetrySimulation simulation = new RetrySimulation();
for (int i = 0; i < numSimulations; i++) {
simulation.addSequence(executeSingleSimulation());
}
return simulation;
| 566 | 60 | 626 | <no_super_class> |
spring-projects_spring-retry | spring-retry/src/main/java/org/springframework/retry/support/RetrySynchronizationManager.java | RetrySynchronizationManager | clear | class RetrySynchronizationManager {
private RetrySynchronizationManager() {
}
private static final ThreadLocal<RetryContext> context = new ThreadLocal<>();
private static final Map<Thread, RetryContext> contexts = new ConcurrentHashMap<>();
private static boolean useThreadLocal = true;
/**
* Set to false t... |
RetryContext value = getContext();
RetryContext parent = value == null ? null : value.getParent();
if (useThreadLocal) {
RetrySynchronizationManager.context.set(parent);
}
else {
if (parent != null) {
contexts.put(Thread.currentThread(), parent);
}
else {
contexts.remove(Thread.currentThr... | 600 | 121 | 721 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/SpecPropertiesCondition.java | SpecPropertiesCondition | matches | class SpecPropertiesCondition implements Condition {
@Override
public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {<FILL_FUNCTION_BODY>}
} |
final BindResult<SpringDocConfigProperties> result = Binder.get(context.getEnvironment())
.bind(SPRINGDOC_PREFIX, SpringDocConfigProperties.class);
if (result.isBound()) {
SpringDocConfigProperties springDocConfigProperties = result.get();
if (springDocConfigProperties.getOpenApi() != null)
return tr... | 46 | 154 | 200 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java | QuerydslProvider | queryDslQuerydslPredicateOperationCustomizer | class QuerydslProvider {
/**
* Query dsl querydsl predicate operation customizer querydsl predicate operation customizer.
*
* @param querydslBindingsFactory the querydsl bindings factory
* @param springDocConfigProperties the spring doc config properties
* @return the querydsl predicate operation cu... |
if (querydslBindingsFactory.isPresent()) {
getConfig().addRequestWrapperToIgnore(Predicate.class);
return new QuerydslPredicateOperationCustomizer(querydslBindingsFactory.get(), springDocConfigProperties);
}
return null;
| 171 | 70 | 241 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocDataRestConfiguration.java | SpringRepositoryRestResourceProviderConfiguration | springRepositoryRestResourceProvider | class SpringRepositoryRestResourceProviderConfiguration {
static {
getConfig().replaceParameterObjectWithClass(DefaultedPageable.class, DefaultPageable.class)
.addRequestWrapperToIgnore(RootResourceInformation.class, PersistentEntityResourceAssembler.class, ETag.class, Sort.class)
.addResponseWrapperToI... |
return new SpringRepositoryRestResourceProvider(mappings, repositories, associations, applicationContext,
dataRestRouterOperationService, persistentEntities, mapper, springDocDataRestUtils);
| 1,320 | 47 | 1,367 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocHateoasConfiguration.java | SpringDocHateoasConfiguration | linksSchemaCustomizer | class SpringDocHateoasConfiguration {
/**
* Hateoas hal provider hateoas hal provider.
*
* @param hateoasPropertiesOptional the hateoas properties optional
* @param objectMapperProvider the object mapper provider
* @return the hateoas hal provider
*/
@Bean
@ConditionalOnMissingBean
@Lazy(false)
Hateoa... |
if (!halProvider.isHalEnabled()) {
return openApi -> {
};
}
objectMapperProvider.jsonMapper().addMixIn(RepresentationModel.class, RepresentationModelLinksOASMixin.class);
return new OpenApiHateoasLinksCustomizer(springDocConfigProperties);
| 753 | 83 | 836 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocJacksonKotlinModuleConfiguration.java | SpringDocJacksonKotlinModuleConfiguration | springdocKotlinObjectMapperProvider | class SpringDocJacksonKotlinModuleConfiguration {
/**
* Instantiates a new objectMapperProvider with a kotlin module.
*
* @param springDocConfigProperties the spring doc config properties
*/
@Bean
@Primary
ObjectMapperProvider springdocKotlinObjectMapperProvider(SpringDocConfigProperties springDocConfigPr... |
ObjectMapperProvider mapperProvider = new ObjectMapperProvider(springDocConfigProperties);
mapperProvider.jsonMapper().registerModule(new KotlinModule.Builder().build());
return mapperProvider;
| 99 | 53 | 152 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocRequiredModule.java | RespectSchemaRequiredAnnotationIntrospector | hasRequiredMarker | class RespectSchemaRequiredAnnotationIntrospector extends SwaggerAnnotationIntrospector {
@Override
public Boolean hasRequiredMarker(AnnotatedMember annotatedMember) {<FILL_FUNCTION_BODY>}
} |
Schema schemaAnnotation = annotatedMember.getAnnotation(Schema.class);
if (schemaAnnotation != null) {
Schema.RequiredMode requiredMode = schemaAnnotation.requiredMode();
if (schemaAnnotation.required() || requiredMode == Schema.RequiredMode.REQUIRED) {
return true;
}
else if (requiredMode =... | 54 | 139 | 193 | <methods>public void <init>() ,public void <init>(java.lang.String) ,public void <init>(com.fasterxml.jackson.core.Version) ,public void <init>(java.lang.String, com.fasterxml.jackson.core.Version) ,public void <init>(java.lang.String, com.fasterxml.jackson.core.Version, Map<Class<?>,JsonDeserializer<?>>) ,public void ... |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityConfiguration.java | SpringSecurityLoginEndpointConfiguration | springSecurityLoginEndpointCustomiser | class SpringSecurityLoginEndpointConfiguration {
/**
* Spring security login endpoint customiser open api customiser.
*
* @param applicationContext the application context
* @return the open api customiser
*/
@Bean
@ConditionalOnProperty(SPRINGDOC_SHOW_LOGIN_ENDPOINT)
@Lazy(false)
OpenApiCusto... |
FilterChainProxy filterChainProxy = applicationContext.getBean(AbstractSecurityWebApplicationInitializer.DEFAULT_FILTER_NAME, FilterChainProxy.class);
return openAPI -> {
for (SecurityFilterChain filterChain : filterChainProxy.getFilterChains()) {
Optional<UsernamePasswordAuthenticationFilter> optionalF... | 122 | 868 | 990 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2EndpointUtils.java | SpringDocSecurityOAuth2EndpointUtils | findEndpoint | class SpringDocSecurityOAuth2EndpointUtils<T> {
/**
* The Oauth 2 endpoint filter.
*/
private T oauth2EndpointFilter;
/**
* Instantiates a new Spring doc security o auth 2 endpoint utils.
*
* @param oauth2EndpointFilter the oauth 2 endpoint filter
*/
public SpringDocSecurityOAuth2EndpointUtils(T oauth... |
Optional<?> oAuth2EndpointFilterOptional =
filterChain.getFilters().stream()
.filter(((Class <?>) oauth2EndpointFilter)::isInstance)
.map(((Class <?>) oauth2EndpointFilter)::cast)
.findAny();
return oAuth2EndpointFilterOptional.orElse(null);
| 182 | 94 | 276 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSpecPropertiesConfiguration.java | SpecificationStringPropertiesCustomizerBeanPostProcessor | postProcessAfterInitialization | class SpecificationStringPropertiesCustomizerBeanPostProcessor implements BeanPostProcessor {
private final SpringDocConfigProperties springDocConfigProperties;
public SpecificationStringPropertiesCustomizerBeanPostProcessor(
SpringDocConfigProperties springDocConfigProperties
) {
... |
if (bean instanceof GroupedOpenApi groupedOpenApi) {
Set<GroupConfig> groupConfigs = springDocConfigProperties.getGroupConfigs();
for (GroupConfig groupConfig : groupConfigs) {
if(groupConfig.getGroup().equals(groupedOpenApi.getGroup())) {
groupedOpenApi.addAllOpenApiCustomize... | 116 | 128 | 244 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocUIConfiguration.java | SpringDocUIConfiguration | afterPropertiesSet | class SpringDocUIConfiguration implements InitializingBean {
/**
* The constant SPRINGDOC_CONFIG_PROPERTIES.
*/
public static final String SPRINGDOC_CONFIG_PROPERTIES = "springdoc.config.properties";
/**
* The constant SPRINGDOC_SWAGGERUI_VERSION.
*/
private static final String SPRINGDOC_SWAGGERUI_VERSION... |
optionalSwaggerUiConfigProperties.ifPresent(swaggerUiConfigProperties -> {
if (StringUtils.isEmpty(swaggerUiConfigProperties.getVersion())) {
try {
Resource resource = new ClassPathResource(AntPathMatcher.DEFAULT_PATH_SEPARATOR + SPRINGDOC_CONFIG_PROPERTIES);
Properties props = PropertiesLoaderUtils... | 260 | 164 | 424 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocDataRestHints.java | SpringDocDataRestHints | registerHints | class SpringDocDataRestHints implements RuntimeHintsRegistrar {
//spring-data-rest
static String[] springDataRestTypeNames = { "org.springframework.data.rest.webmvc.config.DelegatingHandlerMapping",
"org.springframework.data.rest.webmvc.support.DelegatingHandlerMapping",
"org.springframework.data.rest.webmvc.R... |
//springdoc
hints.reflection().registerField(
FieldUtils.getField(TypedResourceDescription.class, "type", true));
hints.reflection().registerField(
FieldUtils.getDeclaredField(DelegatingMethodParameter.class, "additionalParameterAnnotations", true));
//spring-data-rest
Arrays.stream(springDataRestTy... | 241 | 208 | 449 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocHints.java | SpringDocHints | registerHints | class SpringDocHints implements RuntimeHintsRegistrar {
static Class[] typesToRegister = {
//swagger-models
io.swagger.v3.oas.models.security.SecurityScheme.Type.class,
io.swagger.v3.oas.models.security.SecurityScheme.In.class,
io.swagger.v3.oas.models.media.Encoding.class,
io.swagger.v3.oas.models.inf... |
hints.proxies()
.registerJdkProxy(org.springframework.web.context.request.NativeWebRequest.class);
hints.reflection()
.registerType(java.lang.Module.class,
hint -> hint.withMembers(MemberCategory.DECLARED_FIELDS,
MemberCategory.INVOKE_DECLARED_CONSTRUCTORS,
MemberCategory.INVOKE_DECLA... | 1,142 | 460 | 1,602 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocSecurityHints.java | SpringDocSecurityHints | registerHints | class SpringDocSecurityHints implements RuntimeHintsRegistrar {
//spring-security
static String[] springSecurityTypeNames = { "org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter",
"org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter",
"org.spr... |
//spring-security
Arrays.stream(springSecurityTypeNames).forEach(springDataRestTypeName ->
hints.reflection()
.registerTypeIfPresent(classLoader, springDataRestTypeName,
hint -> hint.withMembers(MemberCategory.DECLARED_FIELDS,
MemberCategory.INVOKE_DECLARED_CONSTRUCTORS,
Membe... | 133 | 126 | 259 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configurer/SpringdocActuatorBeanFactoryConfigurer.java | SpringdocActuatorBeanFactoryConfigurer | postProcessBeanFactory | class SpringdocActuatorBeanFactoryConfigurer extends SpringdocBeanFactoryConfigurer {
/**
* The Grouped open apis.
*/
private final List<GroupedOpenApi> groupedOpenApis;
/**
* Instantiates a new Springdoc actuator bean factory configurer.
*
* @param groupedOpenApis the grouped open apis
*/
p... |
final BindResult<WebEndpointProperties> result = Binder.get(environment)
.bind(MANAGEMENT_ENDPOINTS_WEB, WebEndpointProperties.class);
final BindResult<SpringDocConfigProperties> springDocConfigPropertiesBindResult = Binder.get(environment)
.bind(SPRINGDOC_PREFIX, SpringDocConfigProperties.class);
if ... | 178 | 525 | 703 | <methods>public non-sealed void <init>() ,public static void initBeanFactoryPostProcessor(org.springframework.beans.factory.config.ConfigurableListableBeanFactory) ,public void postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory) ,public void setEnvironment(org.springframewor... |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configurer/SpringdocBeanFactoryConfigurer.java | SpringdocBeanFactoryConfigurer | postProcessBeanFactory | class SpringdocBeanFactoryConfigurer implements EnvironmentAware, BeanFactoryPostProcessor {
/**
* The Environment.
*/
@Nullable
protected Environment environment;
/**
* Init bean factory post processor.
*
* @param beanFactory the bean factory
*/
public static void initBeanFactoryPostProcessor(Config... |
final BindResult<SpringDocConfigProperties> result = Binder.get(environment)
.bind(SPRINGDOC_PREFIX, SpringDocConfigProperties.class);
if (result.isBound()) {
SpringDocConfigProperties springDocGroupConfig = result.get();
List<GroupedOpenApi> groupedOpenApis = springDocGroupConfig.getGroupConfigs().strea... | 255 | 580 | 835 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/AdditionalModelsConverter.java | AdditionalModelsConverter | resolve | class AdditionalModelsConverter implements ModelConverter {
/**
* The constant modelToClassMap.
*/
private static final Map<Class, Class> modelToClassMap = new HashMap<>();
/**
* The constant modelToSchemaMap.
*/
private static final Map<Class, Schema> modelToSchemaMap = new HashMap<>();
/**
* The con... |
JavaType javaType = springDocObjectMapper.jsonMapper().constructType(type.getType());
if (javaType != null) {
Class<?> cls = javaType.getRawClass();
if (modelToSchemaMap.containsKey(cls))
try {
return springDocObjectMapper.jsonMapper()
.readValue(springDocObjectMapper.jsonMapper().writeValueA... | 774 | 228 | 1,002 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/CollectionModelContentConverter.java | CollectionModelContentConverter | resolve | class CollectionModelContentConverter implements ModelConverter {
/**
* The Link relation provider.
*/
private final LinkRelationProvider linkRelationProvider;
/**
* Instantiates a new Collection model content converter.
*
* @param linkRelationProvider the link relation provider
*/
public CollectionMo... |
if (chain.hasNext() && type != null && type.getType() instanceof CollectionType
&& "_embedded".equalsIgnoreCase(type.getPropertyName())) {
Schema<?> schema = chain.next().resolve(type, context, chain);
if (schema instanceof ArraySchema) {
Class<?> entityType = getEntityType(type);
String entityClas... | 324 | 173 | 497 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/FileSupportConverter.java | FileSupportConverter | resolve | class FileSupportConverter implements ModelConverter {
/**
* The Spring doc object mapper.
*/
private final ObjectMapperProvider springDocObjectMapper;
/**
* Instantiates a new File support converter.
*
* @param springDocObjectMapper the spring doc object mapper
*/
public FileSupportConverter(ObjectMa... |
JavaType javaType = springDocObjectMapper.jsonMapper().constructType(type.getType());
if (javaType != null) {
Class<?> cls = javaType.getRawClass();
if (isFile(cls))
return new FileSchema();
}
return (chain.hasNext()) ? chain.next().resolve(type, context, chain) : null;
| 148 | 99 | 247 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/JavaTypeToIgnoreConverter.java | JavaTypeToIgnoreConverter | resolve | class JavaTypeToIgnoreConverter implements ModelConverter {
/**
* The Spring doc object mapper.
*/
private final ObjectMapperProvider springDocObjectMapper;
/**
* Instantiates a new Request type to ignore converter.
*
* @param springDocObjectMapper the spring doc object mapper
*/
public JavaTypeToIgno... |
if (type.isSchemaProperty()) {
JavaType javaType = springDocObjectMapper.jsonMapper().constructType(type.getType());
Class<?> cls = javaType.getRawClass();
if (ConverterUtils.isJavaTypeToIgnore(cls))
return null;
}
return (chain.hasNext()) ? chain.next().resolve(type, context, chain) : null;
| 153 | 103 | 256 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ModelConverterRegistrar.java | ModelConverterRegistrar | isSameConverter | class ModelConverterRegistrar {
/**
* The constant modelConvertersInstance.
*/
private final ModelConverters modelConvertersInstance;
/**
* The constant LOGGER.
*/
private static final Logger LOGGER = LoggerFactory.getLogger(ModelConverterRegistrar.class);
/**
* Instantiates a new Model converter regi... |
// comparing by the converter type
Class<? extends ModelConverter> modelConverter1Class = modelConverter1.getClass();
Class<? extends ModelConverter> modelConverter2Class = modelConverter2.getClass();
return modelConverter1Class.equals(modelConverter2Class);
| 571 | 70 | 641 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageableOpenAPIConverter.java | PageableOpenAPIConverter | resolve | class PageableOpenAPIConverter implements ModelConverter {
/**
* The constant PAGEABLE_TO_REPLACE.
*/
private static final String PAGEABLE_TO_REPLACE = "org.springframework.data.domain.Pageable";
/**
* The constant PAGE_REQUEST_TO_REPLACE.
*/
private static final String PAGE_REQUEST_TO_REPLACE = "org.spri... |
JavaType javaType = springDocObjectMapper.jsonMapper().constructType(type.getType());
if (javaType != null) {
Class<?> cls = javaType.getRawClass();
if (PAGEABLE_TO_REPLACE.equals(cls.getCanonicalName()) || PAGE_REQUEST_TO_REPLACE.equals(cls.getCanonicalName())) {
if (!type.isSchemaProperty())
type ... | 343 | 182 | 525 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java | PolymorphicModelConverter | resolve | class PolymorphicModelConverter implements ModelConverter {
/**
* The Spring doc object mapper.
*/
private final ObjectMapperProvider springDocObjectMapper;
/**
* Instantiates a new Polymorphic model converter.
*
* @param springDocObjectMapper the spring doc object mapper
*/
public PolymorphicModelCon... |
JavaType javaType = springDocObjectMapper.jsonMapper().constructType(type.getType());
if (javaType != null) {
if (chain.hasNext()) {
Schema<?> resolvedSchema = chain.next().resolve(type, context, chain);
resolvedSchema = getResolvedSchema(javaType, resolvedSchema);
if (resolvedSchema == null || reso... | 723 | 148 | 871 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PropertyCustomizingConverter.java | PropertyCustomizingConverter | resolve | class PropertyCustomizingConverter implements ModelConverter {
/**
* The Property customizers.
*/
private final Optional<List<PropertyCustomizer>> propertyCustomizers;
/**
* Instantiates a new Property customizing converter.
*
* @param customizers the customizers
*/
public PropertyCustomizingConverter... |
if (chain.hasNext()) {
Schema<?> resolvedSchema = chain.next().resolve(type, context, chain);
if (type.isSchemaProperty() && propertyCustomizers.isPresent()) {
List<PropertyCustomizer> propertyCustomizerList = propertyCustomizers.get();
for (PropertyCustomizer propertyCustomizer : propertyCustomizerLis... | 147 | 125 | 272 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ResponseSupportConverter.java | ResponseSupportConverter | resolve | class ResponseSupportConverter implements ModelConverter {
/**
* The Spring doc object mapper.
*/
private final ObjectMapperProvider springDocObjectMapper;
/**
* Instantiates a new Response support converter.
*
* @param springDocObjectMapper the spring doc object mapper
*/
public ResponseSupportConver... |
JavaType javaType = springDocObjectMapper.jsonMapper().constructType(type.getType());
if (javaType != null) {
Class<?> cls = javaType.getRawClass();
if (isResponseTypeWrapper(cls) && !isFluxTypeWrapper(cls)) {
JavaType innerType = javaType.getBindings().getBoundType(0);
if (innerType == null)
re... | 148 | 217 | 365 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/SchemaPropertyDeprecatingConverter.java | SchemaPropertyDeprecatingConverter | isDeprecated | class SchemaPropertyDeprecatingConverter implements ModelConverter {
/**
* The constant DEPRECATED_ANNOTATIONS.
*/
private static final List<Class<? extends Annotation>> DEPRECATED_ANNOTATIONS = Collections.synchronizedList(new ArrayList<>());
static {
DEPRECATED_ANNOTATIONS.add(Deprecated.class);
}
/**
... |
Class<?> declaringClass = method.getDeclaringClass();
boolean deprecatedMethod = DEPRECATED_ANNOTATIONS.stream().anyMatch(annoClass -> AnnotatedElementUtils.findMergedAnnotation(method, annoClass) != null);
boolean deprecatedClass = DEPRECATED_ANNOTATIONS.stream().anyMatch(annoClass -> AnnotatedElementUtils.find... | 427 | 134 | 561 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/SortOpenAPIConverter.java | SortOpenAPIConverter | resolve | class SortOpenAPIConverter implements ModelConverter {
private static final String SORT_TO_REPLACE = "org.springframework.data.domain.Sort";
/**
* The constant SORT.
*/
private static final AnnotatedType SORT = new AnnotatedType(Sort.class).resolveAsRef(true);
/**
* The Spring doc object mapper.
*/
priv... |
JavaType javaType = springDocObjectMapper.jsonMapper().constructType(type.getType());
if (javaType != null) {
Class<?> cls = javaType.getRawClass();
if (SORT_TO_REPLACE.equals(cls.getCanonicalName())) {
if (!type.isSchemaProperty())
type = SORT;
else
type.name(cls.getSimpleName() + StringUt... | 265 | 159 | 424 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/WebFluxSupportConverter.java | WebFluxSupportConverter | resolve | class WebFluxSupportConverter implements ModelConverter {
/**
* The Object mapper provider.
*/
private final ObjectMapperProvider objectMapperProvider;
/**
* Instantiates a new Web flux support converter.
*
* @param objectMapperProvider the object mapper provider
*/
public WebFluxSupportConverter(Obje... |
JavaType javaType = objectMapperProvider.jsonMapper().constructType(type.getType());
if (javaType != null) {
Class<?> cls = javaType.getRawClass();
if (isFluxTypeWrapper(cls)) {
JavaType innerType = javaType.getBindings().getBoundType(0);
if (innerType == null)
return new StringSchema();
els... | 177 | 267 | 444 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/Pageable.java | Pageable | setSort | class Pageable {
/**
* The Page.
*/
@Min(0)
@Parameter(description = "Zero-based page index (0..N)", schema = @Schema(type = "integer", defaultValue = "0"))
private Integer page;
/**
* The Size.
*/
@Min(1)
@Parameter(description = "The size of the page to be returned", schema = @Schema(type = "integer"... |
if (sort == null) {
this.sort.clear();
}
else {
this.sort = sort;
}
| 777 | 38 | 815 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/Sort.java | Sort | equals | class Sort {
/**
* The Sort.
*/
@Parameter(description = "Sorting criteria in the format: property,(asc|desc). "
+ "Default sort order is ascending. " + "Multiple sort criteria are supported."
, name = "sort"
, array = @ArraySchema(schema = @Schema(type = "string")))
private List<String> sort;
/**
... |
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Sort sort = (Sort) o;
return Objects.equals(this.sort, sort.sort);
| 385 | 62 | 447 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOpenApiCustomizer.java | ActuatorOpenApiCustomizer | handleActuatorPathParam | class ActuatorOpenApiCustomizer implements GlobalOpenApiCustomizer {
/**
* The Path pathern.
*/
private final Pattern pathPathern = Pattern.compile("\\{(.*?)}");
/**
* The Web endpoint properties.
*/
private final WebEndpointProperties webEndpointProperties;
/**
* Instantiates a new Actuator open api ... |
actuatorPathEntryStream(openApi, DEFAULT_PATH_SEPARATOR).forEach(stringPathItemEntry -> {
String path = stringPathItemEntry.getKey();
Matcher matcher = pathPathern.matcher(path);
while (matcher.find()) {
String pathParam = matcher.group(1);
PathItem pathItem = stringPathItemEntry.getValue();
pat... | 549 | 235 | 784 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOperationCustomizer.java | ActuatorOperationCustomizer | customize | class ActuatorOperationCustomizer implements GlobalOperationCustomizer {
/**
* The constant OPERATION.
*/
private static final String OPERATION = "operation";
/**
* The constant PARAMETER.
*/
private static final String PARAMETER = "parameter";
/**
* The constant LOGGER.
*/
private static final Log... |
if (operation.getTags() != null && operation.getTags().contains(getTag().getName())) {
Field operationFiled = FieldUtils.getDeclaredField(handlerMethod.getBean().getClass(), OPERATION, true);
Object actuatorOperation;
if (operationFiled != null) {
try {
actuatorOperation = operationFiled.get(handle... | 283 | 543 | 826 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiHateoasLinksCustomizer.java | OpenApiHateoasLinksCustomizer | customise | class OpenApiHateoasLinksCustomizer extends SpecFilter implements GlobalOpenApiCustomizer {
/**
* The Spring doc config properties.
*/
private final SpringDocConfigProperties springDocConfigProperties;
/**
* Instantiates a new Open api hateoas links customiser.
*
* @param springDocConfigProperties the sp... |
ResolvedSchema resolvedLinkSchema = ModelConverters.getInstance(springDocConfigProperties.isOpenapi31())
.resolveAsResolvedSchema(new AnnotatedType(Link.class));
openApi
.schema("Link", resolvedLinkSchema.schema)
.schema("Links", new MapSchema()
.additionalProperties(new StringSchema())
.ad... | 159 | 152 | 311 | <methods>public void <init>() ,public io.swagger.v3.oas.models.OpenAPI filter(io.swagger.v3.oas.models.OpenAPI, io.swagger.v3.core.filter.OpenAPISpecFilter, Map<java.lang.String,List<java.lang.String>>, Map<java.lang.String,java.lang.String>, Map<java.lang.String,List<java.lang.String>>) <variables> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpecPropertiesCustomizer.java | SpecPropertiesCustomizer | customizePaths | class SpecPropertiesCustomizer implements GlobalOpenApiCustomizer {
/**
* The Open api properties.
*/
private final OpenAPI openApiProperties;
/**
* Instantiates a new Spec properties customizer.
*
* @param springDocConfigProperties the spring doc config properties
*/
public SpecPropertiesCustomizer(S... |
Paths paths = openApi.getPaths();
if (paths == null) {
openApi.paths(pathsProperties);
}
else {
paths.forEach((path, pathItem) -> {
if (path.startsWith("/")) {
path = path.substring(1); // Remove the leading '/'
}
PathItem pathItemProperties = pathsProperties.get(path);
if (pathItemP... | 1,373 | 321 | 1,694 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpringDocCustomizers.java | SpringDocCustomizers | afterPropertiesSet | class SpringDocCustomizers implements ApplicationContextAware, InitializingBean {
/**
* The Open api customisers.
*/
private final Optional<List<OpenApiCustomizer>> openApiCustomizers;
/**
* The Operation customizers.
*/
private final Optional<List<OperationCustomizer>> operationCustomizers;
/**
* Th... |
//add the default customizers
Map<String, OpenApiCustomizer> existingOpenApiCustomizers = context.getBeansOfType(OpenApiCustomizer.class);
if (!CollectionUtils.isEmpty(existingOpenApiCustomizers) && existingOpenApiCustomizers.containsKey(LINKS_SCHEMA_CUSTOMISER))
this.openApiCustomizers.ifPresent(openApiCusto... | 1,474 | 132 | 1,606 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRepository.java | DataRestRepository | getReturnType | class DataRestRepository {
/**
* The Domain type.
*/
private Class<?> domainType;
/**
* The Repository type.
*/
private Class<?> repositoryType;
/**
* The Relation name.
*/
private String relationName;
/**
* The Controller type.
*/
private ControllerType controllerType;
/**
* The Is coll... |
Class returnedEntityType = domainType;
if (ControllerType.PROPERTY.equals(controllerType))
returnedEntityType = propertyType;
else if (ControllerType.GENERAL.equals(controllerType))
returnedEntityType = null;
return returnedEntityType;
| 1,189 | 75 | 1,264 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestTagsService.java | DataRestTagsService | buildTags | class DataRestTagsService {
/**
* The Open api builder.
*/
private final OpenAPIService openAPIService;
/**
* Instantiates a new Data rest tags builder.
*
* @param openAPIService the open api builder
*/
public DataRestTagsService(OpenAPIService openAPIService) {
this.openAPIService = openAPIService;... |
String tagName = handlerMethod.getBeanType().getSimpleName();
if (SpringRepositoryRestResourceProvider.REPOSITORY_SCHEMA_CONTROLLER.equals(handlerMethod.getBeanType().getName())
|| AlpsController.class.equals(handlerMethod.getBeanType())
|| ProfileController.class.equals(handlerMethod.getBeanType())) {
... | 388 | 457 | 845 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/discoverer/SpringDocParameterNameDiscoverer.java | SpringDocParameterNameDiscoverer | getParameterNames | class SpringDocParameterNameDiscoverer extends DefaultParameterNameDiscoverer {
/**
* The Standard reflection parameter name discoverer.
*/
private final StandardReflectionParameterNameDiscoverer standardReflectionParameterNameDiscoverer = new StandardReflectionParameterNameDiscoverer();
@Override
@Nullable
... |
String[] params = super.getParameterNames(method);
if(ArrayUtils.isEmpty(params) || Objects.requireNonNull(params).length!=method.getParameters().length)
params = standardReflectionParameterNameDiscoverer.getParameterNames(method);
return params;
| 99 | 73 | 172 | <methods>public void <init>() <variables> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/DelegatingMethodParameter.java | DelegatingMethodParameter | customize | class DelegatingMethodParameter extends MethodParameter {
/**
* The constant LOGGER.
*/
private static final Logger LOGGER = LoggerFactory.getLogger(DelegatingMethodParameter.class);
/**
* The Delegate.
*/
private final MethodParameter delegate;
/**
* The Additional parameter annotations.
*/
privat... |
List<MethodParameter> explodedParameters = new ArrayList<>();
for (int i = 0; i < parameters.length; ++i) {
MethodParameter p = parameters[i];
Class<?> paramClass = AdditionalModelsConverter.getParameterObjectReplacement(p.getParameterType());
boolean hasFlatAnnotation = p.hasParameterAnnotation(Paramete... | 1,525 | 375 | 1,900 | <methods>public void <init>(org.springframework.core.MethodParameter) ,public void <init>(java.lang.reflect.Method, int) ,public void <init>(Constructor<?>, int) ,public void <init>(java.lang.reflect.Method, int, int) ,public void <init>(Constructor<?>, int, int) ,public org.springframework.core.MethodParameter clone()... |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/RouterFunctionData.java | RouterFunctionData | getRequestMethod | class RouterFunctionData {
/**
* The Path.
*/
private String path;
/**
* The Consumes.
*/
private List<String> consumes = new ArrayList<>();
/**
* The Produces.
*/
private List<String> produces = new ArrayList<>();
/**
* The Headers.
*/
private List<String> headers = new ArrayList<>();
/*... |
RequestMethod requestMethod = null;
switch (httpMethod.name()) {
case "GET" -> requestMethod = RequestMethod.GET;
case "POST" -> requestMethod = RequestMethod.POST;
case "PUT" -> requestMethod = RequestMethod.PUT;
case "DELETE" -> requestMethod = RequestMethod.DELETE;
case "PATCH" -> requestMethod =... | 1,538 | 196 | 1,734 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/apiresponse/Builder.java | Builder | build | class Builder {
/**
* The Use return type schema.
*/
boolean useReturnTypeSchema = false;
/**
* A short description of the response.
*
*/
private String description = "";
/**
* The HTTP response code, or 'default', for the supplied response. May only have 1 default entry.
*
*/
private String re... |
return new ApiResponse() {
@Override
public Class<? extends Annotation> annotationType() {
return null;
}
@Override
public String description() {
return description;
}
@Override
public String responseCode() {
return responseCode;
}
@Override
public Header[] headers() {... | 1,168 | 214 | 1,382 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/arrayschema/Builder.java | Builder | build | class Builder {
/**
* The schema of the items in the array
*/
private Schema schema = org.springdoc.core.fn.builders.schema.Builder.schemaBuilder().build();
/**
* Allows to define the properties to be resolved into properties of the schema of type `array` (not the ones of the
* `items` of such schema which ... |
return new ArraySchema() {
@Override
public Class<? extends Annotation> annotationType() {
return null;
}
@Override
public Schema items() {
return null;
}
@Override
public Schema schema() {
return schema;
}
@Override
public Schema arraySchema() {
return arraySchema... | 963 | 308 | 1,271 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/content/Builder.java | Builder | build | class Builder {
/**
* The schema properties defined for schema provided in @Schema
*/
private final Schema additionalPropertiesSchema = org.springdoc.core.fn.builders.schema.Builder.schemaBuilder().build();
/**
* The Additional properties array schema.
*/
private final ArraySchema additionalPropertiesArra... |
return new Content() {
@Override
public Class<? extends Annotation> annotationType() {
return null;
}
@Override
public String mediaType() {
return mediaType;
}
@Override
public ExampleObject[] examples() {
return examples;
}
@Override
public Schema schema() {
retu... | 1,286 | 486 | 1,772 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/discriminatormapping/Builder.java | Builder | build | class Builder {
/**
* The property value that will be mapped to a Schema
*
*/
private String value = "";
/**
* The schema that is being mapped to a property value
*
*/
private Class<?> schema = Void.class;
/**
* The Extensions.
*/
private Extension[] extensions = {};
/**
* Instantiates a ne... |
return new DiscriminatorMapping() {
@Override
public Class<? extends Annotation> annotationType() {
return null;
}
@Override
public String value() {
return value;
}
@Override
public Class<?> schema() {
return schema;
}
@Override
public Extension[] extensions() {
r... | 352 | 108 | 460 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/encoding/Builder.java | Builder | build | class Builder {
/**
* The name of this encoding object instance.
* This property is a key in encoding map of MediaType object and
* MUST exist in a schema as a property.
*
*/
private String name = "";
/**
* The Content-Type for encoding a specific property.
*
*/
private String contentType = "";
... |
return new Encoding() {
@Override
public Class<? extends Annotation> annotationType() {
return null;
}
@Override
public String name() {
return name;
}
@Override
public String contentType() {
return contentType;
}
@Override
public String style() {
return style;
... | 863 | 192 | 1,055 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/exampleobject/Builder.java | Builder | build | class Builder {
/**
* A unique name to identify this particular example
*/
private String name = "";
/**
* A brief summary of the purpose or context of the example
*/
private String summary = "";
/**
* A string representation of the example. This is mutually exclusive with the externalValue property,... |
return new ExampleObject() {
@Override
public Class<? extends Annotation> annotationType() {
return null;
}
@Override
public String name() {
return name;
}
@Override
public String summary() {
return summary;
}
@Override
public String value() {
return value;
}
... | 792 | 183 | 975 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/extension/Builder.java | Builder | build | class Builder {
/**
* An option name for these extensions.
*
*/
private String name = "";
/**
* The extension properties.
*
*/
private ExtensionProperty[] properties;
/**
* Instantiates a new Extension builder.
*/
private Builder() {
}
/**
* Builder extension builder.
*
* @return the e... |
return new Extension() {
@Override
public Class<? extends Annotation> annotationType() {
return null;
}
@Override
public String name() {
return name;
}
@Override
public ExtensionProperty[] properties() {
return properties;
}
};
| 304 | 81 | 385 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/extensionproperty/Builder.java | Builder | build | class Builder {
/**
* The name of the property.
*
*/
private String name;
/**
* The value of the property.
*
*/
private String value;
/**
* If set to true, field `value` will be parsed and serialized as JSON/YAML
*
*/
private boolean parseValue;
/**
* Instantiates a new Extension property... |
return new ExtensionProperty() {
@Override
public Class<? extends Annotation> annotationType() {
return null;
}
@Override
public String name() {
return name;
}
@Override
public String value() {
return value;
}
@Override
public boolean parseValue() {
return parseVal... | 384 | 102 | 486 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/externaldocumentation/Builder.java | Builder | build | class Builder {
/**
* A short description of the target documentation.
*
*/
private String description = "";
/**
* The URL for the target documentation. Value must be in the format of a URL.
*
*/
private String url = "";
/**
* The list of optional extensions
*
*/
private Extension[] extension... |
return new ExternalDocumentation() {
@Override
public Class<? extends Annotation> annotationType() {
return null;
}
@Override
public String description() {
return description;
}
@Override
public String url() {
return url;
}
@Override
public Extension[] extensions() {
... | 413 | 103 | 516 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/header/Builder.java | Builder | build | class Builder {
/**
* Required: The name of the header. The name is only used as the key to store this header in a map.
*/
private String name;
/**
* Additional description data to provide on the purpose of the header
*/
private String description = "";
/**
* The schema defining the type used for the ... |
return new Header() {
@Override
public Class<? extends Annotation> annotationType() {
return null;
}
@Override
public String name() {
return name;
}
@Override
public String description() {
return description;
}
@Override
public Schema schema() {
return schema;
... | 1,052 | 270 | 1,322 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/link/Builder.java | Builder | build | class Builder {
/**
* The name of this link.
*
*/
private String name = "";
/**
* A relative or absolute reference to an OAS operation. This field is mutually exclusive of the operationId field, and must point to an Operation Object. Relative operationRef values may be used to locate an existing Operation O... |
return new Link() {
@Override
public Class<? extends Annotation> annotationType() {
return null;
}
@Override
public String name() {
return name;
}
@Override
public String operationRef() {
return operationRef;
}
@Override
public String operationId() {
return operat... | 1,100 | 229 | 1,329 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/linkparameter/Builder.java | Builder | build | class Builder {
/**
* The name of this link parameter.
*
*/
private String name = "";
/**
* A constant or an expression to be evaluated and passed to the linked operation.
*
*/
private String expression = "";
/**
* Instantiates a new Link parameter builder.
*/
private Builder() {
}
/**
* B... |
return new LinkParameter() {
@Override
public Class<? extends Annotation> annotationType() {
return null;
}
@Override
public String name() {
return name;
}
@Override
public String expression() {
return expression;
}
};
| 292 | 81 | 373 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/requestbody/Builder.java | Builder | build | class Builder {
/**
* A brief description of the request body.
*
*/
private String description = "";
/**
* The content of the request body.
*
*/
private Content[] content = {};
/**
* Determines if the request body is required in the request. Defaults to false.
*
*/
private boolean required;
... |
return new RequestBody() {
@Override
public Class<? extends Annotation> annotationType() {
return null;
}
@Override
public String description() {
return description;
}
@Override
public Content[] content() {
return content;
}
@Override
public boolean required() {
r... | 751 | 169 | 920 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/securityrequirement/Builder.java | Builder | build | class Builder {
/**
* This name must correspond to a declared SecurityRequirement.
*
*/
private String name;
/**
* If the security scheme is of type "oauth2" or "openIdConnect", then the value is a list of scope names required for the execution.
* For other security scheme types, the array must be empty.
... |
return new SecurityRequirement() {
@Override
public Class<? extends Annotation> annotationType() {
return null;
}
@Override
public String name() {
return name;
}
@Override
public String[] scopes() {
return scopes;
}
};
| 338 | 84 | 422 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/server/Builder.java | Builder | build | class Builder {
/**
* Required. A URL to the target host.
* This URL supports Server Variables and may be relative, to indicate that the host location is relative to the location where the
* OpenAPI definition is being served. Variable substitutions will be made when a variable is named in {brackets}.
*
*/
... |
return new Server() {
@Override
public Class<? extends Annotation> annotationType() {
return null;
}
@Override
public String url() {
return url;
}
@Override
public String description() {
return description;
}
@Override
public ServerVariable[] variables() {
return ... | 585 | 123 | 708 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/servervariable/Builder.java | Builder | build | class Builder {
/**
* Required. The name of this variable.
*
*/
private String name;
/**
* An array of allowable values for this variable. This field map to the enum property in the OAS schema.
*
* @return String array of allowableValues
*/
private String[] allowableValues = {};
/**
* Required.... |
return new ServerVariable() {
@Override
public Class<? extends Annotation> annotationType() {
return null;
}
@Override
public String name() {
return name;
}
@Override
public String[] allowableValues() {
return allowableValues;
}
@Override
public String defaultValue() {... | 619 | 148 | 767 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ControllerAdviceInfo.java | ControllerAdviceInfo | getApiResponseMap | class ControllerAdviceInfo {
/**
* The Controller advice.
*/
private final Object controllerAdvice;
/**
* The Method advice infos.
*/
private List<MethodAdviceInfo> methodAdviceInfos = new ArrayList<>();
/**
* Instantiates a new Controller advice info.
*
* @param controllerAdvice the controller ad... |
Map<String, ApiResponse> apiResponseMap = new LinkedHashMap<>();
for (MethodAdviceInfo methodAdviceInfo : methodAdviceInfos) {
if (!CollectionUtils.isEmpty(methodAdviceInfo.getApiResponses()))
apiResponseMap.putAll(methodAdviceInfo.getApiResponses());
}
return apiResponseMap;
| 288 | 95 | 383 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ParameterId.java | ParameterId | equals | class ParameterId {
/**
* The P name.
*/
private String pName;
/**
* The Param type.
*/
private String paramType;
/**
* The Ref.
*/
private String $ref;
/**
* Instantiates a new Parameter id.
*
* @param parameter the parameter
*/
public ParameterId(Parameter parameter) {
this.pName = p... |
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ParameterId that = (ParameterId) o;
if (this.pName == null && StringUtils.isBlank(this.paramType))
return Objects.equals($ref, that.$ref);
if (this.pName != null && StringUtils.isBlank(this.paramType))
return Objects... | 662 | 159 | 821 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ParameterInfo.java | ParameterInfo | calculateParams | class ParameterInfo {
/**
* The constant LOGGER.
*/
private static final Logger LOGGER = LoggerFactory.getLogger(ParameterInfo.class);
/**
* The Method parameter.
*/
private final MethodParameter methodParameter;
/**
* The P name.
*/
private String pName;
/**
* The Parameter model.
*/
privat... |
if (StringUtils.isNotEmpty(requestParam.value()))
this.pName = requestParam.value();
this.required = requestParam.required();
this.defaultValue = requestParam.defaultValue();
if (!isFile)
this.paramType = ParameterIn.QUERY.toString();
| 1,940 | 78 | 2,018 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/RequestBodyInfo.java | RequestBodyInfo | addProperties | class RequestBodyInfo {
/**
* The Request body.
*/
private RequestBody requestBody;
/**
* The Merged schema.
*/
private Schema mergedSchema;
/**
* Gets request body.
*
* @return the request body
*/
public RequestBody getRequestBody() {
return requestBody;
}
/**
* Sets request body.
*
... |
if (mergedSchema == null)
mergedSchema = new ObjectSchema();
mergedSchema.addProperty(paramName, schemaN);
| 302 | 40 | 342 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/parsers/KotlinCoroutinesReturnTypeParser.java | KotlinCoroutinesReturnTypeParser | getReturnType | class KotlinCoroutinesReturnTypeParser implements ReturnTypeParser {
@Override
public Type getReturnType(MethodParameter methodParameter) {<FILL_FUNCTION_BODY>}
} |
Method method = methodParameter.getMethod();
Type returnType = Object.class;
assert method != null;
Optional<Parameter> continuationParameter = Arrays.stream(method.getParameters())
.filter(parameter -> parameter.getType().getCanonicalName().equals(Continuation.class.getCanonicalName()))
.findFirst();
... | 47 | 208 | 255 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/AbstractSwaggerUiConfigProperties.java | SwaggerUrl | toString | class SwaggerUrl {
/**
* The Url.
*/
@JsonProperty("url")
private String url;
/**
* The Name.
*/
@JsonIgnore
private String name;
/**
* The Display name.
*/
@JsonProperty("name")
private String displayName;
/**
* Instantiates a new Swagger url.
*/
public SwaggerUrl() {
... |
final StringBuilder sb = new StringBuilder("SwaggerUrl{");
sb.append("url='").append(url).append('\'');
sb.append(", name='").append(name).append('\'');
sb.append('}');
return sb.toString();
| 642 | 75 | 717 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SpringDocConfigProperties.java | GroupConfig | equals | class GroupConfig {
/**
* The Paths to match.
*/
private List<String> pathsToMatch;
/**
* The Packages to scan.
*/
private List<String> packagesToScan;
/**
* The Packages to exclude.
*/
private List<String> packagesToExclude;
/**
* The Paths to exclude.
*/
private List<String... |
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
GroupConfig that = (GroupConfig) o;
return Objects.equals(group, that.group);
| 1,776 | 62 | 1,838 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiOAuthProperties.java | SwaggerUiOAuthProperties | getConfigParameters | class SwaggerUiOAuthProperties {
/**
* The Client id.
*/
private String clientId;
/**
* The Client secret.
*/
private String clientSecret;
/**
* The Realm.
*/
private String realm;
/**
* The App name.
*/
private String appName;
/**
* The Scope separator.
*/
private String scopeSeparat... |
final Map<String, Object> params = new TreeMap<>();
SpringDocPropertiesUtils.put("clientId", clientId, params);
SpringDocPropertiesUtils.put("clientSecret", clientSecret, params);
SpringDocPropertiesUtils.put("realm", realm, params);
SpringDocPropertiesUtils.put("scopeSeparator", scopeSeparator, params);
S... | 1,297 | 251 | 1,548 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/ActuatorProvider.java | ActuatorProvider | onApplicationEvent | class ActuatorProvider implements ApplicationListener<WebServerInitializedEvent> {
/**
* The Management server properties.
*/
protected ManagementServerProperties managementServerProperties;
/**
* The Web endpoint properties.
*/
protected WebEndpointProperties webEndpointProperties;
/**
* The Server p... |
if (WebServerApplicationContext.hasServerNamespace(event.getApplicationContext(), "management")) {
managementApplicationContext = event.getApplicationContext();
actuatorWebServer = event.getWebServer();
}
else {
applicationWebServer = event.getWebServer();
}
| 1,028 | 77 | 1,105 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/ObjectMapperProvider.java | ObjectMapperProvider | createJson | class ObjectMapperProvider extends ObjectMapperFactory {
/**
* The Json mapper.
*/
private final ObjectMapper jsonMapper;
/**
* The Yaml mapper.
*/
private final ObjectMapper yamlMapper;
/**
* Instantiates a new Spring doc object mapper.
*
* @param springDocConfigProperties the spring doc config p... |
OpenApiVersion openApiVersion = springDocConfigProperties.getApiDocs().getVersion();
ObjectMapper objectMapper;
if (openApiVersion == OpenApiVersion.OPENAPI_3_1)
objectMapper = ObjectMapperProvider.createJson31();
else
objectMapper = ObjectMapperProvider.createJson();
if (springDocConfigProperties.isW... | 626 | 123 | 749 | <methods>public void <init>() ,public static com.fasterxml.jackson.databind.ObjectMapper buildStrictGenericObjectMapper() ,public static com.fasterxml.jackson.databind.ObjectMapper create(com.fasterxml.jackson.core.JsonFactory, boolean) ,public static com.fasterxml.jackson.databind.ObjectMapper createJson() ,public sta... |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDocJavadocProvider.java | SpringDocJavadocProvider | getFirstSentence | class SpringDocJavadocProvider implements JavadocProvider {
/**
* The comment formatter.
*/
private final CommentFormatter formatter = new CommentFormatter();
/**
* Gets class description.
*
* @param cl the class
* @return the class description
*/
@Override
public String getClassJavadoc(Class<?> c... |
if (StringUtils.isEmpty(text)) {
return text;
}
int pOpenIndex = text.indexOf("<p>");
int pCloseIndex = text.indexOf("</p>");
int dotIndex = text.indexOf(".");
if (pOpenIndex != -1) {
if (pOpenIndex == 0 && pCloseIndex != -1) {
if (dotIndex != -1) {
return text.substring(3, min(pCloseIndex, ... | 882 | 266 | 1,148 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/WebConversionServiceProvider.java | WebConversionServiceProvider | getSpringConvertedType | class WebConversionServiceProvider implements InitializingBean, ApplicationContextAware {
/**
* The constant CONVERTERS.
*/
private static final String CONVERTERS = "converters";
/**
* The constant LOGGER.
*/
private static final Logger LOGGER = LoggerFactory.getLogger(WebConversionServiceProvider.class);... |
Class<?> result = clazz;
Field convertersField = FieldUtils.getDeclaredField(GenericConversionService.class, CONVERTERS, true);
if (convertersField != null) {
Object converters;
if (!AopUtils.isAopProxy(formattingConversionService)){
try {
converters = convertersField.get(formattingConversionServi... | 728 | 301 | 1,029 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/PropertyResolverUtils.java | PropertyResolverUtils | resolve | class PropertyResolverUtils {
/**
* The constant LOGGER.
*/
private static final Logger LOGGER = LoggerFactory.getLogger(PropertyResolverUtils.class);
/**
* The Factory.
*/
private final ConfigurableBeanFactory factory;
/**
* The Message source.
*/
private final MessageSource messageSource;
/**
... |
String result = parameterProperty;
if (parameterProperty != null) {
if (!springDocConfigProperties.isDisableI18n())
try {
result = messageSource.getMessage(parameterProperty, null, locale);
}
catch (NoSuchMessageException ex) {
LOGGER.trace(ex.getMessage());
}
if (parameterProperty.... | 1,205 | 195 | 1,400 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerResourceResolver.java | AbstractSwaggerResourceResolver | findWebJarResourcePath | class AbstractSwaggerResourceResolver {
/**
* The Swagger ui config properties.
*/
private final SwaggerUiConfigProperties swaggerUiConfigProperties;
/**
* Instantiates a new Web jars version resource resolver.
*
* @param swaggerUiConfigProperties the swagger ui config properties
*/
public AbstractSwa... |
Path path = Paths.get(pathStr);
if (path.getNameCount() < 2) return null;
String version = swaggerUiConfigProperties.getVersion();
if (version == null) return null;
Path first = path.getName(0);
Path rest = path.subpath(1, path.getNameCount());
return first.resolve(version).resolve(rest).toString();
| 194 | 103 | 297 | <no_super_class> |
springdoc_springdoc-openapi | springdoc-openapi/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerWelcome.java | AbstractSwaggerWelcome | buildConfigUrl | class AbstractSwaggerWelcome {
/**
* The Swagger ui configuration.
*/
protected final SwaggerUiConfigProperties swaggerUiConfig;
/**
* The Spring doc config properties.
*/
protected final SpringDocConfigProperties springDocConfigProperties;
/**
* The Swagger ui calculated config.
*/
protected final... |
if (StringUtils.isEmpty(swaggerUiConfig.getConfigUrl())) {
apiDocsUrl = buildApiDocUrl();
swaggerConfigUrl = buildSwaggerConfigUrl();
swaggerUiConfigParameters.setConfigUrl(swaggerConfigUrl);
if (CollectionUtils.isEmpty(swaggerUiConfigParameters.getUrls())) {
String swaggerUiUrl = swaggerUiConfig.get... | 1,538 | 386 | 1,924 | <no_super_class> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.