Skip to content

Cannot download schema using check-jsonschema #421

Open

Description

Hi

The following is not working
check-jsonschema --schemafile 'https://www.bluetooth.com/specifications/specs/mesh-cdb-1-0-1-schema.json#' example.json Error: Unexpected Error building schema validator FailedDownloadError: got responses with status=403, retries exhausted

While the following is working (notice -L in curl):
curl -L 'https://www.bluetooth.com/specifications/specs/mesh-cdb-1-0-1-schema.json#' | check-jsonschema --schemafile - example.json

The platform is Windows 11, running "GIT bash" terminal.

Activity

  1. sirosen commented on Apr 29, 2024

    @sirosen
    Member

    Thanks for reporting this; I haven't had a chance to look into it in any serious way yet.

    I'm not sure what's going on over at bluetooth.com, but they are serving up a 403 to GET requests made in python requests or urllib, but not to curl. This is almost definitely an issue over at the schema-provider's side, but I'm willing to poke at it a bit and see if I can do anything about it. Most likely, we need to find a point of contact for www.bluetooth.com to ask about this.

  2. sirosen commented on Apr 29, 2024

    @sirosen
    Member

    I sent a request to their support form (which was awkward and not really an issue tracker) for now, but don't expect to hear much back.

    I was able to confirm, in the course of writing up details for the upstream maintainers, that setting a dumb User-Agent like "" makes the error disappear.
    I'm not eager to bulk up the CLI with an option for this, but perhaps an env var to control the user agent would be appropriate. I'll have to chew on the best way to expose this to users if (as I expect) there's no response or a bad response upstream.

  3. piotrwiniarczyk-silvair commented on Apr 30, 2024

    @piotrwiniarczyk-silvair
    Author

    Thanks for writing the bug report for the Bluetooth.com. I will also try to contact them.

    The whole point with schema files is that they must be easily accessible via any http(s) client, even a very restricted one.

    Per rfc723, section-5.5.3:
    A user agent SHOULD send a User-Agent field in each request unless specifically configured not to do so.

    Since it is "SHOULD" (RFC2119 ) this header field is recommended but not mandatory.

    3. SHOULD   This word, or the adjective "RECOMMENDED", mean that there
       may exist valid reasons in particular circumstances to ignore a
       particular item, but the full implications must be understood and
       carefully weighed before choosing a different course. 
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions