Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upChange default schemaLocation so it points at a URL #45
Conversation
|
Thanks much for this. A few things here: First, I think we should discuss whether we want to do it this way, or just stop putting anything in Relatedly, given the proposal that Second, I think (but may be mistaken!) that we have a bit bigger nuisance in fixing #44. Currently validation is always local, but because the test suite includes a bunch of documents that are not valid complete EML, but are instead only valid subsets (e.g. |
|
|
||
| # Helper string used below to factor out the host from the generation of | ||
| # schemaLocation values | ||
| eml_host <- "https://eml.ecoinformatics.org" |
cboettig
Jan 23, 2020
Member
This is fine, unless we feel it should be configurable as an option. But why make it a package global variable? It seems more natural to me to make eml_host an optional argument to the new eml_schema_location() function, with this as the default.
This is fine, unless we feel it should be configurable as an option. But why make it a package global variable? It seems more natural to me to make eml_host an optional argument to the new eml_schema_location() function, with this as the default.
amoeba
Jan 23, 2020
Author
Contributor
That's a better approach.
That's a better approach.
|
Hey @cboettig: I think I'm fine with either setting Considering the other two points you bring up, I can get onboard with not setting I'm happy to close this PR if we agree. |
|
You make a good case for setting it as being 'good practice' even though it's not required. I think we should set it by default then. Let's change the PR to
Does that make sense? Not sure if |
|
I wanna think through this a bit... The user-facing interface for setting So if it's not set, we automatically generate a value for them which would be a side-effect and should be overridable. Good so far. (Aside: Should it be overridable in This makes me want to add support for an |
|
Yup, good point! I agree the user way to set it should be in the list construction (or also in an argument to a dedicated constructor function, e.g. the proposed I guess the only trick is that it's a bit less obvious how to have a default value that the user can override with |
|
Hrm, at the risk of discussing this to death, what about
This could be exposed at the If you aren't a fan, I am happy to do |
|
@amoeba thanks, yeah, I like your proposal better, I think it's more intuitive than Also if you have a chance, maybe you want to take a whack at the validator code to remove any use of |
As per discussion in #45, this refactors the behavior of the schemaLocation argument in as_xml to provide an API for asking emld to automatically guess a helpful, web-resolvable schemaLocation value when a value isn't set on the document before serialization.
|
I refactored the schemaLocation argument as discussed above. Please take a look. I'll move on to looking at excising schemaLocation from validation logic. Edit: And will send a separate PR for that. |
|
thanks for this, current approach looks great! |
730f56e
into
ropensci:master
Closes #44
Couple of things to look at here:
eml_version.R?