Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal server error when definition in extension cannot be dereferenced #66

Closed
duncandewhurst opened this issue Jun 29, 2020 · 5 comments
Labels
bug Something isn't working extensions Relating to patching schema and codelists with extensions

Comments

@duncandewhurst
Copy link

Example

The issue is that there is a typo in the extension's release-schema.json which means a definition cannot be dereferenced.

Can this information be passed back to the user in the form of an error message? e.g.

Could not dereference #/definitions/AddressDetails in Address Details extension

@duncandewhurst
Copy link
Author

@ghost
Copy link

ghost commented Aug 4, 2020

@robredpath
Copy link
Contributor

eOCDS-Extensions/eOCDS-addressDetails@7499eb4 is the commit where the typo gets fixed

@rhiaro
Copy link
Contributor

rhiaro commented Aug 27, 2020

@robredpath robredpath transferred this issue from OpenDataServices/cove Oct 14, 2020
@robredpath robredpath transferred this issue from another repository Oct 14, 2020
@jpmckinney jpmckinney changed the title OCDS: Internal server error when definition in extension cannot be dereferenced Internal server error when definition in extension cannot be dereferenced Oct 14, 2020
@jpmckinney jpmckinney transferred this issue from open-contracting/cove-ocds Oct 14, 2020
@jpmckinney jpmckinney added bug Something isn't working extensions Relating to patching schema and codelists with extensions labels Oct 14, 2020
@jpmckinney
Copy link
Member

jpmckinney commented Jul 7, 2023

Can reproduce:

{
  "version": "1.1",
  "extensions": [
    "https://gist.githubusercontent.com/jpmckinney/7376110b73c6313507d50a628f2e6f88/raw/9ef2b515c7f8915477e88128d4a38755cabb48c1/extension.json"
  ],
  "publishedDate": "2000-01-01T00:00:00Z",
  "publisher": {
    "name": "Acme Inc."
  },
  "uri": "https://example.com",
  "releases": [
    {
      "ocid": "ocds-1234567",
      "id": "ocds-1234567-1",
      "date": "2000-01-01T00:00:00Z",
      "tag": ["tender"],
      "initiationType": "tender",
      "unresolvable": "1"
    }
  ]
}

RefResolutionError: Unresolvable JSON pointer: 'definitions/Unresolvable'

The error is raised at different points, depending on whether the "unresolvable" field is included. If it is included, it's raised by jsonschema:

Internal Server Error
Something went wrong with your request. This could be due to a bug in the application and/or the data you supplied.

If it's not, it's raised by deref_schema, which catches jsonref.JsonRefError and sets json_deref_error (noting that this can make some logic errors hard to discover, since deref_schema can be called indirectly):

JSON reference error
We have detected a JSON reference error in the schema. This may be due to some extension trying to resolve non-existing references.
Error message: Unresolvable JSON pointer: '/definitions/Unresolvable'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working extensions Relating to patching schema and codelists with extensions
Projects
None yet
Development

No branches or pull requests

4 participants