Closed nmdefries closed 9 months ago
If endpoint metadata is missing the spec for a field that is actually returned, a warning is triggered. That field is returned as the type provided in the response JSON (maybe plus some auto-typing from data.frame
/tibble
conversions).
We attempt to apply every metadata field spec to the response; non-specified fields aren't handled at all. When no metadata is provided, the response is returned as-is. (Maybe this case should have a warning too?)
If the response is missing a field that the endpoint metadata provides the spec for, nothing happens -- it's silently ignored (since the code loops over metadata field specs rather than over columns in the response df). We ignore this case because users can request a subset of fields to be fetched via fetch_args_list
. That would cause a lot of spurious warnings.
Add missing field specs for endpoints. I could only manually check field specs for private endpoints against the corresponding server code, so it's possible those have additional missing field specs. If so, a call to those endpoints will issue a warning listing the missing fields.
Parse
release_date
fields as hyphen-separated dates, rather than as text. To do so, I used a list of date formats (YYYYMMDD and YYYY-MM-DD) fortryFormats
inas.Date
. This has slightly different behavior than using theformat
arg:as.Date
raises an error.as.Date
only tried one format and would returnNA
if the observed format didn't match it.