@RemoteMethod(method=POST, path="/user/createWithArray") public Ok createUsers( @Body( description="List of user objects" ) User[] users ) throws InvalidUsername, IdConflict, NotAcceptable, UnsupportedMediaType;
@RemoteMethod(method=PUT, path="/pet/{petId}") public Ok updatePet( @Body( description="Pet object that needs to be added to the store" ) UpdatePet pet ) throws IdNotFound, NotAcceptable, UnsupportedMediaType;
@Body public static class B05 { private String s; public B05(Reader in) throws Exception { this.s = IOUtils.read(in); } @Override public String toString() { return s; } } }
@RestMethod( summary="Overwrite the JSON-Schema document", description="Replaces the schema document with the specified content, and then mirrors it as the response." ) public JsonSchema put(@Body JsonSchema schema) throws Exception { this.schema = schema; return schema; } }
@RestMethod( summary="Overwrite the sample ATOM feed", description="Replaces the feed with the specified content, and then mirrors it as the response." ) public Feed put(@Body Feed feed) throws Exception { this.feed = feed; return feed; } }
@RestMethod(name=POST, path="/setEnum1d3dListMap") public void setEnum1d3dListMap(@Body Map<TestEnum,List<TestEnum[][][]>> x) { assertObjectEquals("{ONE:[[[['TWO',null],null],null],null]}", x); Map.Entry<TestEnum,List<TestEnum[][][]>> e = x.entrySet().iterator().next(); assertClass(TestEnum.class, e.getKey()); assertClass(TestEnum[][][].class, e.getValue().get(0)); }
@RestMethod(name=POST, path="/setSwappedPojoMap") public void setSwappedPojoMap(@Body Map<SwappedPojo,SwappedPojo> x) { assertObjectEquals("{'"+SWAP+"':'"+SWAP+"'}", x); Map.Entry<SwappedPojo,SwappedPojo> e = x.entrySet().iterator().next(); assertTrue(e.getKey().wasUnswapped); assertTrue(e.getValue().wasUnswapped); }
@RemoteMethod(method=PUT, path="/user/{username}") public Ok updateUser( @Path( name="username", description="Name that need to be updated" ) String username, @Body( description="Updated user object" ) User user ) throws InvalidUsername, IdNotFound, NotAcceptable, UnsupportedMediaType;
@RestMethod(name=POST, path="/setTypedBean1d3dListMap") public void setTypedBean1d3dListMap(@Body Map<String,List<TypedBean[][][]>> x) { assertObjectEquals("{foo:[[[[{_type:'TypedBeanImpl',a:1,b:'foo'},null],null],null],null]}", x); assertClass(TypedBeanImpl.class, x.get("foo").get(0)[0][0][0]); }
@RestMethod(name=POST, path="/setTypedBeanListMapIntegerKeys") public void setTypedBeanListMapIntegerKeys(@Body Map<Integer,List<TypedBean>> x) { assertObjectEquals("{'1':[{_type:'TypedBeanImpl',a:1,b:'foo'}]}", x); // Note: JsonSerializer serializes key as string. assertClass(TypedBeanImpl.class, x.get(1).get(0)); }
@RemoteMethod(method=PUT, path="/user/{username}") public Ok updateUser( @Path( name="username", description="Name that need to be updated" ) String username, @Body( description="Updated user object" ) User user ) throws InvalidUsername, IdNotFound, NotAcceptable, UnsupportedMediaType;
@RestMethod(name=POST, path="/setEnum1d3dList") public void setEnum1d3dList(@Body List<TestEnum[][][]> x) { assertObjectEquals("[[[['TWO',null],null],null],null]", x); assertClass(TestEnum[][][].class, x.get(0)); }
@RestMethod(name=POST, path="/setTypedBean3dArray") public void setTypedBean3dArray(@Body TypedBean[][][] x) { assertObjectEquals("[[[{_type:'TypedBeanImpl',a:1,b:'foo'},null],null],null]", x); assertClass(TypedBeanImpl.class, x[0][0][0]); }
@RestMethod(name=PUT, path="/classTransformOverridesParentClassTransform") public A a01b(@Body A a) { return a; // Should return "A2-1". } @RestMethod(name=PUT, path="/classTransformOverridesParentClassTransform/{a}")
@RestMethod public String putA01(@Body String in) { return in; } }
public void a( @Body( description={"b3","b3"}, required=true, schema=@Schema($ref="c3"), example="f2", api="{g2:true}" ) A02 x ) { } }
@RestMethod(name=PUT, path="/parserOnMethod", parsers=PB.class) public String a02(@Body String in) { return in; } @RestMethod(name=PUT, path="/parserOverriddenOnMethod", parsers={Inherit.class, PB.class,PC.class})
@RestMethod(name=PUT, path="/Boolean") public Boolean a04(@Body Boolean b) { return b; } @RestMethod(name=PUT, path="/boolean")
@RestMethod(name=PUT, path="/String") public Reader d01(@Body Reader b) throws Exception { return b; } @RestMethod(name=PUT, path="/InputStream")
@RestMethod(name=POST,path="/", properties={ @Property(name=UrlEncodingSerializer.URLENC_expandedParams, value="true"), @Property(name=UrlEncodingParser.URLENC_expandedParams, value="true") } ) public DTOs.B g(@Body DTOs.B content) throws Exception { return content; } }