I have implement restful framework over Custom Attributes but fpc doesn't allow attribute with methods and generate "Sample.lpr(19,5) Error: Unbound custom attribute: "APostAttribute"." compiler error.
Is there a way to set attribute for methods ?
My attributes
{ AAttribute }
AAttribute = class(TCustomAttribute)
public
constructor Create;
end;
{ ARequestAttribute }
ARequestAttribute = class(AAttribute)
private
FURL: string;
public
constructor Create(AUrl: string);
property URL: string read FURL write FURL;
end;
{ APostAttribute }
APostAttribute = class(ARequestAttribute)
public
end;
{ AGetAttribute }
AGetAttribute = class(ARequestAttribute)
public
end;
{ AGParamAttribute }
AGParamAttribute = class(AAttribute)
public
end;
{ APParamAttribute }
APParamAttribute = class(AAttribute)
public
end;
And Service Interface
IFakeRest = interface(IInvokable)
['{C43D0D3C-9A91-4DA4-BE74-97B7DF9E2A2B}']
[APostAttribute('/test')]
function test(a: boolean; b: integer): string;
end;