Revision 72553a2d
Added by koszko over 1 year ago
test/world_wide_library.py | ||
---|---|---|
150 | 150 |
|
151 | 151 |
for srt in sample_resource_templates: |
152 | 152 |
resource = make_sample_resource() |
153 |
resource['api_schema_version'] = [1] |
|
154 |
resource['api_schema_revision'] = 1 |
|
155 | 153 |
resource['identifier'] = f'resource_{srt["id_suffix"]}' |
156 | 154 |
resource['long_name'] = resource['identifier'].upper() |
157 | 155 |
resource['uuid'] = str(uuid4()) |
... | ... | |
166 | 164 |
resource_versions[1][-1] += 1 |
167 | 165 |
|
168 | 166 |
mapping = make_sample_mapping() |
169 |
mapping['api_schema_version'] = [1] |
|
170 |
mapping['api_schema_revision'] = 1 |
|
171 | 167 |
mapping['identifier'] = f'mapping_{srt["id_suffix"]}' |
172 | 168 |
mapping['long_name'] = mapping['identifier'].upper() |
173 | 169 |
mapping['uuid'] = str(uuid4()) |
... | ... | |
208 | 204 |
|
209 | 205 |
def serve_query(command, get_params, post_params): |
210 | 206 |
response = { |
211 |
'api_schema_version': [1], |
|
212 |
'api_schema_revision': 1, |
|
213 |
'mappings': sample_queries[get_params['url'][0]] |
|
207 |
'$schema': 'https://hydrilla.koszko.org/schemas/api_query_result-1.schema.json', |
|
208 |
'generated_by': { |
|
209 |
'name': 'human', |
|
210 |
'version': 'sapiens-0.8.15' |
|
211 |
}, |
|
212 |
'mappings': sample_queries[get_params['url'][0]] |
|
214 | 213 |
} |
215 | 214 |
|
216 | 215 |
return (200, {}, json.dumps(response)) |
Also available in: Unified diff
assume and use "$schema" properties in item definitions