private void read(ReaderContext context) {
        final SwaggerDefinition swaggerDefinition = context.getCls()
            .getAnnotation(SwaggerDefinition.class);
        if (swaggerDefinition != null) {
            readSwaggerConfig(swaggerDefinition);
        }
        List<Method> interfaceMethodList = Arrays.asList(context.getInterfaceCls().getMethods());
        Collections.sort(interfaceMethodList, new Comparator<Method>() {
            @Override
            public int compare(Method o1, Method o2) {
                return o1.getName().compareTo(o2.getName());
            }
        });
        Map<Method, Method> serviceMethods = new HashMap<Method, Method>();
        for (Method method : interfaceMethodList) {
            if (!ReflectionUtils.isOverriddenMethod(method, context.getCls())) {
                serviceMethods.put(method, getRefMethod(context, method));
            }
        }

        for (Entry<Method, Method> entry : serviceMethods.entrySet()) {
            Method method = entry.getValue();
            Method interfaceMethod = entry.getKey();

            final Operation operation = new Operation();
            String operationPath = null;
            String httpMethod = null;

            ReaderExtension extension = new RpcReaderExtension();
            if (operationPath == null) {
                operationPath = extension.getPath(context, method);
            }
            if (httpMethod == null) {
                httpMethod = extension.getHttpMethod(context, method);
            }
            if (operationPath == null || httpMethod == null) {
                continue;
            }

            if (extension.isReadable(context)) {
                extension.setDeprecated(operation, method);
                extension.applyConsumes(context, operation, method);
                extension.applyProduces(context, operation, method);
                extension.applyOperationId(operation, method);
                extension.applySummary(operation, method);
                extension.applyDescription(operation, method);
                extension.applySchemes(context, operation, method);
                extension.applySecurityRequirements(context, operation, method);
                extension.applyTags(context, operation, method);
                extension.applyResponses(context, operation, method);
                extension.applyImplicitParameters(context, operation, method);
                extension.applyParameters(context, operation, method, interfaceMethod);
                extension.applyExtensions(context, operation, method);
            }

            if (httpMethod != null) {
                if (operation.getResponses() == null) {
                    operation.defaultResponse(new Response().description("successful operation"));
                }

                final Map<String, String> regexMap = new HashMap<String, String>();
                final String parsedPath = PathUtils.parsePath(operationPath, regexMap);

                Path path = swagger.getPath(parsedPath);
                if (path == null) {
                    path = new Path();
                    swagger.path(parsedPath, path);
                }
                path.set(httpMethod.toLowerCase(), operation);
            }
        }
    }
Scans a set of classes for Swagger annotations.

@param swagger is the Swagger instance
@param classes are a set of classes to scan
doc-swagger/src/main/java/com/alipay/sofa/rpc/doc/swagger/generate/Reader.java