From efb0830d6483f9d0b6dae4f821e5118c63ed9831 Mon Sep 17 00:00:00 2001 From: "Renato L. de F. Cunha" Date: Fri, 5 Apr 2024 16:02:50 -0300 Subject: [PATCH] Use valid JSON syntax throughout --- docs/source/docfiles/markdown/REST_API.md | 215 ++++++++++++++-------- 1 file changed, 140 insertions(+), 75 deletions(-) diff --git a/docs/source/docfiles/markdown/REST_API.md b/docs/source/docfiles/markdown/REST_API.md index 527f6e8a..a0e9ccad 100644 --- a/docs/source/docfiles/markdown/REST_API.md +++ b/docs/source/docfiles/markdown/REST_API.md @@ -38,29 +38,48 @@ Replacing the body of the request `` with the following: ```json { - "name": "Hello!", - "workflow": "helloworld", - "parameters": None, - "user_input": { - "start_date": datetime.datetime(2020, 5, 1, 0, 0), - "end_date": datetime.datetime(2020, 5, 5, 0, 0), - "geojson": { - "features": [ - { - "geometry": { - "type": "Polygon", - "coordinates": (((-119.14896203939314, 46.51578909859286), - (-119.14896203939314, 46.37578909859286), - (-119.28896203939313, 46.37578909859286), - (-119.28896203939313, 46.51578909859286), - (-119.14896203939314, 46.51578909859286)),) - }, - "type": "Feature" - } - ], - "type": "FeatureCollection" + "name": "Hello!", + "workflow": "helloworld", + "parameters": null, + "user_input": { + "start_date": "2020-05-01T00:00:00", + "end_date": "2020-05-05T00:00:00", + "geojson": { + "features": [ + { + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -119.14896203939314, + 46.51578909859286 + ], + [ + -119.14896203939314, + 46.37578909859286 + ], + [ + -119.28896203939313, + 46.37578909859286 + ], + [ + -119.28896203939313, + 46.51578909859286 + ], + [ + -119.14896203939314, + 46.51578909859286 + ] + ] + ] + }, + "type": "Feature" } + ], + "type": "FeatureCollection" } + } } ``` @@ -93,62 +112,108 @@ Which would generate the following json: ```json { - "name": "SAM segmentation", - "workflow": "farm_ai/segmentation/segment_s2", - "parameters": None, + "name": "SAM segmentation", + "workflow": "farm_ai/segmentation/segment_s2", + "parameters": null, + "user_input": { "user_input": { - "user_input": { - "type": "Feature", - "stac_version": "1.0.0", - "id": "f6465ad0-5e01-4792-ad99-a0bd240c1e7d", - "properties": { - "start_datetime": "2020-05-01T00:00:00+00:00", - "end_datetime": "2020-05-05T00:00:00+00:00", - "datetime": "2020-05-01T00:00:00Z" - }, - "geometry": {"type": "Polygon", - "coordinates": (((-119.14896203939314, 46.51578909859286), - (-119.14896203939314, 46.37578909859286), - (-119.28896203939313, 46.37578909859286), - (-119.28896203939313, 46.51578909859286), - (-119.14896203939314, 46.51578909859286)),) - }, - "links": [], - "assets": {}, - "bbox": [-119.28896203939313, - 46.37578909859286, - -119.14896203939314, - 46.51578909859286], - "stac_extensions": [], - "terravibes_data_type": "DataVibe" - }, - "prompts": { - "type": "Feature", - "stac_version": "1.0.0", - "id": "geo_734c6441-cb25-4c40-8204-6b7286f24bb9", - "properties": { - "urls": ["/mnt/734c6441-cb25-4c40-8204-6b7286f24bb9_geometry_collection.geojson"], - "start_datetime": "2020-05-01T00:00:00+00:00", - "end_datetime": "2020-05-05T00:00:00+00:00", - "datetime": "2020-05-01T00:00:00Z" - }, - "geometry": {"type": "Polygon", - "coordinates": (((-119.14896203939314, 46.51578909859286), - (-119.14896203939314, 46.37578909859286), - (-119.28896203939313, 46.37578909859286), - (-119.28896203939313, 46.51578909859286), - (-119.14896203939314, 46.51578909859286)),) - }, - "links": [], - "assets": {}, - "bbox": [-119.28896203939313, - 46.37578909859286, - -119.14896203939314, - 46.51578909859286], - "stac_extensions": [], - "terravibes_data_type": "ExternalReferenceList" - } + "type": "Feature", + "stac_version": "1.0.0", + "id": "f6465ad0-5e01-4792-ad99-a0bd240c1e7d", + "properties": { + "start_datetime": "2020-05-01T00:00:00+00:00", + "end_datetime": "2020-05-05T00:00:00+00:00", + "datetime": "2020-05-01T00:00:00Z" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -119.14896203939314, + 46.51578909859286 + ], + [ + -119.14896203939314, + 46.37578909859286 + ], + [ + -119.28896203939313, + 46.37578909859286 + ], + [ + -119.28896203939313, + 46.51578909859286 + ], + [ + -119.14896203939314, + 46.51578909859286 + ] + ] + ] + }, + "links": [], + "assets": {}, + "bbox": [ + -119.28896203939313, + 46.37578909859286, + -119.14896203939314, + 46.51578909859286 + ], + "stac_extensions": [], + "terravibes_data_type": "DataVibe" + }, + "prompts": { + "type": "Feature", + "stac_version": "1.0.0", + "id": "geo_734c6441-cb25-4c40-8204-6b7286f24bb9", + "properties": { + "urls": [ + "/mnt/734c6441-cb25-4c40-8204-6b7286f24bb9_geometry_collection.geojson" + ], + "start_datetime": "2020-05-01T00:00:00+00:00", + "end_datetime": "2020-05-05T00:00:00+00:00", + "datetime": "2020-05-01T00:00:00Z" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -119.14896203939314, + 46.51578909859286 + ], + [ + -119.14896203939314, + 46.37578909859286 + ], + [ + -119.28896203939313, + 46.37578909859286 + ], + [ + -119.28896203939313, + 46.51578909859286 + ], + [ + -119.14896203939314, + 46.51578909859286 + ] + ] + ] + }, + "links": [], + "assets": {}, + "bbox": [ + -119.28896203939313, + 46.37578909859286, + -119.14896203939314, + 46.51578909859286 + ], + "stac_extensions": [], + "terravibes_data_type": "ExternalReferenceList" } + } } ```