8000 Invalid JSON Schema type generated for `s/tuple` · Issue #270 · metosin/spec-tools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Invalid JSON Schema type generated for s/tuple #270

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and t 8000 he 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

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
0