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

[Schema Inaccuracy] minimal-repository.license.url may be null #4310

Open
chohner opened this issue Nov 22, 2024 · 3 comments
Open

[Schema Inaccuracy] minimal-repository.license.url may be null #4310

chohner opened this issue Nov 22, 2024 · 3 comments

Comments

@chohner
Copy link

chohner commented Nov 22, 2024

Schema Inaccuracy

While using ajv to validate against the provided JSON Schema, I have found one repository where the url field of license is null - the JSON schema however insists on string.

Expected

I expect the data to match the provided schema, so either update minimal-repository.properties.license.properties.url to be type: ["string", "null"] or update the response to return "" on missing license URL.

Reproduction Steps

$ curl https://api.github.com/repos/digitalservicebund/AusweisApp2Wrapper-iOS-SPM

(...)
    "license": {
      "key": "other",
      "name": "Other",
      "spdx_id": "NOASSERTION",
      "url": null,
      "node_id": "MDc6TGljZW5zZTA="
    },
(...)
@chohner chohner changed the title [Schema Inaccuracy] license.url may be null [Schema Inaccuracy] minimal-repository.license.url may be null Nov 22, 2024
@MORTEZAMIRSALI
Copy link

MORTEZAMIRSALI commented Nov 22, 2024 via email

@jchuerva
Copy link

👋 Hi,

The API doc mention the license url field can be null:

Image

@chohner
Copy link
Author

chohner commented Nov 28, 2024

The image seems to be broken but I assume you are referring to the schema from GET /repos/{owner}/{repo}.

The schema referenced there is the full-respository schema, which indeed includes the correct sub-schema for license (with a nullable url field):

"license": {
  "anyOf": [
    {
      "type": "null"
    },
    {
      "title": "License Simple",
      "description": "License Simple",
      "type": "object",
      "properties": {
        (...)
        "url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "examples": [
            "https://api.github.com/licenses/mit"
          ]
        },
        (...)
      }
    }
  ]
}

The minimal-repository schema as returned by GET /orgs/{org}/repos does not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants