You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Opening this new issue, hope this is the correct place.
I'm trying to recreate something similar to the example in @blairj09 talk at RStudio::conf2019 earlier this year, where the expected request Schema is returned in the Swagger interface, his example is here:
Based on this example, I would like to specify the expected JSON format for incoming requests. The above entrypoint.R file generates a section in the Swagger Interface under the Example Value | Schema that looks like this:
{
"cyl": 0,
"hp": 0
}
However I would like the example/scheme to actually run and need to specify an array of data, i.e. multiple rows in the array, which can be easily converted to a data.frame downstream. The Schema must look like this, with [ and ]:
[
{
"cyl": 0,
"hp": 0
}
]
... or even better (with actual values for 2 rows):
Is there a way in the entrypoint.R file to specify the square brackets? I have noticed that it is possible to add actual values to the Swagger interface example by specifying an example entry rather than a properties entry in the schema section of the call. Though I am still unable to figure out how to add [] to the example.
Some examples and/or documentation about what the options are in specifying the JSON scheme via the entrypoint.R file would be very helpful (it seems others also think so). If I've missed something obvious please let me know. Thank you!
The text was updated successfully, but these errors were encountered:
Hi @schloerke,
Opening this new issue, hope this is the correct place.
I'm trying to recreate something similar to the example in @blairj09 talk at RStudio::conf2019 earlier this year, where the expected request Schema is returned in the Swagger interface, his example is here:
https://github.com/sol-eng/plumber-model/blob/master/R/model-api/entrypoint.R
Based on this example, I would like to specify the expected JSON format for incoming requests. The above
entrypoint.R
file generates a section in the Swagger Interface under the Example Value | Schema that looks like this:However I would like the example/scheme to actually run and need to specify an array of data, i.e. multiple rows in the array, which can be easily converted to a
data.frame
downstream. The Schema must look like this, with[
and]
:... or even better (with actual values for 2 rows):
Is there a way in the
entrypoint.R
file to specify the square brackets? I have noticed that it is possible to add actual values to the Swagger interface example by specifying anexample
entry rather than aproperties
entry in theschema
section of the call. Though I am still unable to figure out how to add[
]
to the example.Some examples and/or documentation about what the options are in specifying the JSON scheme via the
entrypoint.R
file would be very helpful (it seems others also think so). If I've missed something obvious please let me know. Thank you!The text was updated successfully, but these errors were encountered: