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

Return string instead of array #21

Open
stefvanbuuren opened this issue Oct 23, 2023 · 2 comments
Open

Return string instead of array #21

stefvanbuuren opened this issue Oct 23, 2023 · 2 comments

Comments

@stefvanbuuren
Copy link
Member

request_blend() should return a JSON string for the fields txt, session and site. That would make it conform to the swagger documentation.

@stefvanbuuren
Copy link
Member Author

txt is still an array. unbox() does not seem to work.

@stefvanbuuren
Copy link
Member Author

By default, OpenCPU calls return arrays of length 1 instead of strings. It is possible to suppress this behaviour by adding the query parameter auto_unbox=true.

$ curl http://james.groeidiagrammen.nl/version/json -d ''
{
  "package": ["james"],
  "packageVersion": ["1.6.4"],
  "packageDate": ["2024-05-12"],
  "Rversion": ["4.4.0"]
}
$ curl http://james.groeidiagrammen.nl/version/json?auto_unbox=true -d ''
{
  "package": "james",
  "packageVersion": "1.6.4",
  "packageDate": "2024-05-12",
  "Rversion": "4.4.0"
}

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