Skip to content

Commit ff8465c

Browse files
authored
OAProc: derive process execution mode OpenAPI prefer option from process metadata (#2272)
1 parent a09fdac commit ff8465c

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

pygeoapi/api/processes.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ def get_oas_30(cfg: dict, locale: str
760760
'description': 'Indicates client preferences, including whether the client is capable of asynchronous processing.', # noqa
761761
'schema': {
762762
'type': 'string',
763-
'enum': ['respond-async']
763+
'enum': []
764764
}
765765
}],
766766
'responses': {
@@ -784,6 +784,12 @@ def get_oas_30(cfg: dict, locale: str
784784
}
785785
}
786786

787+
jco = p.metadata.get('jobControlOptions', ['sync-execute'])
788+
if 'sync-execute' in jco:
789+
paths[f'{process_name_path}/execution']['post']['parameters'][0]['schema']['enum'].append('respond-sync') # noqa
790+
if 'async-execute' in jco:
791+
paths[f'{process_name_path}/execution']['post']['parameters'][0]['schema']['enum'].append('respond-async') # noqa
792+
787793
try:
788794
first_key = list(p.metadata['outputs'])[0]
789795
p_output = p.metadata['outputs'][first_key]

0 commit comments

Comments
 (0)