Skip to content
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

Error in brapi_post_variables when giving only one contextOfUse #5

Open
aliceboizet opened this issue Feb 16, 2023 · 0 comments
Open

Comments

@aliceboizet
Copy link

I tried adding a new variable with this function :
v <- brapirv2::brapi_post_variables( con, contextOfUse = c("MEANS"), method = list(methodDbId = methodDbId), observationVariableName = observationVariableName, trait = list(traitDbId = traitDbId) )

I got an error 400 because the body sent to the BrAPI server wasn't in the right format, with
"contextOfUse": "MEANS" instead of "contextOfUse": ["MEANS"]

It works fine if "contextOfUse" contains more than one element.
I managed to fix this by adding the pattern "contextOfUse" in line 29 of brapi_POST_callBody function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant