Package com.wordnik.swagger.model

Examples of com.wordnik.swagger.model.Parameter


        commandExecutor.execute(commandList, parameterContext);

        Map<String, Object> result = parameterContext.getResult();

        if (!shouldExpand(methodParameter)) {
          Parameter parameter = new Parameter(
                  (String) result.get("name"),
                  toOption(result.get("description")),
                  toOption(result.get("defaultValue")),
                  (Boolean) result.get("required"),
                  (Boolean) result.get("allowMultiple"),
View Full Code Here


  }

  private Parameter defaultParameter() {
    AllowableValues allowable = allowableValues(Optional.<String>absent(), field);

    return new Parameter(
            isNullOrEmpty(parentName) ? field.getName() : String.format("%s.%s", parentName, field.getName()),
            toOption(null), //description
            toOption(null), //default value
            Boolean.FALSE,  //required
            Boolean.FALSE,  //allow multiple
View Full Code Here

  private Parameter fromApiParam(ApiParam apiParam) {
    String allowableProperty = emptyToNull(apiParam.allowableValues());
    AllowableValues allowable = allowableValues(fromNullable(allowableProperty), field);

    return new Parameter(
            isNullOrEmpty(parentName) ? field.getName() : String.format("%s.%s", parentName, field.getName()),
            toOption(apiParam.value()),
            toOption(apiParam.defaultValue()),
            apiParam.required(),
            apiParam.allowMultiple(),
View Full Code Here

  }

  private Parameter fromApiModelProperty(ApiModelProperty apiModelProperty) {
    String allowableProperty = emptyToNull(apiModelProperty.allowableValues());
    AllowableValues allowable = allowableValues(fromNullable(allowableProperty), field);
    return new Parameter(
            isNullOrEmpty(parentName) ? field.getName() : String.format("%s.%s", parentName, field.getName()),
            toOption(apiModelProperty.value()),
            toOption(null), //default value
            apiModelProperty.required(),
            Boolean.FALSE,  //allow multiple
View Full Code Here

    }
    return parameters;
  }

  public static Parameter getImplicitParameter(ApiImplicitParam param) {
    return new Parameter(
            param.name(),
            toOption(param.value()),
            toOption(param.defaultValue()),
            param.required(),
            param.allowMultiple(),
View Full Code Here

    for (NameValueExpression<String> expression : paramsCondition.getExpressions()) {
      if (expression.isNegated() || any(nullToEmptyList(parameters),
              withName(expression.getName()))) {
        continue;
      }
      Parameter parameter = new Parameter(
              expression.getName(),
              toOption(null),
              toOption(expression.getValue()),
              true,
              false,
View Full Code Here

        List<Parameter> parameters = new ApiPathParser().getPathParameters(resourcePath, null);

        assertEquals(1, parameters.size());

        Parameter documentationParameter = parameters.get(0);

        assertEquals("ownerName", documentationParameter.name());
        assertEquals(true, documentationParameter.required());
        assertEquals(ApiValues.TYPE_PATH(), documentationParameter.paramType());
        assertEquals("string", documentationParameter.dataType());
//        assertEquals(String.class.getName(), documentationParameter.getValueTypeInternal());
        assertEquals(false, documentationParameter.allowMultiple());
        assertEquals("Owner name", documentationParameter.description().get());
    }
View Full Code Here

                        Integer.class, Float.class, Double.class, Date.class);
        ApiParameterParser parameterParser = new ApiParameterParser(new ArrayList<String>(),
                new HashMap<String, Model>());
        List<Parameter> documentationParameters = parameterParser.parseApiParametersAndArgumentModels(method);
        assertTrue(documentationParameters.size() == 8);
        Parameter documentationParameter = documentationParameters.get(0);
        assertTrue(documentationParameter.dataType().equals("string"));
        assertTrue(documentationParameter.name().equals("testVariable"));
    }
View Full Code Here

    }

    private Parameter createParameter(String parameter) {
        Option<String> descriptionOption = Option.apply(getDescription(parameter));

        return new Parameter(parameter, descriptionOption, null, true, ModelUtils.isAllowMultiple(TYPE),
                ModelUtils.getSwaggerTypeFor(TYPE), null, ApiValues.TYPE_PATH(), null);
    }
View Full Code Here

            Option<String> descriptionOption = Option.apply(documentationParameter.getDescription());
            Option<String> defaultValueOption = Option.apply(documentationParameter.getDefaultValue());
            Option<String> paramAccessOption = Option.apply(documentationParameter.getParamAccess());

            Parameter parameter =
                    new Parameter(documentationParameter.getName(), descriptionOption, defaultValueOption,
                            documentationParameter.isRequired(), documentationParameter.isAllowMultiple(), dataType,
                            documentationParameter.getAllowableValues(),
                            documentationParameter.getParamType(), paramAccessOption);

            documentationParameters.add(parameter);
View Full Code Here

TOP

Related Classes of com.wordnik.swagger.model.Parameter

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.