Skip to content

Commit

Permalink
Merge pull request #617 from Sage-Bionetworks/FDS-2459-filename-valid…
Browse files Browse the repository at this point in the history
…ation

Fds 2459 filename validation
  • Loading branch information
afwillia authored Oct 2, 2024
2 parents 5230938 + c357889 commit f838c9a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
9 changes: 6 additions & 3 deletions R/schematic_rest_api.R
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ manifest_validate <- function(url="http://localhost:3001/v1/model/validate",
access_token,
asset_view = NULL,
json_str = NULL,
data_model_labels = "class_label") {
data_model_labels = "class_label",
dataset_scope = NULL) {

flattenbody <- function(x) {
# A form/query can only have one value per name, so take
Expand Down Expand Up @@ -175,7 +176,8 @@ manifest_validate <- function(url="http://localhost:3001/v1/model/validate",
restrict_rules=restrict_rules,
project_scope = project_scope,
data_model_labels = data_model_labels,
asset_view = asset_view
asset_view = asset_view,
dataset_scope = dataset_scope
) |>
httr2::req_body_multipart(file_name=curl::form_file(file_name)) |>
httr2::req_perform()
Expand All @@ -191,7 +193,8 @@ manifest_validate <- function(url="http://localhost:3001/v1/model/validate",
project_scope = project_scope,
asset_view = asset_view,
data_model_labels = data_model_labels,
json_str = json_str
json_str = json_str,
dataset_scope = dataset_scope
) |>
#httr2::req_retry(
# max_tries = 3,
Expand Down
9 changes: 6 additions & 3 deletions functions/schematic_rest_api.R
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ manifest_validate <- function(url="http://localhost:3001/v1/model/validate",
access_token,
asset_view = NULL,
json_str = NULL,
data_model_labels = "class_label") {
data_model_labels = "class_label",
dataset_scope = NULL) {

flattenbody <- function(x) {
# A form/query can only have one value per name, so take
Expand Down Expand Up @@ -175,7 +176,8 @@ manifest_validate <- function(url="http://localhost:3001/v1/model/validate",
restrict_rules=restrict_rules,
project_scope = project_scope,
data_model_labels = data_model_labels,
asset_view = asset_view
asset_view = asset_view,
dataset_scope = dataset_scope
) |>
httr2::req_body_multipart(file_name=curl::form_file(file_name)) |>
httr2::req_perform()
Expand All @@ -191,7 +193,8 @@ manifest_validate <- function(url="http://localhost:3001/v1/model/validate",
project_scope = project_scope,
asset_view = asset_view,
data_model_labels = data_model_labels,
json_str = json_str
json_str = json_str,
dataset_scope = dataset_scope
) |>
#httr2::req_retry(
# max_tries = 3,
Expand Down
4 changes: 3 additions & 1 deletion server.R
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,7 @@ shinyServer(function(input, output, session) {
.dd_template <- input$dropdown_template
.restrict_rules <- dcc_config_react()$schematic$model_validate$restrict_rules
.project_scope <- NULL
.dataset_scope <- selected$folder()
.access_token <- access_token
.data_model_labels <- dcc_config_react()$schematic$global$data_model_labels
# asset view must be NULL to avoid cross-manifest validation.
Expand Down Expand Up @@ -834,7 +835,8 @@ shinyServer(function(input, output, session) {
project_scope = .project_scope,
access_token = .access_token,
data_model_labels = .data_model_labels,
asset_view = .asset_view
asset_view = .asset_view,
dataset_scope = .dataset_scope
),
{
list(list(
Expand Down

0 comments on commit f838c9a

Please sign in to comment.