internal static SwaggerParameter ToSwaggerParameter(this ParameterDefinition parameter)
        {
            SwaggerParameter p = new SwaggerParameter()
            {
                Name        = parameter.Name,
                Required    = parameter.Required,
                Type        = parameter.Type.SwaggerType(),
                Description = parameter.Description
            };

            //In = parameter.Location.ToString().ToLower(),
            switch (parameter.Location)
            {
            case ParameterLocation.Header:
                p.In = "header";
                break;

            case ParameterLocation.Path:
                p.In = "path";
                break;

            case ParameterLocation.QueryString:
                p.In = "query";
                break;

            case ParameterLocation.JsonObject:
                p.In = "object";
                break;

            default:
                throw new NotSupportedException(string.Format("Unsupported parameter location: {0}", parameter.Location));
            }

            return(p);
        }
        internal static SwaggerParameter ToSwaggerParameter(this ParameterDefinition parameter)
        {
            SwaggerParameter p = new SwaggerParameter()
            {
                    Name = parameter.Name,
                    Required = parameter.Required.Value,
                    Type = parameter.Type.ToSwaggerTypeString(),
                    Description = parameter.Description
            };

            //In = parameter.Location.ToString().ToLower(),
            switch (parameter.Location)
            {
                case ParameterLocation.Header:
                    p.In = "header";
                    break;
                case ParameterLocation.Path:
                    p.In = "path";
                    break;
                case ParameterLocation.QueryString:
                    p.In = "query";
                    break;
                case ParameterLocation.JsonObject:
                    p.In = "object";
                    break;
                default:
                    throw new NotSupportedException(string.Format("Unsupported parameter location: {0}", parameter.Location));
            }

            return p;
        }