-
Notifications
You must be signed in to change notification settings - Fork 8
Description
I just pushed a fix (109ac35) because that field got filled incorrectly, but that was just a copy&paste error.
However, I feel there's also a semantic error here: The code ALWAYS fills that field.
IMO that's incorrect: Not only should this field be non-existent for responses from non-federated backends in general, but in the case of federated backends its presence or not actually has a deeper meaning, see https://github.com/Open-EO/openeo-api/blob/draft/extensions/federation/README.md#validation
- Endpoint returns without errors:
federation:backendsis included in the response: [...]federation:backendsis not included in the response: [...]- Endpoint returns errors:
federation:backendsis included in the response: [...]federation:backendsis not included in the response: [...]
But currently, the field is mandatory in a ValidationResult object:
openeo-js-client/src/typedefs.js
Lines 263 to 272 in d7ef9c4
| /** | |
| * An array, but enriched with additional details from an openEO API response. | |
| * | |
| * Adds the property `federation:backends`. | |
| * | |
| * @typedef ValidationResult | |
| * @augments Array | |
| * @type {Array.<ApiError>} | |
| * @property {Array.<string>} ["federation:backends"] The back-ends that support / do not support the process. | |
| */ |
To fix this, in analogy to e.g.
openeo-js-client/src/typedefs.js
Line 260 in d7ef9c4
| * @property {?Array.<Link>} links |
I'd change line 271 to:
@property {?Array.<string>} ["federation:backends"]and change the line I fixed in the commit linked above
openeo-js-client/src/connection.js
Line 736 in 109ac35
| errors['federation:backends'] = Array.isArray(response.data['federation:backends']) ? response.data['federation:backends'] : []; |
to:
if (Array.isArray(response.data['federation:backends']) && response.data['federation:backends'].length > 0) {
errors['federation:backends'] = response.data['federation:backends'];
}okay? @m-mohr