Skip to content

Commit

Permalink
AEIP-13 Feedback after discussion (#51)
Browse files Browse the repository at this point in the history
aeip-8 compliance, add an example, specify that the schema is part of a bigger schema
  • Loading branch information
bchamagne authored Jul 3, 2023
1 parent c57cb93 commit 563f466
Showing 1 changed file with 33 additions and 5 deletions.
38 changes: 33 additions & 5 deletions AEIP-13.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,28 @@ This works because the first thing AEWeb does is fetch the latest reference tran

The node needs two modifications:

1. Add a new schema for AEWeb transaction
1. Add a new sub schema for AEWeb transaction
1. The controller which serves the AEWeb content should check the status and act accordingly

### New schema
## New sub schema
```json
{
"type": "object",
"description": "Reference tx of an unpublished website",
"properties": {
"aeip": {
"type": "array",
"items": { "type": "number" },
"description": "Supported AEIPs"
},
"aewebVersion": {
"type": "number",
"exclusiveMinimum": 0,
"description": "AEWeb's version"
},
"publicationStatus": {
"type": "string",
"enum": [
"UNPUBLISHED"
]
"enum": [ "UNPUBLISHED" ]
}
},
"required": [
Expand All @@ -47,6 +50,31 @@ The node needs two modifications:
}
```

This sub schema is used in a `oneOf` that also contains the two existing sub schemas:

```json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {...},
"oneOf": [
{"$ref": "#/definitions/aewebRefTxPublished"},
{"$ref": "#/definitions/aewebRefTxUnpublished"},
{"$ref": "#/definitions/aewebDataTx"},
]
}
```

#### Example of a web_hosting transaction's content to unpublish a website

```json
{
"aeip": [8, 13],
"aewebVersion": 1,
"publicationStatus": "UNPUBLISHED"
}
```


### Controller logic

When fetching the reference transaction for a AEWeb website, the controller will check the new `publicationStatus` attribute from the JSON. From there, there is 3 possibilities:
Expand Down

0 comments on commit 563f466

Please sign in to comment.