blob: 935f94b2caf83478bd0ac97dc797ccdcee695b8c [file] [log] [blame]
---
title: Prerequisites and Limitations for Writing REST Applications
---
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
Before development, understand the prerequisites and limitations of the current REST implementation in Geode.
Geode and REST-enabled applications accessing Geode are subject to the following rules and limitations:
- All domain objects, functions and function-arg classes must be properly configured and registered in the Geode deployment. Any functions that you wish to execute through the REST API must be available on the target members CLASSPATH.
- The current implementation only supports the **application/json** MIME type. At time of publication, any other return types (XML, objects, and so on) are not supported. Plain text is supported as a return type for some error messages.
- Keys are strictly of type String for this release. For example, the request `PUT http://localhost:8080/gemfire-api/v1/customers/123.456` will add entry for key ("123.456") of type String.
- Some special formats of JSON documents are not supported in Geode REST. See [Key Types and JSON Support](troubleshooting.html#concept_gsv_zd5_m4) for examples.
- To achieve interoperability between Geode Java clients (or Geode native clients) and REST clients, the following rules must be followed:
- All Geode Java and native client classes operating on data also accessed by the REST interface must be PDX serialized either via PDX autoserialization or by implementing `PdxSerializable`.
- Geode Java clients and native clients can retrieve REST-enabled data either as a `PdxInstance` or as an actual object by using the `PdxInstance.getObject` method. If you use the latter method, first you must declare the object type (@type) in your POST or PUT request payload when creating the object in REST; and secondly, the Java client must have the actual domain class in its CLASSPATH.
- Objects returned by REST-invoked functions must be returned as PdxInstance objects or other data types that can be written to JSON. You cannot return Java objects.
- REST client applications do not support single hop access or notification features.
- Specifying subregions as endpoints is not currently supported.