{"id":50976022,"url":"https://github.com/sabino/openapi_fdw","last_synced_at":"2026-06-19T08:02:47.024Z","repository":{"id":62563424,"uuid":"388892321","full_name":"sabino/openapi_fdw","owner":"sabino","description":"A fully experimental Postgres Foreign Data Wrapper that turns any OpenAPI-described HTTP API into queryable Postgres tables — built in Hy","archived":false,"fork":false,"pushed_at":"2025-11-13T03:55:09.000Z","size":63,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-04T02:52:14.945Z","etag":null,"topics":["hy","lisp","openapi","postgresql"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sabino.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-23T18:27:55.000Z","updated_at":"2025-11-13T03:55:13.000Z","dependencies_parsed_at":"2022-11-03T15:45:15.921Z","dependency_job_id":null,"html_url":"https://github.com/sabino/openapi_fdw","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sabino/openapi_fdw","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sabino%2Fopenapi_fdw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sabino%2Fopenapi_fdw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sabino%2Fopenapi_fdw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sabino%2Fopenapi_fdw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sabino","download_url":"https://codeload.github.com/sabino/openapi_fdw/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sabino%2Fopenapi_fdw/sbom","scorecard":{"id":794315,"data":{"date":"2025-08-11","repo":{"name":"github.com/sabino/coincap_fdw","commit":"fbe91362cdb05503b31834b7712ad41825d403db"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.8,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/9 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/sabino/coincap_fdw/test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/sabino/coincap_fdw/test.yml/main?enable=pin","Warn: containerImage not pinned by hash: Dockerfile:1: pin your Docker image by updating postgres:15 to postgres:15@sha256:bc51cf4f1fe02cce7ed2370b20128a9b00b4eb804573a77d2a0d877aaa9c82b1","Warn: pipCommand not pinned by hash: Dockerfile:7-8","Warn: pipCommand not pinned by hash: Dockerfile:11","Warn: pipCommand not pinned by hash: .github/workflows/test.yml:17","Warn: pipCommand not pinned by hash: .github/workflows/test.yml:18","Warn: pipCommand not pinned by hash: .github/workflows/test.yml:19","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 containerImage dependencies pinned","Info:   0 out of   5 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 10 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":7,"reason":"3 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-9hjg-9r4m-mvj7","Warn: Project is vulnerable to: GHSA-9wx4-h78v-vm56","Warn: Project is vulnerable to: PYSEC-2023-74 / GHSA-j8r2-6x86-q33q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T08:30:01.647Z","repository_id":62563424,"created_at":"2025-08-23T08:30:01.648Z","updated_at":"2025-08-23T08:30:01.648Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34522042,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-19T02:00:06.005Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["hy","lisp","openapi","postgresql"],"created_at":"2026-06-19T08:02:46.167Z","updated_at":"2026-06-19T08:02:47.018Z","avatar_url":"https://github.com/sabino.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenAPI Foreign Data Wrapper\n\nThe OpenAPI FDW converts any OpenAPI/Swagger specification into a read-only schema that can be queried from PostgreSQL via [Multicorn](https://multicorn.org/). For each path + method combination you configure, the wrapper inspects the JSON response schema defined in the OpenAPI document, maps the response fields to columns, and issues HTTP requests at query time to return live data.\n\nThe entire FDW implementation is authored in [Hy](https://github.com/hylang/hy), with a tiny Python shim to expose the Hy class to PostgreSQL.\n\n## Highlights\n\n- Works with any OpenAPI 3.x document reachable over HTTP/HTTPS.\n- Automatically infers columns from the response schema; optional case-insensitive projection for narrower tables.\n- Supports nested response payloads through configurable data paths and passes JSON options (headers, query params) directly to the target API.\n- Hy-only codebase, making it a concise reference for implementing Multicorn FDWs in a Lisp syntax.\n\n## Getting Started\n\nInstall dependencies and run the test suite using [uv](https://github.com/astral-sh/uv):\n\n```bash\nuv sync\nuv run python -m unittest discover -s tests -v\n```\n\n### Basic Usage\n\n```sql\nCREATE EXTENSION multicorn;\n\nCREATE SERVER petstore\n  FOREIGN DATA WRAPPER multicorn\n  OPTIONS (\n    wrapper 'openapi_fdw.OpenAPIForeignDataWrapper',\n    openapi_url 'https://petstore3.swagger.io/api/v3/openapi.json',\n    path '/pet',\n    method 'get'\n  );\n\nCREATE FOREIGN TABLE pets (\n  id integer,\n  name text,\n  status text\n) SERVER petstore;\n```\n\nEach query against `pets` fetches the OpenAPI specification (cached by Multicorn) and the corresponding endpoint, then returns JSON objects mapped to the requested columns.\n\n### Configuration Options\n\n| Option         | Description                                                                                 | Default              |\n|----------------|---------------------------------------------------------------------------------------------|----------------------|\n| `openapi_url`  | URL pointing to the OpenAPI document (JSON).                                                | _required_           |\n| `path`         | Path template (as defined in the spec) to query.                                            | _required_           |\n| `method`       | HTTP method to use when calling the path.                                                   | `get`                |\n| `server_url`   | Override for the server URL; falls back to the first `servers` entry in the document.      | first server url     |\n| `data_path`    | Slash-separated path inside the JSON payload that resolves to the array of rows.           | root (when schema is an array) |\n| `query_params` | JSON object defining static query string parameters sent with every request.               | none                 |\n| `headers`      | JSON object containing HTTP headers to attach to both the spec and data requests.          | none                 |\n| `timeout`      | Request timeout in seconds used for both the spec fetch and data queries.                  | `10.0`               |\n\nResponse payloads must ultimately resolve to a JSON array of objects after applying `data_path`.\n\n## Project Layout\n\n```\nopenapi_fdw/\n├── openapi_fdw/\n│   ├── __init__.py      # Python shim exposing the Hy wrapper\n│   ├── api.hy           # OpenAPI parsing helpers and HTTP utilities\n│   └── wrapper.hy       # Hy implementation of the Multicorn FDW\n├── tests/               # Unit, integration, and docker-based smoke tests\n├── pyproject.toml       # Project metadata / uv configuration\n├── requirements.txt     # Runtime dependencies\n├── Dockerfile           # Postgres + Multicorn test image\n└── README.md            # This document\n```\n\n## License\n\nDistributed under the terms of the WTFPL as declared in `setup.py`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsabino%2Fopenapi_fdw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsabino%2Fopenapi_fdw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsabino%2Fopenapi_fdw/lists"}