Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chop-dbhi/schema-registry
General purpose schema registry.
https://github.com/chop-dbhi/schema-registry
avro-schema jsonschema microservice schema-registry versioning
Last synced: 6 days ago
JSON representation
General purpose schema registry.
- Host: GitHub
- URL: https://github.com/chop-dbhi/schema-registry
- Owner: chop-dbhi
- Created: 2016-11-11T15:03:36.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-11-18T15:19:20.000Z (about 8 years ago)
- Last Synced: 2024-11-07T23:32:54.457Z (about 2 months ago)
- Topics: avro-schema, jsonschema, microservice, schema-registry, versioning
- Language: Go
- Size: 11.7 KB
- Stars: 3
- Watchers: 11
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Schema Registry
Schema registry is a service for managing schema for shared data types. The driving use case are validating data records in ETL-related workflows.
## Install
Download from the [releases page](https://github.com/chop-dbhi/schema-registry/releases)
## Run
```
schema-registry [-db registry.db]
[-http 127.0.0.1:8080]
[-tlscert tls.cert] [-tlskey tls.key]
```## Usage
At a minimum a schema must include a unique id, type, and the schema definition. Currently the registry supports [JSON Schema](http://json-schema.org) schema and [Apache Avro](http://avro.apache.org/docs/current/).
### HTTP API
Register a new schema.
```
curl -XPOST localhost:8080/schema -d '
{
"id": "test",
"type": "json-schema",
"def": {
"type": "object",
"properties": {
"first_name": {
"type": "string"
},
"last_name": {
"type": "string"
}
}
}
}
'
```Get the current version of a schema.
```
curl localhost:8080/schema/test
```Update a schema definition.
```
curl -XPUT localhost:8080/schema/test -d '
{
"type": "object",
"properties": {
"first_name": {
"type": "string"
},
"last_name": {
"type": "string"
},
"dob": {
"type": "string",
"format": "date-time"
}
}
}
'
```Validate a value against the schema. The response contains an array of errors if any are present.
```
curl -XPOST localhost:8080/schema/test -d '
{
"first_name": "John",
"last_name": "Doe"
}
'
```Get a list of schema IDs.
```
curl localhost:8080/schema
```