Skip to content

doi prereserve_doi argument in deposit_new not respected #103

@collinschwantes

Description

@collinschwantes

Deposit is given doi even if prereserve_doi is set to FALSE. Deposits made into the sandbox cannot be previewed because the doi is malformed.

library(deposits)

dotenv::load_dot_env()

metadata <- list (
  title = "Please no DOI",
  description = "This is the abstract",
  creator = list (list (name = "A. Person", orcid = "https://orcid.org/0000-0002-0872-9950"), list (name = "B. Person", orcid = "https://orcid.org/0000-0002-9882-941X")),
  subject = list(name = "hello",name = "world"),
  format = "dataset",
  created = "2024-08-01",
  license = "cc-by"
)

cli_test <- depositsClient$new (
  service = "zenodo",
  sandbox = TRUE,
  metadata = metadata
)

print(cli_test)

cli_test$metadata

cli_test$deposit_new(prereserve_doi = FALSE)

dir.create("data/beaver")

beaver1 |>
  write.csv(file = "data/beaver/beaver.csv")

cli_test$deposit_add_resource(path = "data/beaver")

cli_test$deposit_upload_file(path = "data/beaver")

When trying to preview the record in the sandbox I get:

Record saved with validation errors:
DOI: Wrong DOI 10.5281 prefix provided, it should be 10.5072 as defined in the rest client

Note that the doi prefix is correct for production zenodo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions