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

Invalid JSON Schema type generated for s/tuple #270

Open
cale-at-reify opened this issue Feb 10, 2023 · 0 comments
Open

Invalid JSON Schema type generated for s/tuple #270

cale-at-reify opened this issue Feb 10, 2023 · 0 comments

Comments

@cale-at-reify
Copy link

The current definition for s/tuple is such that transforming (s/tuple ::sort-column ::sort-order) to json-schema results in

"sort-by": {
  "type": {
    "type": "array",
    "items": [
        {
          "type": "array",
          "items": { "type": "string" },
          "description": "A tuple of [axis, column] describing a log-format column"
        },
        { "enum": ["desc", "asc"] }
      ]
  }
}

The correct definition uses anyOf.

"sort-by": {
  "type": {
    "type": "array",
    "items": {
      "anyOf": [
        {
          "type": "array",
          "items": { "type": "string" },
          "description": "A tuple of [axis, column] describing a log-format column"
        },
        { "enum": ["desc", "asc"] }
      ]
    }
  }
}
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