@@ -444,7 +444,7 @@ verify_attr_names <- function(p) {
444444verify_attr_spec <- function (p ) {
445445 if (! is.null(p $ x $ layout )) {
446446 p $ x $ layout <- verify_attr(
447- p $ x $ layout , Schema $ layout $ layoutAttributes
447+ p $ x $ layout , Schema $ layout $ layoutAttributes , layoutAttr = TRUE
448448 )
449449 }
450450 for (tr in seq_along(p $ x $ data )) {
@@ -459,7 +459,7 @@ verify_attr_spec <- function(p) {
459459 p
460460}
461461
462- verify_attr <- function (proposed , schema ) {
462+ verify_attr <- function (proposed , schema , layoutAttr = FALSE ) {
463463 for (attr in names(proposed )) {
464464 attrSchema <- schema [[attr ]] %|| % schema [[sub(" [0-9]+$" , " " , attr )]]
465465 # if schema is missing (i.e., this is an un-official attr), move along
@@ -489,7 +489,7 @@ verify_attr <- function(proposed, schema) {
489489
490490 # tag 'src-able' attributes (needed for api_create())
491491 isSrcAble <- ! is.null(schema [[paste0(attr , " src" )]]) && length(proposed [[attr ]]) > 1
492- if (isDataArray || isSrcAble ) {
492+ if (( isDataArray || isSrcAble ) && ! isTRUE( layoutAttr ) ) {
493493 proposed [[attr ]] <- structure(proposed [[attr ]], apiSrc = TRUE )
494494 }
495495
@@ -517,7 +517,7 @@ verify_attr <- function(proposed, schema) {
517517
518518 # do the same for "sub-attributes"
519519 if (identical(role , " object" ) && is.recursive(proposed [[attr ]])) {
520- proposed [[attr ]] <- verify_attr(proposed [[attr ]], schema [[attr ]])
520+ proposed [[attr ]] <- verify_attr(proposed [[attr ]], schema [[attr ]], layoutAttr = layoutAttr )
521521 }
522522 }
523523
0 commit comments