예제 #1
0
        protected override void CreateMemberDocComment(KeyValuePair <string, OpenApiSchema> item, CodeMemberField property)
        {
            if (String.IsNullOrEmpty(item.Value.Description))
            {
                return;
            }


            string typeComment = item.Value.Description;

            if (!String.IsNullOrEmpty(typeComment))
            {
                bool funky = typeComment.Contains("*/");
                if (funky)
                {
                    typeComment = typeComment.Replace("*/", "");
                    Trace.TraceWarning($"Component {item.Key} with property {property.Name} has Doc comments containing '*/' which is invalid in JSDoc. Please remove it in the definition.");
                }
            }

            if (settings.DataAnnotationsToComments)
            {
                List <string> ss = ComponentsHelper.GetCommentsFromAnnotations(item.Value);
                if (!String.IsNullOrEmpty(typeComment))
                {
                    ss.Insert(0, typeComment);
                }

                property.Comments.Add(new CodeCommentStatement(Fonlow.DocComment.StringFunctions.IndentedArrayToString(ss), true));
            }
            else
            {
                property.Comments.Add(new CodeCommentStatement(typeComment, true));
            }
        }
        protected override void CreateMemberDocComment(KeyValuePair <string, OpenApiSchema> item, CodeMemberField property)
        {
            string typeComment = item.Value.Description;

            if (settings.DataAnnotationsToComments)
            {
                List <string> ss = ComponentsHelper.GetCommentsFromAnnotations(item.Value);
                if (!String.IsNullOrEmpty(typeComment))
                {
                    ss.Insert(0, typeComment);
                }

                AddDocComments(ss, property.Comments);
            }
            else
            {
                AddDocComments(typeComment, property.Comments);
            }
        }