Skip to content

Commit 29c1eec

Browse files
authored
Use Formatter to default IMF references
2 parents 5ab0e33 + cbf250b commit 29c1eec

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

R/SDMXServiceProvider-methods.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,10 @@ setSDMXServiceProviders <- function(){ # nocov start
168168
builder = SDMXREST21RequestBuilder(
169169
regUrl = "https://api.imf.org/external/sdmx/2.1",
170170
repoUrl = "https://api.imf.org/external/sdmx/2.1",
171-
compliant = TRUE)
171+
compliant = TRUE,
172+
formatter$datastructure = function(obj){
173+
if(is.null(obj@references)) obj@references = "descendants"
174+
return(obj)})
172175
)
173176

174177
#OECD

R/readSDMX.R

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,6 @@ readSDMX <- function(file = NULL, isURL = TRUE, isRData = FALSE,
208208
references = references,
209209
compliant = provider@builder@compliant
210210
)
211-
212-
#allow IMF requests to use descendants instead of children
213-
if(providerId == "IMF_DATA"){
214-
if(is.null(references)){
215-
requestParams@references <- "descendants"
216-
}
217-
}
218211

219212
#formatting requestParams
220213
requestFormatter <- provider@builder@formatter

0 commit comments

Comments
 (0)