Esempio n. 1
0
        protected Parameter BuildParameter(RequestParameter requestParameter)
        {
            var type = _typeFactory.CreateType(requestParameter.Schema, requestParameter.IsNullable());

            var isRequired   = requestParameter.Required == true;
            var defaultValue = ParseConstant(requestParameter);

            if (!isRequired && defaultValue == null)
            {
                defaultValue = Constant.Default(type);
            }
            return(new Parameter(
                       requestParameter.CSharpName(),
                       CreateDescription(requestParameter),
                       TypeFactory.GetInputType(type),
                       defaultValue,
                       isRequired));
        }