Create a preview
Create a preview for a given documentation file. The preview will have a unique temporary URL, and will be active for 30 minutes.
Body
The preview object
-
Serialized definition of the version. 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 servers, like local files or internal URLs.
POST
/previews
curl \
-X POST https://bump.sh/api/v1/previews \
-H "Content-Type: application/json" \
-d '{"definition":"{asyncapi: \"2.0\", \"info\": { \"title: … }}\n","references":[{"location":"https://example.com/api/models/pet.yml","content":"string"}]}'
Request example
{
"definition": "{asyncapi: \"2.0\", \"info\": { \"title: … }}\n",
"references": [
{
"location": "https://example.com/api/models/pet.yml",
"content": "string"
}
]
}
Request examples
{
"definition": "{asyncapi: \"2.0\", \"info\": { \"title: … }}\n",
"references": [
{
"location": "https://example.com/api/models/pet.yml",
"content": "string"
}
]
}
Response examples (201)
{
"id": "3ef8f52f-9056-4113-840e-2f7183b90e06",
"expires_at": "2010-04-14 17:05:00 +0100",
"public_url": "https://bump.sh/preview/3ef8f52f-9056-4113-840e-2f7183b90e06"
}
Response examples (201)
{
"id": "3ef8f52f-9056-4113-840e-2f7183b90e06",
"expires_at": "2010-04-14T17:05:00+01:00",
"public_url": "https://bump.sh/preview/3ef8f52f-9056-4113-840e-2f7183b90e06"
}
Response examples (422)
{
"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"
]
}
}
Response examples (422)
{
"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"
]
}
}