Package com.mangofactory.swagger.readers.operation

Examples of com.mangofactory.swagger.readers.operation.ResolvedMethodParameter


public class ParameterTypeReader implements Command<RequestMappingContext> {
  @Override
  public void execute(RequestMappingContext context) {
    MethodParameter methodParameter = (MethodParameter) context.get("methodParameter");
    ResolvedMethodParameter resolvedMethodParameter
            = (ResolvedMethodParameter) context.get("resolvedMethodParameter");
    SwaggerGlobalSettings swaggerGlobalSettings = (SwaggerGlobalSettings) context.get("swaggerGlobalSettings");
    ResolvedType parameterType = resolvedMethodParameter.getResolvedParameterType();
    parameterType = swaggerGlobalSettings.getAlternateTypeProvider().alternateFor(parameterType);
    context.put("paramType", findParameterType(methodParameter, parameterType));
  }
View Full Code Here


public class ParameterDataTypeReader implements Command<RequestMappingContext> {

  @Override
  public void execute(RequestMappingContext context) {
    ResolvedMethodParameter methodParameter = (ResolvedMethodParameter) context.get("resolvedMethodParameter");
    SwaggerGlobalSettings swaggerGlobalSettings = (SwaggerGlobalSettings) context.get("swaggerGlobalSettings");
    ResolvedType parameterType = methodParameter.getResolvedParameterType();
    parameterType = swaggerGlobalSettings.getAlternateTypeProvider().alternateFor(parameterType);
    //Multi-part file trumps any other annotations
    if (MultipartFile.class.isAssignableFrom(parameterType.getErasedType())) {
      context.put("dataType", "File");
    } else {
View Full Code Here

    for (int i = 0; i < annotations.length; i++) {
      Annotation[] pAnnotations = annotations[i];
      for (Annotation annotation : pAnnotations) {
        if (annotation instanceof RequestBody) {
          ResolvedMethodParameter pType = parameterTypes.get(i);
          if (!settings.getIgnorableParameterTypes()
                  .contains(pType.getResolvedParameterType().getErasedType())) {
            ResolvedType modelType = settings.getAlternateTypeProvider().alternateFor(pType
                    .getResolvedParameterType());
            ModelContext modelContext = ModelContext.inputParam(modelType);
            markIgnorablesAsHasSeen(settings.getTypeResolver(), settings.getIgnorableParameterTypes(),
                    modelContext);
            Optional<Model> pModel = modelProvider.modelFor(modelContext);
            if (pModel.isPresent()) {
              log.debug("Swagger generated parameter model id: {}, name: {}, schema: {} models",
                      pModel.get().id(),
                      pModel.get().name());
              modelMap.put(pModel.get().id(), pModel.get());
            } else {
              log.debug("Swagger core did not find any parameter models for {}",
                      pType.getResolvedParameterType());
            }
            populateDependencies(modelContext, modelMap);
          }
        }
      }
View Full Code Here

TOP

Related Classes of com.mangofactory.swagger.readers.operation.ResolvedMethodParameter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.