From f486f90a7327171ba2f4a6659b4f65696c62ec53 Mon Sep 17 00:00:00 2001 From: Tom Kralidis Date: Tue, 14 May 2019 16:42:42 -0400 Subject: [PATCH] add example --- pygeoapi/openapi.py | 2 ++ pygeoapi/process/hello_world.py | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/pygeoapi/openapi.py b/pygeoapi/openapi.py index e3c5db3..d90971e 100644 --- a/pygeoapi/openapi.py +++ b/pygeoapi/openapi.py @@ -345,6 +345,8 @@ def get_oas_30(cfg): } } } + if 'example' in p.metadata: + paths['{}/jobs'.format(process_name_path)]['post']['requestBody']['content']['application/json']['example'] = p.metadata['example'] # noqa oas['paths'] = paths diff --git a/pygeoapi/process/hello_world.py b/pygeoapi/process/hello_world.py index b1a517c..688d29c 100644 --- a/pygeoapi/process/hello_world.py +++ b/pygeoapi/process/hello_world.py @@ -68,7 +68,14 @@ PROCESS_METADATA = { 'mimeType': 'application/json' }] } - }] + }], + 'example': { + 'inputs': [{ + 'id': 'name', + 'value': 'hi there', + 'type': 'text/plain' + }] + } }