AvroSchema Service¶
Service which manages storing and retrieving Avro schemas by their hashed identity
Request Objects¶
-
Schema
¶ - An abstract data type. A schema may be one of:
- A record, mapping field names to field value data; A num, containing one of a small set of symbols; An array of values, all of the same schema; A map, containing string/value pairs, of a declared schema; A union of other schemas; A fixed sized binary object; A unicode string; A sequence of bytes; A 32-bit signed int; A 64-bit signed long; A 32-bit IEEE single-float; or A 64-bit IEEE double-float; or A boolean; or null.
JSON Parameters: - type (String) – (required) The type of a schema. Can be one of: “record”, “enum”, “array”, “map”, “union”, “fixed”, “string”, “bytes”, “int”, “long”, “float”, “double”, “boolean”, “null”.
- namespace (String) – (optional) The namespace in which the object lives. It is used to differentiate one schema type from another should they share the same name.
- name (String) – (optional) This is the schema name which, when combined with the namespace, uniquely identifies the schema within the store
- fiels (List[Object]) – *(optional) The actual schema definition. It defines what fields are contained in the value and their corresponding data types.
An example Schema looks like:
- {
“type”: “record”, “namespace”: “com.example”, “name”: “FullName”, “fields”: [
{ “name”: “first”, “type”: “string” }, { “name”: “last”, “type”: “string” }]
}
Store¶
-
GET
avroSchema/store.json
¶ Stores the schema in the database.
The following authentication methods are allowed for this endpoint:
JSON Parameters: - identifier (String) – (required) The ID of the Schema
- schema (Object) – (required) The Schema to store. See
AccountFields
for format of this object.
-
"result":
"success"
JSON Parameters: - result (String) – (required)
success
- result (String) – (required)
-
"result":
"failure"
JSON Parameters: - result (String) – (required)
failure
- errorCode (String) – (required) The error code of the failure.
- errorMessage (String) – (required) The (human readable) error message of the failure.
- result (String) – (required)
Is Stored¶
-
GET
avroSchema/isStored.json
¶ Checks if a schema with the given ID exists in the database.
The following authentication methods are allowed for this endpoint:
JSON Parameters: - identifier (String) – (required) The ID of the schema
-
"result":
"success"
JSON Parameters: - result (String) – (required)
success
- value (Boolean) – (required) True if the schema exists.
- result (String) – (required)
-
"result":
"failure"
JSON Parameters: - result (String) – (required)
failure
- errorCode (String) – (required) The error code of the failure.
- errorMessage (String) – (required) The (human readable) error message of the failure.
- result (String) – (required)
Fetch Schema¶
-
GET
avroSchema/schema.json
¶ Fetch a schema from the database.
The following authentication methods are allowed for this endpoint:
JSON Parameters: - identifier (String) – (required) The ID of the schema
-
"result":
"success"
JSON Parameters: - result (String) – (required)
success
- value (Object) – (required) The fetched Schema. See
Schema
for format of this object.
- result (String) – (required)
-
"result":
"failure"
JSON Parameters: - result (String) – (required)
failure
- errorCode (String) – (required) The error code of the failure.
- errorMessage (String) – (required) The (human readable) error message of the failure.
- result (String) – (required)