vivo-project / VIVO

VIVO is an extensible semantic web application for research discovery and showcasing scholarly work
http://vivoweb.org
BSD 3-Clause "New" or "Revised" License
202 stars 127 forks source link

Json validation schema doesn't support json arrays and json object parameters #3899

Closed litvinovg closed 6 months ago

litvinovg commented 1 year ago

Describe the bug Json arrays and objects validation fails as json validation schema is broken.

To Reproduce Steps to reproduce the behavior:

  1. Log in as root
  2. Go to /dynapi-rest-docs
  3. Use POST report generator endpoint (to create new generator) with following json { "template": "string", "select_queries": [{ "name": "projectFunding", "description": "description select query placeholder", "selectQuery": "Select distinct (MIN(?projectLabel) AS ?projectTitle) ?funderLabel ?projectTime ?totalAwardAmount", "graph": "constructQuery1" }], "construct_queries": [{ "name": "constructQuery1", "description": "construct query description placeholder", "constructQuery": "Construct {\\n ?project a <http://vivoweb.org/ontology/core#Grant>" }], "report_generator_description": "string", "report_generator_name": "string" }
  4. 500 Error will appear ERROR [Endpoint] edu.cornell.mannlib.vitro.webapp.dynapi.data.conversion.ConversionException: Json validation failed: $.select_queries: array found, object expected $.construct_queries: array found, object expected