* Modernised JSON format and removed _shields_test style * Added logoWidth and labelColor fields to JSON response * Reinstated and updated comment * Extended expectBadge to accept Joi schemas for all fields
26 lines
844 B
Markdown
26 lines
844 B
Markdown
# JSON Format
|
|
|
|
Even though Shields is probably best known for its SVG badges, you can also retrieve
|
|
a JSON payload by replacing the `.svg` extension with `.json`.
|
|
|
|
For instance, hitting [this endpoint](https://img.shields.io/badge/hello-world-brightgreen.json)
|
|
will generate the following payload:
|
|
|
|
```
|
|
{
|
|
"name": "hello",
|
|
"label": "hello",
|
|
"value": "world",
|
|
"message": "world",
|
|
"color": "brightgreen"
|
|
}
|
|
```
|
|
|
|
Note that the values of the `name` and `value` fields are duplicates of the `label`
|
|
and `message` ones, respectively. As of April 2019, `name` and `value` are deprecated
|
|
and will be removed in a future release, please consider migrating your application
|
|
to use `label` and `message` instead.
|
|
|
|
Feel free to [open an issue](https://github.com/badges/shields/issues/new/choose)
|
|
if you have any queries regarding the JSON format.
|