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

Schemas validation fails when expected to pass #97

Open
richard-stokes-tfs opened this issue Aug 14, 2024 · 0 comments
Open

Schemas validation fails when expected to pass #97

richard-stokes-tfs opened this issue Aug 14, 2024 · 0 comments

Comments

@richard-stokes-tfs
Copy link

Tested version: 0.12.4

When attempting to validate this schema with the example listed inside it will fail stating Expected: [object] Found: [string] when it should pass according to https://www.jsonschemavalidator.net/

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": " File Manifest",
  "description": "A manifest of the file",
  "examples": [
    {
      "specificationTitle": "type 1",
      "specificationVersion": "1.0.0",
      "implementationTitle": "implement name",
      "implementationVersion": "1.0.0",
      "applicationTitle": "application name",
      "applicationVersion": "1.0.0"
    }
  ],
  "$defs": {
    "specification": {
      "type": "string",
      "description": "",
      "enum": [ "type 1",
                "type 2",
                "type 3"]
    }
  },
  "type": "object",
  "properties": {
    "specificationTitle": {
      "$ref": "#/$defs/specification"
      },
    "specificationVersion2": {
      "description": "The version of the specification following x.y.z format",
      "type": "string",
      "pattern": "^\\d+\\.\\d+\\.\\d+$"
    },
    "specificationVersion": {
      "description": "The version of the specification following x.y.z format",
      "type": "string",
      "pattern": "^\\d+\\.\\d+\\.\\d+$"
    },
    "implementationTitle": {
      "description": "The name of the code which created the file",
      "type": "string"
    },
    "implementationVersion": {
      "description": "The version of the implementation that created the file following x.y.z format",
      "type": "string",
      "pattern": "^\\d+\\.\\d+\\.\\d+$"
    },
    "applicationTitle": {
      "description": "The name of the application that created the file",
      "type": "string"
    },
    "applicationVersion": {
      "description": "The version of the application that created the file following x.y.z format",
      "type": "string",
      "pattern": "^\\d+\\.\\d+\\.\\d+$"
    }
  },
  "required":  ["specificationTitle",
                "specificationVersion",
                "implementationTitle",
                "implementationVersion",
                "applicationTitle",
                "applicationVersion"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant