Open-EO / openeo-api

The openEO API specification
http://api.openeo.org
Apache License 2.0
91 stars 11 forks source link

/me: default_plan confusion #425

Closed soxofaan closed 2 years ago

soxofaan commented 2 years ago

https://github.com/Open-EO/openeo-api/blob/f303d65a3291d4cd74dacc0e796803bb5d6fa03b/openapi.yaml#L3431-L3441

Name of the plan the user has subscribed to.

Field is called "default_plan" but description says "name of the plan the user has subscribed to, so field should be called "plan" instead of the fallback-sounding "default_plan" ?

Overrides the default plan of the back-end, but back-ends MAY also allow overriding this plan for each individual processing request (e.g. job or service) with the corresponding plan property.

I think this paragraph makes it even more confusing. A default that overrides another default: what's the point of the latter default then? And it also suggests that a user can work with multiple plans, so there should be a listing of this under /me as well I guess?

m-mohr commented 2 years ago

Here's how a back-end should resolve it:

  1. If provided, use the plan from the job/web service.
  2. If available, use the default_plan for the user.
  3. Otherwise, use the default_plan of the back-end.

The API can't know what "model" a back-end uses for billing (e.g. whether there's a user default) so it is flexible here (and point two was only added in v1.1 so point 3 is a bit of a legacy thing).

I can try to clarify this in the descriptions.

m-mohr commented 2 years ago

Field is called "default_plan" but description says "name of the plan the user has subscribed to, so field should be called "plan" instead of the fallback-sounding "default_plan" ?

Naming is probably not ideal, but we can't change it anymore so I'll try to improve the situation through documentation, see PR #428. The PR should also tackle the other issue raised.