Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No requirements for GET /service_types #318

Closed
soxofaan opened this issue Jul 14, 2020 · 8 comments · Fixed by #322
Closed

No requirements for GET /service_types #318

soxofaan opened this issue Jul 14, 2020 · 8 comments · Fixed by #322

Comments

@soxofaan
Copy link
Member

The service entries in GET /service_types currently have no required fields: each of configuration, process_parameters and links is allowed to be missing.

This caused the validator to accept the 0.4-style version of this endpoint in the 1.0-version of the VITO backend, e.g. currently at http://openeo.vgt.vito.be/openeo/1.0/service_types:

{
    "WMTS": {
        "attributes": [],
        "parameters": {
            "colormap": {
                "default": "YlGn",
                "description": "The colormap to use.",
                "type": "a colormap to apply to single band layers"
            },
            "version": {
                "default": "1.0.0",
                "description": "The WMTS version to use.",
                "enum": [  "1.0.0"  ],
                "type": "string"
            }
        }
    }
}

Note these errors (that the validator didn't catch):

  • 0.4-style fields attributes and parameters
  • invalid "type": "a colormap to apply to single band layers"

Can this be avoided in some way?
For example require that process_parameters is present with at least and empty array?

@soxofaan
Copy link
Member Author

cc @bgoesswe

@m-mohr
Copy link
Member

m-mohr commented Jul 14, 2020

Due to the "extensibility" of JSON, it's hard to avoid.

I'd actually like to require configuration and process_parameters as it hopefully makes the back-end think what it needs to set ;-) and it's more explicit. Not sure whether we should introduce the breaking change in the release week though with just the reason to help the validator.

It doesn't catch the invalid type as it's in an "undefined" structure, but it would be caught if it's in process_parameters.

@m-mohr
Copy link
Member

m-mohr commented Jul 14, 2020

What I guess would be useful to have in the validator, that it reports "undefined" properties as warnings or so. @bgoesswe

@soxofaan
Copy link
Member Author

Not sure whether we should introduce the breaking change in the release week though with just the reason to help the validator.

according to the openeo hub the support for secondary services is pretty thin (and so I assume practically unused), so I don't think a lot would break actually. But indeed it's already late to do these kind of things

@m-mohr
Copy link
Member

m-mohr commented Jul 14, 2020

Indeed, just VITO and GEE. I'm fine with it and if VITO is fine with it, too. It really is not very useful to have nothing required at all.

@bgoesswe
Copy link
Member

What I guess would be useful to have in the validator, that it reports "undefined" properties as warnings or so. @bgoesswe

Yep that seems like a good idea, I added a new issue at the validator for that.

@soxofaan
Copy link
Member Author

if VITO is fine with it

yes, it's not being used in a real application or use case at the moment, so we're open for minor breaking changes

@m-mohr
Copy link
Member

m-mohr commented Jul 15, 2020

See PR #322.

m-mohr added a commit that referenced this issue Jul 16, 2020
* Require configuration for each service #318
* Made parameters required in file_formats and service_types #318
@m-mohr m-mohr linked a pull request Jul 16, 2020 that will close this issue
@m-mohr m-mohr closed this as completed Jul 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants