Created
October 16, 2020 09:40
-
-
Save pmhsfelix/5bab730bd470b637d9b5d5dd27329336 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// l10n example based on the https://tools.ietf.org/html/rfc7807 example | |
{ | |
"type": "https://example.net/validation-error", | |
"title": "Your request parameters didn't validate.", | |
"titleKey": "invalid.parameters.key" | |
"invalid-params": [ { | |
"name": "age", | |
"reason": "must be a positive integer", | |
"reasonKey": "must.be.positive.integer" | |
}, | |
{ | |
"name": "color", | |
"reason": "must be 'green', 'red' or 'blue'", | |
"reasonKey": "must.be.primary.color" | |
} | |
] | |
} | |
- In this example "titleKey" is indeed redundant, since "type" could also be used to act as an unique and stable identififier. | |
- However we also need identifiers (i.e. keys) to the "invalid-params" reasons. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment