Пример #1
0
        ///<summary>
        /// Returns the class name for the node with more or less precision depending on the provided arguments
        ///</summary>
        public static string GetClassName(this OpenApiUrlTreeNode currentNode, string suffix = default, string prefix = default, OpenApiOperation operation = default)
        {
            var rawClassName = operation?.GetResponseSchema()?.Reference?.GetClassName() ??
                               currentNode?.GetIdentifier()?.ReplaceValueIdentifier();

            if ((currentNode?.DoesNodeBelongToItemSubnamespace() ?? false) && idClassNameCleanup.IsMatch(rawClassName))
            {
                rawClassName = idClassNameCleanup.Replace(rawClassName, string.Empty);
            }
            return(prefix + rawClassName + suffix);
        }