BioContainers / biocontainers-backend

Python backend for Biocontainers (Flask + MongoDB)
http://biocontainers.pro
Apache License 2.0
3 stars 1 forks source link

The GA4GH validator runs in multiple errors with our implementation #16

Closed ypriverol closed 5 years ago

ypriverol commented 5 years ago

@chakrabandla I have run validator http://142.1.177.188:8080/trs/validator/debug?url=http://api.biocontainers.pro/api/ga4gh/v2/ and it gives me some errors that we need to fix in our api.

fail: GET (200) /api/ga4gh/v2/metadata duration: 427ms
fail: GET (200) /api/ga4gh/v2/toolClasses duration: 337ms
fail: GET (200) /api/ga4gh/v2/tools?limit=30 duration: 376ms
skip: GET (200) /api/ga4gh/v2/tools/id_placeholder
skip: GET (404) /api/ga4gh/v2/tools/id_placeholder
skip: GET (200) /api/ga4gh/v2/tools/id_placeholder/versions
skip: GET (200) /api/ga4gh/v2/tools/id_placeholder/versions/version_id_placeholder
skip: GET (404) /api/ga4gh/v2/tools/id_placeholder/versions/version_id_placeholder
skip: GET (200) /api/ga4gh/v2/tools/id_placeholder/versions/version_id_placeholder/containerfile
skip: GET (404) /api/ga4gh/v2/tools/id_placeholder/versions/version_id_placeholder/containerfile
skip: GET (200) /api/ga4gh/v2/tools/id_placeholder/versions/version_id_placeholder/type_placeholder/descriptor
skip: GET (404) /api/ga4gh/v2/tools/id_placeholder/versions/version_id_placeholder/type_placeholder/descriptor
skip: GET (200) /api/ga4gh/v2/tools/id_placeholder/versions/version_id_placeholder/type_placeholder/descriptor/relative_path_placeholder
skip: GET (404) /api/ga4gh/v2/tools/id_placeholder/versions/version_id_placeholder/type_placeholder/descriptor/relative_path_placeholder
skip: GET (200) /api/ga4gh/v2/tools/id_placeholder/versions/version_id_placeholder/type_placeholder/files
skip: GET (404) /api/ga4gh/v2/tools/id_placeholder/versions/version_id_placeholder/type_placeholder/files
skip: GET (200) /api/ga4gh/v2/tools/id_placeholder/versions/version_id_placeholder/type_placeholder/tests
skip: GET (404) /api/ga4gh/v2/tools/id_placeholder/versions/version_id_placeholder/type_placeholder/tests
info: Displaying failed tests...
fail: GET (200) /api/ga4gh/v2/metadata duration: 427ms
fail: headers: Header 'content-type' has value 'application/problem+json' instead of 'application/json'
body: At '/version' Missing required property: version
body: At '/api_version' Missing required property: api_version
statusCode: Status code is '404' instead of '200'

request: 
body: 

headers: 
    Accept: application/json
    User-Agent: Dredd/8.0.3 (Linux 4.4.0-141-generic; x64)

method: GET
uri: /api/ga4gh/v2/metadata

expected: 
body: 
{
  "version": "ut incididunt culpa",
  "api_version": "incididunt commodo tempor",
  "country": "enim ex fugiat eu",
  "friendly_name": "do est"
}
headers: 
    Content-Type: application/json

statusCode: 200
bodySchema: {"description":"Describes this registry to better allow for mirroring and indexing.","properties":{"api_version":{"description":"The version of the GA4GH tool-registry API supported by this registry","type":"string"},"country":{"description":"A country code for the registry (ISO 3166-1 alpha-3)","type":"string"},"friendly_name":{"description":"A friendly name that can be used in addition to the hostname to describe a registry","type":"string"},"version":{"description":"The version of this registry","type":"string"}},"required":["version","api_version"],"type":"object"}

actual: 
body: 
{
  "detail": "The requested URL was not found on the server.  If you entered the URL manually please check your spelling and try again.",
  "status": 404,
  "title": "Not Found",
  "type": "about:blank"
}
headers: 
    content-length: 206
    access-control-expose-headers: next_page, last_page, self_link, current_offset, current_limit
    set-cookie: __cfduid=d2e93ea23bcbe442c999f34c19b4c06331551779035; expires=Wed, 04-Mar-20 09:43:55 GMT; path=/; domain=.biocontainers.pro; HttpOnly
    server: cloudflare
    connection: close
    date: Tue, 05 Mar 2019 09:43:55 GMT
    access-control-allow-origin: *
    content-type: application/problem+json
    cf-ray: 4b2b25fb680a27e0-YYZ

statusCode: 404
bodyEncoding: utf-8

fail: GET (200) /api/ga4gh/v2/toolClasses duration: 337ms
fail: headers: Header 'content-type' has value 'application/problem+json' instead of 'application/json'
body: At '' Invalid type: object (expected array)
statusCode: Status code is '404' instead of '200'

request: 
body: 

headers: 
    Accept: application/json
    User-Agent: Dredd/8.0.3 (Linux 4.4.0-141-generic; x64)

method: GET
uri: /api/ga4gh/v2/toolClasses

expected: 
body: 
[
  {
    "description": "ullamco",
    "id": "m",
    "name": "laboris aliquip nulla proident"
  }
]
headers: 
    Content-Type: application/json

statusCode: 200
bodySchema: {"items":{"$ref":"#/definitions/ToolClass"},"type":"array","definitions":{"ToolClass":{"description":"Describes a class (type) of tool allowing us to categorize workflows, tasks, and maybe even other entities (such as services) separately","properties":{"description":{"description":"A longer explanation of what this class is and what it can accomplish","type":"string"},"id":{"description":"The unique identifier for the class","type":"string"},"name":{"description":"A short friendly name for the class","type":"string"}},"type":"object"}}}

actual: 
body: 
{
  "detail": "The requested URL was not found on the server.  If you entered the URL manually please check your spelling and try again.",
  "status": 404,
  "title": "Not Found",
  "type": "about:blank"
}
headers: 
    content-length: 206
    access-control-expose-headers: next_page, last_page, self_link, current_offset, current_limit
    set-cookie: __cfduid=da8bcd84a543dfced7f337202252e46391551779035; expires=Wed, 04-Mar-20 09:43:55 GMT; path=/; domain=.biocontainers.pro; HttpOnly
    server: cloudflare
    connection: close
    date: Tue, 05 Mar 2019 09:43:56 GMT
    access-control-allow-origin: *
    content-type: application/problem+json
    cf-ray: 4b2b25fe3f76ca96-YYZ

statusCode: 404
bodyEncoding: utf-8

fail: GET (200) /api/ga4gh/v2/tools?limit=30 duration: 376ms
fail: headers: Header 'self_link' is missing
headers: Header 'current_limit' is missing
headers: Header 'last_page' is missing
headers: Header 'content-type' has value 'application/problem+json' instead of 'application/json'
body: At '' Invalid type: object (expected array)
statusCode: Status code is '404' instead of '200'

request: 
body: 

headers: 
    Accept: application/json
    User-Agent: Dredd/8.0.3 (Linux 4.4.0-141-generic; x64)

method: GET
uri: /api/ga4gh/v2/tools?limit=30

expected: 
body: 
[
  {
    "url": "ad reprehenderit proident cillum amet",
    "id": "velit deserunt do elit",
    "organization": "ex occaecat aliquip labore officia",
    "author": "exercitation Lorem ut in",
    "toolclass": {
      "description": "incididunt sunt",
      "id": "Ut commodo ex eiusmod Duis",
      "name": "Lorem E"
    },
    "versions": [],
    "aliases": [],
    "checker_url": "ut incididunt veniam proident",
    "contains": [],
    "description": "amet eiusmod ex velit i",
    "has_checker": false,
    "meta_version": "non occaecat cupidatat ad",
    "signed": true,
    "toolname": "laborum in cupidatat cillum",
    "verified": false,
    "verified_source": "ipsum officia "
  }
]
headers: 
    self_link: 
    current_limit: 
    last_page: 
    Content-Type: application/json

statusCode: 200
bodySchema: {"items":{"$ref":"#/definitions/Tool"},"type":"array","definitions":{"Tool":{"description":"A tool (or described tool) is defined as a tuple of a descriptor file (which potentially consists of multiple files), a set of container images, and a set of instructions for creating those images.","properties":{"aliases":{"description":"OPTIONAL\nA list of strings that can be used to identify this tool.\nThis can be used to expose alternative ids (such as GUIDs) for a tool\nfor registries. Can be used to match tools across registries.","items":{"type":"string"},"type":"array"},"author":{"description":"Contact information for the author of this tool entry in the registry. (More complex authorship information is handled by the descriptor)","type":"string"},"checker_url":{"description":"Optional url to the checker tool that will exit successfully if this tool produced the expected result given test data.","type":"string"},"contains":{"description":"An array of IDs for the applications that are stored inside this tool","items":{"type":"string"},"type":"array"},"description":{"description":"The description of the tool.","type":"string"},"has_checker":{"description":"Whether this tool has a checker tool associated with it","type":"boolean"},"id":{"description":"A unique identifier of the tool, scoped to this registry","type":"string"},"meta_version":{"description":"The version of this tool in the registry. Iterates when fields like the description, author, etc. are updated.","type":"string"},"organization":{"description":"The organization that published the image.","type":"string"},"signed":{"description":"Reports whether this tool has been signed.","type":"boolean"},"toolclass":{"$ref":"#/definitions/ToolClass"},"toolname":{"description":"The name of the tool.","type":"string"},"url":{"description":"The URL for this tool in this registry","type":"string"},"verified":{"description":"Reports whether this tool has been verified by a specific organization or individual","type":"boolean"},"verified_source":{"description":"Source of metadata that can support a verified tool, such as an email or URL","type":"string"},"versions":{"description":"A list of versions for this tool","items":{"$ref":"#/definitions/ToolVersion"},"type":"array"}},"required":["url","id","organization","author","toolclass","versions"],"type":"object"},"ToolVersion":{"description":"A tool version describes a particular iteration of a tool as described by a reference to a specific image and/or documents.","properties":{"containerfile":{"description":"Reports if this tool has a containerfile available.","type":"boolean"},"descriptor_type":{"description":"The type (or types) of descriptors available.","items":{"$ref":"#/definitions/DescriptorType"},"type":"array"},"id":{"description":"An identifier of the version of this tool for this particular tool registry","type":"string"},"image":{"description":"The docker path to the image (and version) for this tool","type":"string"},"image_name":{"description":"Used in conjunction with a registry_url if provided to locate images","type":"string"},"meta_version":{"description":"The version of this tool version in the registry. Iterates when fields like the description, author, etc. are updated.","type":"string"},"name":{"description":"The name of the version.","type":"string"},"registry_url":{"description":"A URL to a Singularity registry is provided when a specific type of image does not use ids in the Docker format. Used along with image_name to locate a specific image.","type":"string"},"url":{"description":"The URL for this tool in this registry","type":"string"},"verified":{"description":"Reports whether this tool has been verified by a specific organization or individual","type":"boolean"},"verified_source":{"description":"Source of metadata that can support a verified tool, such as an email or URL","type":"string"}},"required":["url","id"],"type":"object"},"DescriptorType":{"description":"The type of descriptor that represents this version of the tool (e.g. CWL, WDL, or NFL). Note that these files can also include associated Docker/container files  and test parameters that further describe a version of a tool","enum":["CWL","WDL","NFL"],"type":"string"},"ToolClass":{"description":"Describes a class (type) of tool allowing us to categorize workflows, tasks, and maybe even other entities (such as services) separately","properties":{"description":{"description":"A longer explanation of what this class is and what it can accomplish","type":"string"},"id":{"description":"The unique identifier for the class","type":"string"},"name":{"description":"A short friendly name for the class","type":"string"}},"type":"object"}}}

actual: 
body: 
{
  "detail": "The requested URL was not found on the server.  If you entered the URL manually please check your spelling and try again.",
  "status": 404,
  "title": "Not Found",
  "type": "about:blank"
}
headers: 
    content-length: 206
    access-control-expose-headers: next_page, last_page, self_link, current_offset, current_limit
    set-cookie: __cfduid=dded80beacdce78c08d3db4a532dad6981551779036; expires=Wed, 04-Mar-20 09:43:56 GMT; path=/; domain=.biocontainers.pro; HttpOnly
    server: cloudflare
    connection: close
    date: Tue, 05 Mar 2019 09:43:56 GMT
    access-control-allow-origin: *
    content-type: application/problem+json
    cf-ray: 4b2b260088f23036-YYZ

statusCode: 404
bodyEncoding: utf-8

complete: 0 passing, 3 failing, 0 errors, 15 skipped, 18 total
complete: Tests took 3151ms
chakrabandla commented 5 years ago

@ypriverol trying with below url works well (i.e., exclude /api/ga4gh/v2/ from url param) http://142.1.177.188:8080/trs/validator/debug?url=http://api.biocontainers.pro

ypriverol commented 5 years ago

Thanks a lot. I will add this to the README.