decentralized-identity / decentralized-identity/wallet-rendering
Proposal: JSON Schema Rendering Objects (JROs)
- Dominant language
- JavaScript
- Stars
- 8
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
I'd like to talk about this during the next DIF call as a STRAWMAN proposal, of a specification I'm calling JSON Schema Rendering Objects (which I call JROs)
The concept here is to provide a standard way to describe objects requiring to be consistently rendered across multiple devices with a customizable definition. In a lot of ways, it's trying to generalize and extend CM and WR to a single abstraction. It may help addresses the lack of customization and extensibility the current specs have.
Heavily inspired by [JSONForms](https://jsonforms.io/docs/), it has 4 properties:
* data property: which specifies the data to be rendered
* schema property: which specifies the schema that the data should conform to
* layout property: specifies the suggested layout for render
* styles: which specify styling hints for how to render the object
Credentials would be one implementation of a JROs, of possibly many others.
Another point would be that many predefined objects could be defined, like avatars, images, thumbnails, etc, and specified as "standard objects".
I'd like to discuss this at the next WR call and see if there's any viability in exploring this concept further.
Here's the STRAWMAN:
```json
{
"data": {
"thumbnail": {
"uri": "https://dol.wa.com/logo.png",
"alt": "Washington State Seal"
},
"hero": {
"uri": "https://dol.wa.com/people-working.png",
"alt": "People working on serious things"
}
},
"layout": {
"type": "HorizontalLayout",
"elements": [
{
"type": "Control",
"label": "Thumbnail",
"scope": "#/properties/thumbnail"
},
{
"type": "Control",
"label": "Hero Image",
"scope": "#/properties/hero"
}
]
},
"styles": {
"background": {
"color": "#ff0000"
},
"text": {
"color": "#d4d400"
}
},
"schema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Entity Styles",
"type": "object",
"definitions": {
"image": {
"type": "object",
"properties": {
"uri": {
"type": "string",
"format": "uri"
},
"alt": {
"type": "string"
}
},
"required": ["uri", "alt"]
},
"color": {
"type": "object",
"properties": {
"color": {
"type": "string",
"pattern": "^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"
}
},
"required": ["color"]
}
},
"properties": {
"thumbnail": {
"$ref": "#/definitions/image"
},
"hero": {
"$ref": "#/definitions/image"
},
"background": {
"$ref": "#/definitions/color"
},
"text": {
"$ref": "#/definitions/color"
}
}
}
}
````
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.