JSON format modernisation and _shields_test removal (#3272)
* 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
This commit is contained in:
25
doc/json-format.md
Normal file
25
doc/json-format.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# 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.
|
||||
Reference in New Issue
Block a user