1 unstable release

Uses old Rust 2015

0.1.0 Jan 9, 2017

#5 in #spaceapi

MIT/Apache

11KB
50 lines

Validation server for SpaceAPI endpoints

OpenAPI spec: https://validator.spaceapi.io/openapi.json

CircleCI Docker Image Go Report Card

API

There are two main endpoints, to validate raw JSON and to validate URLs:

The full API specification in OpenAPI format can be found at https://validator.spaceapi.io/openapi.json.

Validating URLs

Use this if your endpoint is already online.

Example (curl):

curl -X POST -H "Content-Type: application/json" \
    https://validator.spaceapi.io/v2/validateURL \
    -d'{"url": "https://status.crdmp.ch/"}'

Example (httpie):

http post \
    https://validator.spaceapi.io/v2/validateURL \
    url=https://status.crdmp.ch/

Response:

{
    "valid": true,
    "message": "",
    "isHttps": true,
    "httpsForward": false,
    "reachable": true,
    "cors": true,
    "contentType": true,
    "certValid": true,
    "validatedJson": {},
    "schemaErrors": []
}

Validating JSON

If you want to validate JSON data directly, use this endpoint. However, in contrast to the URL endpoint, only the content will be validated, but not the server configuration (e.g. whether CORS is set up properly or whether a valid certificate is being used).

Example (curl):

curl -X POST -H "Content-Type: application/json" \
    https://validator.spaceapi.io/v2/validateJSON \
    -d @mydata.json

Example (httpie):

cat mydata.json | http post https://validator.spaceapi.io/v2/validateJSON

Response:

{
    "message": "",
    "valid": true,
    "validatedJson": {},
    "schemaErrors": []
}

Dev setup

See DEVELOPMENT.md.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~9–15MB
~230K SLoC