From a7c9f42743c009eba05e87b3d49c94ab55773663 Mon Sep 17 00:00:00 2001 From: Emerson Rocha Date: Wed, 5 May 2021 08:05:39 -0300 Subject: [PATCH] CODV2API (#1): created schema/CODV2API/v1.0/location-item-cod-ab.eng.schema.json --- eng.md | 5 ++ por.md | 6 ++ .../v1.0/exemplum/location-item-1.json | 7 +- .../v1.0/exemplum/location-item-2.json | 14 ++++ .../v1.0/exemplum/location-item-cod-ab-1.json | 12 ++++ .../v1.0/location-item-cod-ab.eng.schema.json | 67 +++++++++++++++++++ 6 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 schema/CODV2API/v1.0/exemplum/location-item-2.json create mode 100644 schema/CODV2API/v1.0/exemplum/location-item-cod-ab-1.json create mode 100644 schema/CODV2API/v1.0/location-item-cod-ab.eng.schema.json diff --git a/eng.md b/eng.md index 263e7bc..713915f 100644 --- a/eng.md +++ b/eng.md @@ -29,6 +29,7 @@ open industry standard to document REST APIs.** - [BR](#br) - [portais-ckan-brasil - Brazilian Open Data portals](#portais-ckan-brasil---brazilian-open-data-portals) - [portais-ckan-brasil-por](#portais-ckan-brasil-por) +- [Schema](#schema) - [Systema](#systema) - [OpenAPI](#openapi) - [Online editors](#online-editors) @@ -72,6 +73,10 @@ open industry standard to document REST APIs.** - **OpenAPI File**: [api/BR/portais-ckan-brasil/por/openapi.yaml](api/BR/portais-ckan-brasil/por/openapi.yaml) - **Preview/Execute**: +## Schema + +Please see repository at . + ## Systema ### OpenAPI diff --git a/por.md b/por.md index 3a2e8a1..5ef425b 100644 --- a/por.md +++ b/por.md @@ -26,6 +26,7 @@ documentar APIs REST.** - [BR](#br) - [portais-ckan-brasil - Portais de dados abertos do Brasil](#portais-ckan-brasil---portais-de-dados-abertos-do-brasil) - [portais-ckan-brasil-por](#portais-ckan-brasil-por) +- [Schema](#schema) - [Systema](#systema) - [OpenAPI](#openapi) - [Editores online](#editores-online) @@ -69,6 +70,11 @@ documentar APIs REST.** - **Arquivo OpenAPI**: [api/BR/portais-ckan-brasil/openapi.yaml](api/BR/portais-ckan-brasil/por/openapi.yaml) - **Pré-visualizar/executar online**: + +## Schema + +Por favor, navege no repositório em . + ## Systema ### OpenAPI diff --git a/schema/CODV2API/v1.0/exemplum/location-item-1.json b/schema/CODV2API/v1.0/exemplum/location-item-1.json index 33a4bcf..4b17bf5 100644 --- a/schema/CODV2API/v1.0/exemplum/location-item-1.json +++ b/schema/CODV2API/v1.0/exemplum/location-item-1.json @@ -7,5 +7,10 @@ ], "status": "OK", "Total": 2, - "_unknow-key": "This will be ignored by the schema" + "_unknow-key": "Any field starting with _ is ignored by schema", + "_comment": { + "date": "2021-05-05T06:27:00Z", + "source": "Example item from https://beta.itos.uga.edu/CODV2API/api/v1/locations", + "note": "/locations uses location_iso; locations/HN01 uses iso_3" + } } \ No newline at end of file diff --git a/schema/CODV2API/v1.0/exemplum/location-item-2.json b/schema/CODV2API/v1.0/exemplum/location-item-2.json new file mode 100644 index 0000000..68cfbfe --- /dev/null +++ b/schema/CODV2API/v1.0/exemplum/location-item-2.json @@ -0,0 +1,14 @@ +{ + "location_name": "Atlantida", + "iso_3": "hnd", + "themes": [ + "Administrative Boundary" + ], + "status": "ok", + "total": 1, + "_comment": { + "date": "2021-05-05T06:27:00Z", + "source": "First item of https://beta.itos.uga.edu/CODV2API/api/v1/locations/HN01", + "note": "Here uses iso_3" + } +} \ No newline at end of file diff --git a/schema/CODV2API/v1.0/exemplum/location-item-cod-ab-1.json b/schema/CODV2API/v1.0/exemplum/location-item-cod-ab-1.json new file mode 100644 index 0000000..a860050 --- /dev/null +++ b/schema/CODV2API/v1.0/exemplum/location-item-cod-ab-1.json @@ -0,0 +1,12 @@ +{ + "admin0Pcode": "sdn", + "admin0Name_ref": " Sudan", + "version": "Latest", + "valid_from": "2020-08-31T00:00:00", + "valid_to": "2021-08-31T00:00:00", + "comments": null, + "_comment": { + "date": "2021-05-05T06:38:00Z", + "source": "First item of https://beta.itos.uga.edu/CODV2API/api/v1/themes/cod-ab/locations/SDN" + } +} \ No newline at end of file diff --git a/schema/CODV2API/v1.0/location-item-cod-ab.eng.schema.json b/schema/CODV2API/v1.0/location-item-cod-ab.eng.schema.json new file mode 100644 index 0000000..e41b63e --- /dev/null +++ b/schema/CODV2API/v1.0/location-item-cod-ab.eng.schema.json @@ -0,0 +1,67 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://hapi.etica.ai/schema/CODV2API/v1.0/location-item-cod-ab.eng.schema.json", + "title": "UN/CODV2API v1.0 location-item", + "description": "JSON schema (English descriptions) from items of https://beta.itos.uga.edu/CODV2API/api/v1/themes/cod-ab/locations/SDN (as 2021-05-05) \nJSON Schem specification here https://json-schema.org/ \nExample of online editor: https://www.jsonschemavalidator.net/", + "type": "object", + "required": [ + "admin0Pcode", + "admin0Name_ref", + "version", + "valid_from", + "valid_to" + ], + "additionalProperties": false, + "properties": { + "admin0Pcode": { + "description": "TODO: admin0Pcode description", + "type": "string", + "minLength": 3, + "maxLength": 3, + "example": "sdn" + }, + "admin0Name_ref": { + "description": "TODO: admin0Name_ref description", + "type": "string", + "minLength": 3, + "maxLength": 128, + "example": "Sudan" + }, + "version": { + "description": "TODO: version description", + "type": "string", + "example": "Latest" + }, + "Total": { + "description": "TODO: Total description", + "type": "integer" + }, + "valid_from": { + "description": "TODO: valid_from description", + "type": "string", + "format": "date-time" + }, + "valid_to": { + "description": "TODO: valid_to description", + "type": "string", + "format": "date-time" + }, + "comments": { + "description": "TODO: comments description", + "type": [ + "string", + "null" + ] + } + }, + "patternProperties": { + "^_": { + "type": [ + "string", + "array", + "object" + ], + "description": "Properties starting with Properties are tolerated, since we're enforcing additionalProperties=false" + } + } +} \ No newline at end of file