From 563f46616332d27a8ce617b104deb3ab87aea702 Mon Sep 17 00:00:00 2001 From: bchamagne <74045243+bchamagne@users.noreply.github.com> Date: Mon, 3 Jul 2023 20:32:11 +0200 Subject: [PATCH] AEIP-13 Feedback after discussion (#51) aeip-8 compliance, add an example, specify that the schema is part of a bigger schema --- AEIP-13.md | 38 +++++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/AEIP-13.md b/AEIP-13.md index 05c5b5e..6a28fdd 100644 --- a/AEIP-13.md +++ b/AEIP-13.md @@ -18,15 +18,20 @@ 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, @@ -34,9 +39,7 @@ The node needs two modifications: }, "publicationStatus": { "type": "string", - "enum": [ - "UNPUBLISHED" - ] + "enum": [ "UNPUBLISHED" ] } }, "required": [ @@ -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: