swagger2markup/src/main/java/io/github/swagger2markup/internal/utils/RegexUtils.java
/**
     * Groups the operations by regex group. The key of the Multimap is the group name.
     * The value of the Multimap is a PathOperation
     *
     * @param allOperations all operations
     * @param headerPattern regex pattern used for determining headers
     * @return Operations grouped by regex
     */
Groups the operations by regex group. The key of the Multimap is the group name.
The value of the Multimap is a PathOperation

@param allOperations all operations
@param headerPattern regex pattern used for determining headers
@return Operations grouped by regex
Groups the operations by regex group . The key of the Multimap is the group name . The value of the Multimap is a PathOperation @param allOperations all operations @param headerPattern regex pattern used for determining headers @return Operations grouped by regex
public static Multimap<String, SwaggerPathOperation> groupOperationsByRegex(List<SwaggerPathOperation> allOperations, Pattern headerPattern) {
        Multimap<String, SwaggerPathOperation> operationsGroupedByRegex = LinkedHashMultimap.create();
        for (SwaggerPathOperation operation : allOperations) {
            String path = operation.getPath();
            Matcher m = headerPattern.matcher(path);
            if (m.matches() && m.group(1) != null) {
                if (logger.isDebugEnabled()) {
                    logger.debug("Added path operation '{}' to header '{}'", operation, m.group(1));
                }
                operationsGroupedByRegex.put(m.group(1), operation);
            } else {
                if(logger.isWarnEnabled()) {
                    logger.warn("Operation '{}' does not match regex '{}' and will not be included in output", operation, headerPattern.toString());
                }
            }
        }
        return operationsGroupedByRegex;
    }
public static Multimap < String , SwaggerPathOperation > groupOperationsByRegex ( List < SwaggerPathOperation > allOperations , Pattern headerPattern ) { Multimap < String , SwaggerPathOperation > operationsGroupedByRegex = LinkedHashMultimap . create ( ) ; for ( SwaggerPathOperation operation : allOperations ) { String path = operation . getPath ( ) ; Matcher m = headerPattern . matcher ( path ) ; if ( m . matches ( ) && m . group ( 1 ) != null ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Added path operation '{}' to header '{}'" , operation , m . group ( 1 ) ) ; } operationsGroupedByRegex . put ( m . group ( 1 ) , operation ) ; } else { if ( logger . isWarnEnabled ( ) ) { logger . warn ( "Operation '{}' does not match regex '{}' and will not be included in output" , operation , headerPattern . toString ( ) ) ; } } } return operationsGroupedByRegex ; }
Groups the operations by regex group.
Groups the operations by regex group .