{"id":27064160,"url":"https://github.com/emptyless/go-spectral","last_synced_at":"2025-04-05T16:37:18.458Z","repository":{"id":282259038,"uuid":"926411272","full_name":"Emptyless/go-spectral","owner":"Emptyless","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-13T15:32:13.000Z","size":1057,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-30T07:57:01.075Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/Emptyless.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,"publiccode":null,"codemeta":null}},"created_at":"2025-02-03T07:51:09.000Z","updated_at":"2025-03-13T15:32:18.000Z","dependencies_parsed_at":"2025-03-13T19:15:30.675Z","dependency_job_id":null,"html_url":"https://github.com/Emptyless/go-spectral","commit_stats":null,"previous_names":["emptyless/go-spectral"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Emptyless%2Fgo-spectral","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Emptyless%2Fgo-spectral/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Emptyless%2Fgo-spectral/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Emptyless%2Fgo-spectral/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Emptyless","download_url":"https://codeload.github.com/Emptyless/go-spectral/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247369559,"owners_count":20927921,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-04-05T16:37:18.029Z","updated_at":"2025-04-05T16:37:18.442Z","avatar_url":"https://github.com/Emptyless.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go-Spectral\n\n_This tool is under active development and must be considered alpha. It's API may be changed in a breaking way until a\n1.0 version is released. Submit issues to the Github issue tracker if found._\n\n`go-spectral` is a Go wrapper for [stoplightio/spectral](https://github.com/stoplightio/spectral) using the pure Go\nECMAScript 5.1 implementation [Goja](https://github.com/dop251/goja) with Node support\nusing [goja_nodejs](https://github.com/dop251/goja_nodejs). The additional Node system calls are translated (roughly) to\neither no-op's (if the function during preliminary testing was not used) or the respective Go SDK methods.\n\n### Import\n\n```\n$ go get github.com/Emptyless/go-spectral@latest\n```\n\n### Quickstart\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/Emptyless/go-spectral\"\n)\n\nfunc main() {\n\toutput, err := gospectral.Lint([]string{\"./openapi.yaml\"}, \"./.spectral.yaml\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(output)\n}\n```\n\n### Options\n\nTo customise the behavior of `Lint`, additional options can be supplied:\n\n- `WithWorkingDirectory`: sets the working directory used to load system files (e.g. .spectral.yaml)\n- `WithFS`: sets the `Config.FS` to load documents and rulesets from. This can be useful when using e.g. `embed.FS` as a\n  means to bundle specs/rulesets.\n- `WithDist`: sets the `Config.Dist` to a custom supplied value. This can be useful for using a specific version of the\n  source and/or bundling it on your own.\n- `WithScript`: sets the `Config.Script` to a custom value\n- `WithBeforeModule`: is evaluated before any module is enabled and can be used to change e.g. the Loader. If a non-nil\n  `Enable.Fn` is returned, it is used instead of the provided Enable\n- `WithAfterModule`: is evaluated after any module is enabled and can be used to change the current runtime state\n\n### TODO's\n\n- [x] get basic structure of the wrapper working\n- [ ] add tests\n\n### Mentions\n\n- [stoplightio/spectral](https://github.com/stoplightio/spectral): JSON/YAML linter with support for OpenAPI\n- [dop251/goja](https://github.com/dop251/goja): Go ECMAScript 5.1 Implementation\n- [dop251/goja_nodejs](https://github.com/dop251/goja_nodejs): Goja implementations of NodeJS packages\n\n# Notice\n\nSee `./NOTICE` for the NOTICE as produced by the `webpack-license-plugin` for `dist/built.js`\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femptyless%2Fgo-spectral","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femptyless%2Fgo-spectral","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femptyless%2Fgo-spectral/lists"}