Validate a documentation definition
Validate a definition against its schema (OpenAPI or AsyncAPI) and return errors without creating a new version. This is useful in a CI process, to validate that a changed definition file is valid and won't fail when being deployed on Bump.sh.
Body
The version validation request object
-
UUID or slug of the documentation.
-
hub string
UUID or slug of the hub if the documentation is part of a hub.
-
documentation_name string
Name of the documentation to create. Used only if
auto_create_documentation
is set. -
auto_create_documentation boolean
Create the documentation if it does not exist yet. Must be used with a
hub
and adocumentation
.Default value is
false
. -
definition string
REQUIRED if
url
is not present.Serialized definition. This should be an OpenAPI 2.x, 3.x or AsyncAPI 2.x file serialized as a string, in YAML or JSON.
-
references array[object]
Import external references used by
definition
. It's usually resources not accessible by Bump.sh servers, like local files or internal URLs. -
url string(uri)
REQUIRED if
definition
is not present.Target definition URL. It should be accessible through HTTP by Bump.sh servers.
curl \
-X POST https://bump.sh/api/v1/validations \
-H "Authorization: Token $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"documentation":"0776d85d-e097-47c1-8c60-cb1190d11945","hub":"my_hub_slug","documentation_name":"string","auto_create_documentation":false,"definition":"{\"openapi\": \"3.0\", \"info\": { \"title\": … }}\n","references":[{"location":"https://example.com/api/models/pet.yml","content":"string"}],"url":"https://example.com"}'
{
"documentation": "0776d85d-e097-47c1-8c60-cb1190d11945",
"hub": "my_hub_slug",
"documentation_name": "string",
"auto_create_documentation": false,
"definition": "{\"openapi\": \"3.0\", \"info\": { \"title\": … }}\n",
"references": [
{
"location": "https://example.com/api/models/pet.yml",
"content": "string"
}
],
"url": "https://example.com"
}
{
"specification": "openapi/v3/json"
}
{
"message": "You need to upgrade to a paid plan to perform this request. Please go to https://bump.sh/account/billing"
}
{
"message": "Invalid definition file",
"errors": {
"raw_definition": [
"The property '#/paths//docs/{:id}/validations/post' contains additional properties [\"yolo\"] outside of the schema when none are allowed"
]
}
}