From 904a8c6d536a902bbf4191435782d96be7e10ade Mon Sep 17 00:00:00 2001 From: Robert Schadek Date: Thu, 10 Jan 2019 13:45:21 +0000 Subject: [PATCH] Made WebParamAttribute public to allow rest introspection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I'm currently building a angular service generator. This is done by introspecting rest interfaces. To get the parameter names right, it needs to look at the UDAs, and more specifically at WebParamAttribute. * Sönke remarks worked in --- web/vibe/web/common.d | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/web/vibe/web/common.d b/web/vibe/web/common.d index f8fac0cfae..27e91cb75d 100644 --- a/web/vibe/web/common.d +++ b/web/vibe/web/common.d @@ -482,14 +482,18 @@ package struct PathAttribute /// private package struct NoRouteAttribute {} -/// Private struct describing the origin of a parameter (Query, Header, Body). -package struct WebParamAttribute { +/** + * This struct contains a mapping between the name used by HTTP (field) + * and the parameter (identifier) name of the function. + */ +public struct WebParamAttribute { import vibe.web.internal.rest.common : ParameterKind; + /// The type of the WebParamAttribute ParameterKind origin; - /// Parameter name + /// Parameter name (function parameter name). string identifier; - /// The meaning of this field depends on the origin. + /// The meaning of this field depends on the origin. (HTTP request name) string field; }