Exemplo n.º 1
0
        private void WriteRequestProcessorRemarks(MemberInfo info)
        {
            var processorAttribute = GetApiRequestProcessorAttributeUnsafe(info);

            if (string.IsNullOrWhiteSpace(processorAttribute.Remarks))
            {
                return;
            }

            Wrappers.AppendPaddedLines(_builder, RemarksHeaderPattern, processorAttribute.Remarks);
        }
Exemplo n.º 2
0
        private void WriteRequestProcessorHeader(MemberInfo info)
        {
            var processorAttribute = GetApiRequestProcessorAttributeUnsafe(info);

            var uriInfo = $"{processorAttribute.Method.ToString().ToUpperInvariant()} {processorAttribute.SubUri}";

            _builder.AppendLine($"{MethodHeaderPrefixPattern}{uriInfo}");
            Wrappers.AppendPaddedLines(_builder, processorAttribute.Description);
            WriteRequestProcessorState(info);
            var authWord = processorAttribute.AuthRequired ? YesWordPattern : NoWordPattern;

            _builder.AppendLine($"{AuthDescriptionPattern}{authWord}");
            _builder.AppendLine();
        }
Exemplo n.º 3
0
        private void WriteRequestProcessorQueryParams(MemberInfo info)
        {
            var queryParamAttributes = info.GetCustomAttributes <ApiQueryParamAttribute>().ToList();

            if (!queryParamAttributes.Any())
            {
                return;
            }

            Wrappers.AppendPaddedLines(_builder, QueryParamsPattern);

            foreach (var queryParamAttribute in queryParamAttributes)
            {
                WriteSingleQueryParamDescription(queryParamAttribute);
            }
            _builder.AppendLine();
        }
Exemplo n.º 4
0
        private void WriteBodyDescriptionAndRestrictions(Type type)
        {
            Wrappers.AppendPaddedLines(_builder, _settings.DescriptionAndRestrictionsPattern);

            _descriptionGenerator.GenerateViewDescription(type);
        }