Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: APPS-882 Clarify providing GeoJSON bin types #144

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ package: clean validatedocs build
build:
./gradlew build -x test

.PHONY: run
run:
./gradlew bootRun



.PHONY: clean
clean:
echo $(VERSION)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ here [Aerospike REST Gateway API Documentation](https://docs.aerospike.com/apido

## Prerequisites

* Java 17 or later for REST Gateway 2.0 and newer. Java 8 or later for REST Gateway 1.11 and earlier.
* Java 17 or later for REST Gateway 2.0 and newer. Java 8 or later for REST Gateway 1.11 and earlier.
* Aerospike Server version 4.9+

## Installation
Expand Down Expand Up @@ -85,7 +85,7 @@ languages.

1. Go to [Swagger Editor](https://editor.swagger.io/).
2. Import the Aerospike REST
Client [openapi.json](https://github.com/aerospike/aerospike-rest-gateway/blob/master/docs/openapi.json) file.
Client [openapi.json](https://aerospike.github.io/aerospike-rest-gateway/openapi.json) file.
3. Click on Generate Server/Generate Client and choose the desired language/framework.
4. A .zip file that contains all the necessary files for a server/client will be downloaded.

Expand Down
26 changes: 18 additions & 8 deletions docs/data-formats.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Rest Gateway Data Formats
# REST Gateway Data Formats

API Requests which involve sending data can use the `JSON`, or `MessagePack` formats. By default JSON will be assumed.
To use `MessagePack`, set the `Content-Type` header to ``"application/msgpack"``. Similarly
Expand All @@ -11,13 +11,9 @@ For many uses `JSON` is a simpler and completely valid option. It provides simpl
Key Value operations are being used, and neither Maps with non string keys, Bytes nor GeoJSON are required, then `JSON`
will work completely with the Aerospike data model.

**Note**: In version 1.0 GeoJSON and ByteArray bin values are supported. A GeoJSON map with the keys "type" and "
coordinates" will automatically be understood as a GeoJSON type. Similarly, a ByteArray can be provided using a map with
the keys "type"
and "value" where the type is "byteArray" and the value is a base64 encoded string. One caveat is GeoJSON and ByteArrays
can not be nested in CDTs.
**Note**: GeoJSON and ByteArrays can not be nested in CDTs.

Ex. GeoJSON
In 2.0.1, a GeoJSON map with the keys "type" and "coordinates" will automatically be understood as a GeoJSON type.

```javascript
{
Expand All @@ -26,7 +22,21 @@ Ex. GeoJSON
}
```

Ex. ByteArray
In version prior to 2.0.1, a GeoJSON object can be provided by sending a base64 encoded GeoJSON string.
Base64 encoding the following string `{"type": "Point", "coordinates": [1.123, 4.156]}` results
in `eyJ0eXBlIjogIlBvaW50IiwgImNvb3JkaW5hdGVzIjogWzEuMTIzLCA0LjE1Nl19Cg==`.
To write the GeoJSON object use

```javascript
{
"type": "GEO_JSON",
"value": "eyJ0eXBlIjogIlBvaW50IiwgImNvb3JkaW5hdGVzIjogWzEuMTIzLCA0LjE1Nl19Cg=="
}
```

Similarly, starting in 1.0.0 a ByteArray can be provided using a map with
the keys "type"
and "value" where the type is "byteArray" and the value is a base64 encoded string.

```javascript
{
Expand Down
2 changes: 1 addition & 1 deletion docs/installation-and-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ make build
* Run Locally during development:

```sh
./gradlew bootRun
make run
```

### Run using a Jar file
Expand Down
2 changes: 1 addition & 1 deletion docs/operate.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# DEPRECATED

Operatation documentation is now imbedded in the swagger documentation.
# Operation documentation is now embedded in the swagger documentation as of 2.0.1

# Rest Gateway Operations

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class APIParamDescriptors {
public static final String NAMESPACE_NOTES = "Namespace for the record; equivalent to database name.";
public static final String SET_NOTES = "Set for the record; equivalent to database table.";
public static final String USERKEY_NOTES = "Userkey for the record.";
public static final String STORE_BINS_NOTES = "Bins to be stored in the record. This is a mapping from a string bin name to a value. " + "Value can be a String, integer, floating point number, list, map, bytearray, or GeoJSON value. Bytearrays and GeoJSON can " + "only be sent using MessagePack\n " + "example: {\"bin1\":5, \"bin2\":\"hello\", \"bin3\": [1,2,3], \"bin4\": {\"one\": 1}}";
public static final String STORE_BINS_NOTES = "Bins to be stored in the record. This is a mapping from a string bin name to a value. " + "Value can be a String, integer, floating point number, list, map, bytearray, or GeoJSON value.";

public static final String QUERY_PARTITION_BEGIN_NOTES = "Start partition id (0 - 4095)";
public static final String QUERY_PARTITION_COUNT_NOTES = "Number of partitions";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ public class RequestBodyExamples {

// key value
public static final String BINS_NAME = "Bins request body example";
public static final String BINS_VALUE = "{\"bin1\":5, \"bin2\":\"hello\", \"bin3\": [1,2,3], \"bin4\": {\"one\": 1}}";
public static final String BINS_VALUE = "{\"intBin\":5, \"strBin\":\"hello\", \"listBin\": [1,2,3], \"dictBin\": {\"one\": 1}, \"geoJsonBin\": {\"type\": \"Point\", \"coordinates\": [1.123, 4.156]}, \"byteArrayBin\": {\"type\": \"BYTE_ARRAY\", \"value\": \"YWVyb3NwaWtlCg==\"}}";
}
Loading