module

Noir::WcfExtractor

Code-first WCF REST operations: [WebGet] / [WebInvoke] on a service contract method (System.ServiceModel.Web, or CoreWCF.Web). Yields declarations only; turning a UriTemplate into a URL is the analyzer's job.

Constants

ARGS = TopLevelSplit::Rules.new(quotes: "\"")
ATTRIBUTE = /[\[,]\s*(?:[\w.]+\.)?Web(Get|Invoke)(?:Attribute)?\s*(?=[(\],])/

[WebGet(...)], [OperationContract, WebInvoke(...)], [WebGet].

CONTRACT_NAME = /\bOperationContract(?:Attribute)?\s*\([^)]*\bName\s*=\s*@?"([^"]+)"/

[OperationContract(Name = "x")] / [MessageParameter(Name = "x")] rename the operation / parameter on the wire.

KEYWORD_ARG = /\A(\w+)\s*=\s*(.*)\z/m
LITERAL = /\A@?"((?:[^"\\]|\\.|"")*)"\z/m
MESSAGE_PARAM = /\bMessageParameter(?:Attribute)?\s*\([^)]*\bName\s*=\s*@?"([^"]+)"/
METHOD_NAME = /(\w+)\s*(?:<[^()]*>)?\s*\z/

The method name before the parameter list, past a generic <T>.

Instance methods

extract(content : String) : Array(Operation)
Source
wcf_source?(content : String) : Bool

Every WCF operation also carries [OperationContract], so a file with a WebGet attribute but no contract is someone else's attribute.

Source

Nested types