File tree Expand file tree Collapse file tree
src/main/java/com/algorithmia/algo Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package com .algorithmia .algo ;
2+
3+ import java .lang .annotation .ElementType ;
4+ import java .lang .annotation .Retention ;
5+ import java .lang .annotation .RetentionPolicy ;
6+ import java .lang .annotation .Target ;
7+
8+ /**
9+ * For algorithm development, labels an apply method indicating it
10+ * should be passed in the raw/unparsed JSON input from the user. If the user did not call
11+ * the algorithm with a JSON content-type, this apply method will not be called.
12+ * <b>Note: You can only have a single apply method if you use @AcceptsJson</b>
13+ */
14+ @ Retention (RetentionPolicy .RUNTIME )
15+ @ Target (ElementType .METHOD )
16+ public @interface AcceptsJson {}
Original file line number Diff line number Diff line change 1+ package com .algorithmia .algo ;
2+
3+ import java .lang .annotation .ElementType ;
4+ import java .lang .annotation .Retention ;
5+ import java .lang .annotation .RetentionPolicy ;
6+ import java .lang .annotation .Target ;
7+
8+ /**
9+ * For algorithm development, indicates that a java method is returning a JSON-serialized String.
10+ * This will result in the API server returning a Content-Type of JSON. If the String returned is
11+ * not valid JSON, then the call will result in a JSON parsing exception.
12+ */
13+ @ Retention (RetentionPolicy .RUNTIME )
14+ @ Target (ElementType .METHOD )
15+ public @interface ReturnsJson {}
You can’t perform that action at this time.
0 commit comments