validator

command module
v0.0.0-...-8f9fbf7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2024 License: Apache-2.0, MIT Imports: 7 Imported by: 0

README

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.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL