{"id":20199649,"url":"https://github.com/httpwg/structured-field-tests","last_synced_at":"2026-02-28T20:02:16.829Z","repository":{"id":43269436,"uuid":"128885794","full_name":"httpwg/structured-field-tests","owner":"httpwg","description":"Tests for HTTP Structured Field Values","archived":false,"fork":false,"pushed_at":"2026-01-11T03:35:40.000Z","size":409,"stargazers_count":41,"open_issues_count":0,"forks_count":23,"subscribers_count":12,"default_branch":"main","last_synced_at":"2026-01-11T11:02:36.036Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/httpwg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-04-10T06:39:48.000Z","updated_at":"2026-01-11T03:35:42.000Z","dependencies_parsed_at":"2025-05-24T02:28:00.136Z","dependency_job_id":"18a69ff6-b571-4b5a-a2ef-b291a9946f02","html_url":"https://github.com/httpwg/structured-field-tests","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/httpwg/structured-field-tests","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/httpwg%2Fstructured-field-tests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/httpwg%2Fstructured-field-tests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/httpwg%2Fstructured-field-tests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/httpwg%2Fstructured-field-tests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/httpwg","download_url":"https://codeload.github.com/httpwg/structured-field-tests/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/httpwg%2Fstructured-field-tests/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29951065,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T18:42:55.706Z","status":"ssl_error","status_checked_at":"2026-02-28T18:42:48.811Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":"2024-11-14T04:38:20.751Z","updated_at":"2026-02-28T20:02:16.794Z","avatar_url":"https://github.com/httpwg.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Structured Field Tests\n\nThese are test cases for implementations of [Structured Fields for HTTP](https://httpwg.org/specs/rfc9651.html).\n\n## Test Format\n\nEach test file is a JSON document that contains an array of test records. A test record is an\nobject with the following members:\n\n- `name`: A string describing the test\n- `raw`: An array of strings, each representing a field value received\n- `header_type`: One of \"item\", \"list\", \"dictionary\"\n- `expected`: The expected data structure after parsing (if successful). Required, unless `must_fail` is `true`.\n- `must_fail`: boolean indicating whether the test is required to fail. Defaults to `false`.\n- `can_fail`: boolean indicating whether failing this test is acceptable; for SHOULDs. Defaults to `false`.\n- `canonical`: An array of strings representing the canonical form of the field value, if it is different from `raw`. Not applicable if `must_fail` is `true`.\n\nThe `expected` data structure maps the types in Structured Fields to [JSON](https://tools.ietf.org/html/rfc8259) as follows:\n\n* Dictionary: JSON array of arrays with two elements, the member name and the member value\n* List: JSON array, where each element is either an Item or Inner-List\n* Inner-List: JSON array of arrays with two elements, the list (a JSON array of Items) and Parameters\n* Item: JSON array with two elements, the Bare-Item and Parameters\n* Bare-Item: one of:\n   * Integer: JSON numbers; e.g. 1\n   * Float: JSON numbers; e.g. 2.5\n   * String: JSON string; e.g., \"foo\"\n   * Token: `token` __type Object (see below)\n   * Binary Content: `binary` __type Object (see below)\n   * Boolean: JSON boolean; e.g., true\n   * Date: `date` __type Object (see below)\n   * Display String: `displaystring` __type Object (see below)\n* Parameters: JSON array of arrays with two element, the param name and the param value\n\nFor any test that case that has a valid outcome (i.e. `must_fail` is not `true`) the `expected`\ndata structure can be serialised.  The expected result of this serialisation is the `canonical`\nmember if specified, or `raw` otherwise.  The canonical form of a List or Dictionary with no\nmembers is an empty array, to represent the field being omitted.\n\nTest cases in the `serialisation-tests` directory can be used to test serialisation of an invalid\nor non-canonical value.  The `expected` structure (as defined above) should serialise to the\n`canonical` form, unless `must_fail` is `true` -- in which case the value cannot be serialised.\nThese cases do not have a `raw` element.\n\n[JSON Schemas](https://json-schema.org/) for these formats are provided in the `schemas` directory.\n\n### __type Objects\n\nBecause JSON doesn't natively accommodate some data types that Structured Fields does, the `expected` member uses an object with a `__type` member and a `value` member to represent these values.\n\nFor example:\n\n~~~\n{\n  \"__type\": \"token\",\n  \"value\": \"foo\"\n}\n~~~\n\n... carries a \"foo\" token. The following types are defined:\n\n* `token`: carries a Token as a JSON string; e.g., \"bar\"\n* `binary`: carries Binary Content as a **[base32](https://www.rfc-editor.org/rfc/rfc4648.html#section-6)**-encoded JSON string; e.g., \"ZXW6===\"\n* `date`: Carries a Date as a JSON integer; e.g., 1692859242\n* `displaystring`: Carries a Display String as a JSON string; e.g. \"Füü\"\n\n\n## Writing Tests\n\nAll tests should have a descriptive name. Tests should be as simple as possible - just what's\nrequired to test a specific piece of behavior. If you want to test interacting behaviors, create\ntests for each behavior as well as the interaction.\n\nIf a test file ends in `-generated.json`, please modify `generate.py` *and* re-generate the tests in your PR.\n\nPlease feel free to contribute!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhttpwg%2Fstructured-field-tests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhttpwg%2Fstructured-field-tests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhttpwg%2Fstructured-field-tests/lists"}