{"id":28526759,"url":"https://github.com/python-jsonschema/vocab-json-seq","last_synced_at":"2026-01-31T03:01:55.398Z","repository":{"id":45287667,"uuid":"513457935","full_name":"python-jsonschema/vocab-json-seq","owner":"python-jsonschema","description":"An (experimental) vocabulary for validating JSON Text Sequences","archived":false,"fork":false,"pushed_at":"2025-08-13T10:48:34.000Z","size":29,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-01T18:14:33.983Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://python-jsonschema.github.io/vocab-json-seq/","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/python-jsonschema.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-07-13T09:24:21.000Z","updated_at":"2025-08-13T10:48:36.000Z","dependencies_parsed_at":"2024-04-21T20:42:55.765Z","dependency_job_id":null,"html_url":"https://github.com/python-jsonschema/vocab-json-seq","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/python-jsonschema/vocab-json-seq","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-jsonschema%2Fvocab-json-seq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-jsonschema%2Fvocab-json-seq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-jsonschema%2Fvocab-json-seq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-jsonschema%2Fvocab-json-seq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/python-jsonschema","download_url":"https://codeload.github.com/python-jsonschema/vocab-json-seq/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-jsonschema%2Fvocab-json-seq/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28927769,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T02:59:34.861Z","status":"ssl_error","status_checked_at":"2026-01-31T02:59:05.369Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-09T12:10:23.476Z","updated_at":"2026-01-31T03:01:55.379Z","avatar_url":"https://github.com/python-jsonschema.png","language":null,"readme":"# A JSON Schema Vocabulary for JSON Text Sequences (RFC 7464)\n\n## 1. Purpose\n\nThis document describes a simple [JSON Schema vocabulary](https://json-schema.org/draft/2020-12/json-schema-core.html#name-schema-vocabularies) that can be used to validate JSON text sequences as specified by [RFC 7464](https://datatracker.ietf.org/doc/html/rfc7464).\n\nIt defines two keywords which allow applying a JSON schema to individual elements in a JSON text sequence (hereafter \"sequence\") and producing an annotation of the element-wise result of application of the schema.\n\nThough indeed the entirety of a sequence is not itself a standard JSON type (nor valid JSON), proscribed below is a loose [`stream` type](#streams) whose implementation is left mostly to the specific language or implementation to further define.\n\n## 2. Declarations\n\nThe ID for this vocabulary is `https://python-jsonschema.github.io/vocab-json-seq/` (the URI to this document).\n\nA [draft 2020-12](https://json-schema.org/specification-links.html#2020-12) meta-schema which includes this vocabulary has been defined for convenience.\nThe `$id` for the meta-schema is `https://python-jsonschema.github.io/vocab-json-seq/meta.json`, and it can also be found at this address.\n\n## 3. The `jsonseq` Keyword\n\n### 3.1 Syntax and Semantics\n\nThe `jsonseq` keyword is a JSON Schema [annotation](https://json-schema.org/draft/2020-12/json-schema-core.html#name-annotations) whose value MUST be a valid JSON Schema.\n\nApplying the keyword to a stream instance MUST produce a single annotation result, itself a new stream.\nThe contents of the annotation stream MUST be the corresponding result of applying the schema element-wise to each element of the sequence.\n\nValidating an empty stream against this keyword (one which contains no elements) produces an empty stream annotation, as does validating a non-stream instance.\n\n### 3.2 Contextual Behavior\n\nThe `jsonseq` keyword MUST be processed contextually in accordance with the draft of the schema in which it is used. For example, if `jsonseq` is used in a schema that declares draft 2019-09, then its schema value must be processed using the rules specified by the 2019-09 specification.\n\n### 3.3 Beyond JSON Text Sequences\n\nImplementations MAY choose to offer support for notionally similar formats to JSON Text Sequence, such as [`jsonl`](https://jsonlines.org/), which uses newlines instead of record separators but is otherwise quite similar.\n\nIf such support is present, implementations SHOULD use the same `jsonseq` keyword to apply validation to streams containing `jsonl` data.\n\n## 4. Streams\n\n### 4.1 Overview \u0026 Representation\n\nThe processing of the `jsonseq` keyword, or truthfully of JSON Text Sequences themselves, depend on the abstract notion of a \"stream\".\n\nThis document does not define the specific implementation of streams. A programming language or implementation with lazy iterable support SHOULD represent streams using this language feature.\n\nImplementations MUST also consider JSON `array` values to be streams for the purpose of the keywords defined in this vocabulary.\n\nSchema authors who do not wish to allow `array` valued instances are RECOMMENDED to use existing JSON Schema mechanisms to exclude them (e.g. `{\"not\": {\"type\": \"array\"}}`).\n\nThe core JSON vocabulary [does not allow](https://json-schema.org/draft/2020-12/json-schema-core.html#name-instance-data-model) external vocabularies to define additional data types via the `type` keyword.\nIt does however [allow](https://json-schema.org/draft/2020-12/json-schema-core.html#name-non-json-instances) for the application of JSON Schema to types beyond those provided by JSON.\nA `streamType` keyword is therefore introduced below, which can be used to assert a value is a stream in the sense defined here.\n\n(Editor's note: the definition of `streamType` may be moved to a separate vocabulary in the future).\n\n### 4.2 The `streamType` Keyword\n\nThe value of the `streamType` keyword MUST be a boolean, or the value `null`.\n\nWhen `true`, validation MUST succeed if the instance is a stream, and fail otherwise.\nWhen `false`, validation MUST fail if the instance is a stream, and succeed otherwise.\nWhen `null`, validation always succeeds.\n\n## 5. A Short Example\n\nConsider the following schema, utilizing the two keywords above, which asserts that elements of a sequence are objects whose `foo` property is an integer at most 10:\n\n```json\n{\n  \"$schema\": \"https://python-jsonschema.github.io/vocab-json-seq/meta.json\",\n  \"streamType\": true,\n  \"jsonseq\": {\n    \"type\": \"object\",\n    \"properties\": {\n      \"foo\": {\n        \"type\": \"integer\",\n        \"maximum\": 10,\n      }\n    }\n  }\n}\n```\n\nFor simplicity, we delimit elements of a JSON Text Sequence below using newlines.\nConsider the sequence:\n\n```\n{}\n{}\n{\"foo\": 12}\n{\"foo\": 8}\n{\"foo\": {}}\n{\"foo\": 1}\n{}\n```\n\nThe aforementioned schema, when applied to this sequence, should produce a corresponding sequence of validation results:\n\n```\ntrue\ntrue\nfalse\ntrue\nfalse\ntrue\ntrue\n```\n\n## 6. Limitations \u0026 Open Questions\n\nImplementations of JSON Schema which do not support types beyond those present in JSON will undoubtedly not be able to implement this vocabulary easily.\nIn particular, implementation of this vocabulary requires a statically-typed implementation's `validate` entry point to operate on a union type (of JSON or stream), or requires equivalent language functionality.\nAn interesting note is that such possibilities may not be unique to this vocabulary, as any vocabulary introducing a new non-JSON-native type may change the signature of their validation methods.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpython-jsonschema%2Fvocab-json-seq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpython-jsonschema%2Fvocab-json-seq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpython-jsonschema%2Fvocab-json-seq/lists"}