Job result metadata is now converted in a couple of places, leading to difficult to understand/maintain code.
The solution is that batch jobs write correct STAC metadata immediately, which can be passed on without conversion.
To do this in a backwards compatible manner, we'll want to use the version of STAC metadata to determine if we are in the old or new case, and keep both code paths for now. (The new one should of course be drastically simpler.)
The very old code paths can probably be removed already (pre openeo 1.1.0?)
If we want nice classes for handling stac metadata in python, consider using pystac library.
Conversion may still be needed, but should be limited to bare essentials.
We can envision that we may need to return the same metadata in multiple stac versions at some point, but for now we can just go for latest version IMO.
Job result metadata is now converted in a couple of places, leading to difficult to understand/maintain code.
The solution is that batch jobs write correct STAC metadata immediately, which can be passed on without conversion.
To do this in a backwards compatible manner, we'll want to use the version of STAC metadata to determine if we are in the old or new case, and keep both code paths for now. (The new one should of course be drastically simpler.)
The very old code paths can probably be removed already (pre openeo 1.1.0?)
If we want nice classes for handling stac metadata in python, consider using pystac library.
Conversion may still be needed, but should be limited to bare essentials.
We can envision that we may need to return the same metadata in multiple stac versions at some point, but for now we can just go for latest version IMO.