-
Notifications
You must be signed in to change notification settings - Fork 11
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
Extensions are not required on catalogs #127
Extensions are not required on catalogs #127
Conversation
Everywhere else we ask for extensions, we decode them as an optional list of strings, so this one was just an oversight 🤷♂️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment that I don't feel strongly about, but wanted to make sure I understood the effects of this change.
@@ -58,7 +58,7 @@ object StacCatalog { | |||
) => | |||
StacCatalog.apply( | |||
version, | |||
extensions, | |||
extensions getOrElse Nil, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This limits the set of changes here to only the encoders/decoders - which is nice because it reduces the downstream dependencies. But one thing that I think happens as a result is if stac4s
reads a catalog without stac_extensions
it will always write the same object with an empty list.
Should we change the encoder to behave the same as the decoder so it's consistent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so, but I also don't think that fields should be both optional and possibly empty lists 🤷♂️.
I can't think of a way that encoding an empty list will hurt anything. It might be annoying if you keep firing PATCHes at Franklin and despite your best efforts you just can't get rid of the stac_extensions
field. I don't know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I agree - I wish it was just an empty list too. The approach here makes sense to me.
Overview
This PR makes
stac_extensions
optional when decoding catalogs.Checklist
Testing Instructions
stac_extensions
when decoding, we ask for anOption[List[String]]
instead of aList[String]
Closes #121