protected virtual WebReturnContract ResolveReturn(ParameterInfo returnParameter)
        {
            WebReturnContract  contract  = new WebReturnContract(returnParameter);
            WebReturnAttribute attribute = returnParameter.GetCustomAttribute <WebReturnAttribute>();

            contract.Converter = attribute?.ResponseConverterType == null
                ? ResponseConverter.Instance
                : WebContractReflector.GetResponseConverter(attribute.ResponseConverterType, attribute.ResponseConverterParameters);

            return(contract);
        }
        protected virtual WebParameterContract ResolveParameter(ParameterInfo parameter)
        {
            WebParameterContract  contract  = new WebParameterContract(parameter);
            WebParameterAttribute attribute = parameter.GetCustomAttribute <WebParameterAttribute>();

            contract.Name = string.IsNullOrWhiteSpace(attribute?.Name) ? parameter.Name : attribute.Name;

            contract.Optional =
                attribute?.Optional ??
                parameter.ParameterType.IsValueType || Nullable.GetUnderlyingType(parameter.ParameterType) != null;

            contract.Serializer = attribute?.SerializerType == null
                ? FindBuiltInStringSerializer(parameter.ParameterType)
                : WebContractReflector.GetParameterSerializer(attribute.SerializerType, attribute.SerializerArgs);

            return(contract);
        }