Ejemplo n.º 1
0
        public string AdditionalPropertiesTSType()
        {
            string result = "any";

            if (AdditionalProperties != null)
            {
                var type = AdditionalProperties.TSType(true);
                result = type != "any" ? $"{type} | any" : "any";
            }
            return(result);
        }
Ejemplo n.º 2
0
        public string AdditionalPropertiesDocumentation()
        {
            string result = "Describes unknown properties. ";

            if (AdditionalProperties != null)
            {
                var type = AdditionalProperties.TSType(true);
                if (type != "any")
                {
                    result += $"The value of an unknown property MUST be of type \"{type}\". Due to valid TS constraints " +
                              $"we have modeled this as a union of `{type} | any`.";
                }
                else
                {
                    result += "The value of an unknown property can be of \"any\" type.";
                }
            }
            return(result);
        }