use of org.springdoc.core.SpringDocConfigProperties.GroupConfig in project springdoc-openapi by springdoc.
the class MultipleOpenApiResource method afterPropertiesSet.
@Override
public void afterPropertiesSet() {
this.groupedOpenApiResources = groupedOpenApis.stream().collect(Collectors.toMap(GroupedOpenApi::getGroup, item -> {
GroupConfig groupConfig = new GroupConfig(item.getGroup(), item.getPathsToMatch(), item.getPackagesToScan(), item.getPackagesToExclude(), item.getPathsToExclude(), item.getProducesToMatch(), item.getConsumesToMatch(), item.getHeadersToMatch());
springDocConfigProperties.addGroupConfig(groupConfig);
return buildWebMvcOpenApiResource(item);
}));
}
use of org.springdoc.core.SpringDocConfigProperties.GroupConfig in project springdoc-openapi by springdoc.
the class MultipleOpenApiResource method afterPropertiesSet.
@Override
public void afterPropertiesSet() {
this.groupedOpenApiResources = groupedOpenApis.stream().collect(Collectors.toMap(GroupedOpenApi::getGroup, item -> {
GroupConfig groupConfig = new GroupConfig(item.getGroup(), item.getPathsToMatch(), item.getPackagesToScan(), item.getPackagesToExclude(), item.getPathsToExclude(), item.getProducesToMatch(), item.getConsumesToMatch(), item.getHeadersToMatch());
springDocConfigProperties.addGroupConfig(groupConfig);
return buildWebFluxOpenApiResource(item);
}));
}
use of org.springdoc.core.SpringDocConfigProperties.GroupConfig in project springdoc-openapi by springdoc.
the class AbstractOpenApiResource method getConditionsToMatch.
/**
* Gets conditions to match.
*
* @param conditionType the condition type
* @param groupConfigs the group configs
* @return the conditions to match
*/
private List<String> getConditionsToMatch(ConditionType conditionType, GroupConfig... groupConfigs) {
List<String> conditionsToMatch = null;
GroupConfig groupConfig = null;
if (ArrayUtils.isNotEmpty(groupConfigs))
groupConfig = groupConfigs[0];
switch(conditionType) {
case HEADERS:
conditionsToMatch = (groupConfig != null) ? groupConfig.getHeadersToMatch() : springDocConfigProperties.getHeadersToMatch();
break;
case PRODUCES:
conditionsToMatch = (groupConfig != null) ? groupConfig.getProducesToMatch() : springDocConfigProperties.getProducesToMatch();
break;
case CONSUMES:
conditionsToMatch = (groupConfig != null) ? groupConfig.getConsumesToMatch() : springDocConfigProperties.getConsumesToMatch();
break;
default:
break;
}
return conditionsToMatch;
}
Aggregations