https://github.com/crowdhailer/oas
Parse an open api (previously swagger) spec.
https://github.com/crowdhailer/oas
Last synced: 11 months ago
JSON representation
Parse an open api (previously swagger) spec.
- Host: GitHub
- URL: https://github.com/crowdhailer/oas
- Owner: CrowdHailer
- Created: 2024-11-06T12:59:13.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-11T17:14:48.000Z (11 months ago)
- Last Synced: 2025-02-11T18:27:39.294Z (11 months ago)
- Language: Gleam
- Homepage: https://hex.pm/packages/oas
- Size: 16.6 KB
- Stars: 9
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# oas
Parse an open api (previously swagger) spec.
[](https://hex.pm/packages/oas)
[](https://hexdocs.pm/oas/)
```sh
gleam add oas@1
```
The `oas` library provides a decoder that is designed to be used with JSON or YAML.
```gleam
import gleam/json
import oas
pub fn main() {
let raw = todo as "some schema content"
let result = json.decode(raw, oas.decoder)
case result {
Ok(oas.Document(paths: paths, components: components, ..)) -> {
// use oas spec
}
Error(_) -> panic as "could not decode"
}
}
```
Further documentation can be found at .
## Development
```sh
gleam run # Run the project
gleam test # Run the tests
```
## Missing features
The following have not been present in the API's I have worked with.
Notably security is usually described in human readable language as part of API docs.
Contributions to add these are welcome. They will not require a breaking change to upgrade so I am committing to a 1.0 release
- Webhooks
- external docs
- security schemas
## Credit
Created for [EYG](https://eyg.run/), a new integration focused programming language.