Ejemplo n.º 1
0
        public IList <Property> ConvertParametersToProperties(IEnumerable <Parameter> parameters)
        {
            var properties = new List <Property>();

            foreach (var parameter in parameters.Where(parameter => parameter != null && parameter.Schema != null))
            {
                var description = ParserHelpers.RemoveNewLines(parameter.Description);

                properties.Add(new Property
                {
                    Type         = NewNetTypeMapper.GetNetType(parameter.Schema),
                    Name         = NetNamingMapper.GetPropertyName(parameter.Name),
                    OriginalName = parameter.Name,
                    Description  = description,
                    Example      = ObjectParser.MapExample(parameter.Schema),
                    Required     = parameter.Required
                });
            }
            return(properties);
        }